From 283f915354dcc81410b30534c1eda063d0e78888 Mon Sep 17 00:00:00 2001 From: Felipe Erias Date: Thu, 2 Dec 2021 15:36:03 +0900 Subject: Added coment on state management --- lib/homescreen.dart | 6 ++++++ 1 file changed, 6 insertions(+) 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 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), -- cgit 1.2.3-korg