aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Erias <felipeerias@igalia.com>2021-12-02 15:36:03 +0900
committerFelipe Erias <felipeerias@igalia.com>2021-12-02 15:36:03 +0900
commit283f915354dcc81410b30534c1eda063d0e78888 (patch)
treec3d0c7f6f23c9ac45f42f5869472b951fd76f5a5
parenta35701737f1991c1615e621fe8f03ec7ad448e6d (diff)
Added coment on state management
-rw-r--r--lib/homescreen.dart6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/homescreen.dart b/lib/homescreen.dart
index 1591169..dce45cd 100644
--- a/lib/homescreen.dart
+++ b/lib/homescreen.dart
@@ -143,6 +143,12 @@ class _HomescreenState extends State<Homescreen> with TickerProviderStateMixin {
),
// This is the main content.
Expanded(
+ // TODO This solution adds a nice animation but loses the state
+ // of the old page whenever a new one comes in. We could use
+ // IndexedStack to keep the state of each page, at the cost of not
+ // having nice animations between pages. Another option could be to
+ // move the state of each page upwards in the tree.
+ // See also: https://docs.flutter.dev/development/data-and-backend/state-mgmt/options
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
reverseDuration: const Duration(milliseconds: 500),