From d888c7d20dd8c55e775cc5059c900873cbaec2e8 Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Fri, 18 Nov 2022 20:08:55 +0100 Subject: [PATCH] fix update of view when changing sort method --- .idea/libraries/Dart_Packages.xml | 340 +++++++++--------- .idea/libraries/Dart_SDK.xml | 38 +- .../lib/views/pages/main/w_discovery.dart | 12 +- 3 files changed, 200 insertions(+), 190 deletions(-) diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml index b25f471..c2384f5 100644 --- a/.idea/libraries/Dart_Packages.xml +++ b/.idea/libraries/Dart_Packages.xml @@ -5,686 +5,686 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml index b6e6985..6ae284f 100644 --- a/.idea/libraries/Dart_SDK.xml +++ b/.idea/libraries/Dart_SDK.xml @@ -1,25 +1,25 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart index 8029274..a016196 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_discovery.dart @@ -40,7 +40,10 @@ class _DiscoveryWidgetState extends State { onPressed: () { MyApp.controller.currentUser.sortChoise = !MyApp.controller.currentUser.sortChoise; - setState(() {}); + rebuildAllChildren(context); + setState(() { + + }); }, style: OutlinedButton.styleFrom( shadowColor: Colors.black, @@ -81,6 +84,13 @@ class _DiscoveryWidgetState extends State { ), ); } + void rebuildAllChildren(BuildContext context) { + void rebuild(Element el) { + el.markNeedsBuild(); + el.visitChildren(rebuild); + } + (context as Element).visitChildren(rebuild); + } } class DiscoveryList extends StatefulWidget {