Im Moment habe ich < /p>
return PopScope(
canPop: false,
onPopInvokedWithResult: (bool didPop, Object? result) async {
if (result == null){
final navigator = Navigator.of(context);
await _save();
navigator.pop(true);
}
},
< /code>
Was funktioniert, aber ich bin mir sicher, dass es zuverlässig ist. Das liegt daran, dass _save () davon abhängt, Informationen aus dem Widget -Baum abzurufen. Ich mag es auch nicht, wie ich das Catch -System interpretiere, indem ich dieses Ergebnis überprüfe == NULL. Auch hier scheint es unzuverlässig. Ich bin mir auch nicht sicher, ob die asynchrische Funktion akzeptabel ist. Bonusfrage: Gibt es eine Möglichkeit, Push ? )
Gibt es eine einfache, Standardmethode, um Pops abzufangen, während der Widget -Baum noch verfügbar ist? ⇐ Android
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Überprüfen Sie sauber, ob alle Komponistenpakete noch tatsächlich verfügbar sind
by Anonymous » » in Php - 0 Replies
- 0 Views
-
Last post by Anonymous
-