You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Desired behavior: for the gene report and drug search tab, data should update in the respective inactive tab after an active medication change (optimally; always also possible)
Currently implementing: solution using ChangeNotifier
Add provider and change notifier for active medications
Use consumers everywhere where UserData.instance.activeDrugNames is used to manipulate activeMedications
Use consumers everywhere where UserData.instance.activeDrugNames is used in the UI
Test in simulator
Adapt/write tests
Possible solutions
Add maintainState: false toAutoRoute definitions in lib/report/module.dart and lib/search/module.dart (see StackOverflow)
Only in empty root route: updates state but always goes back to main route, which is not really the desired behavior, but might work if no other solution does
Only in child routes: does not change behavior on tab change; introduces bug that drug list is filtered by name but name is not present anymore (it does not go back to the full list), additionally throws unhandled exceptions
In all routes: combination of cases above
Manipulate router stack in lib/common/pages/drug/widgets/annotation_cards/drug.dart (inside CupertinoDialogAction:onPressed)
Navigator.popUntil(context, (route) => false);: Removes everything from the router (including tabs) and throws unhandled exceptions
Get current tab router and navigate to index (see below), while adding maintainState: false to root child routes (see above): works perfectly for report page reset but not drugs page, probably due to filter state; also not optimal from usability perspective, would be better if data just updates
Refactor routes to only get minimum information (e.g., drug name or gene name) and always fetch further information dynamically (need to test whether re-build is triggered then): _not tried yet, probably need to use maintainState and will have same problems as above
Desired behavior: for the gene report and drug search tab, data should update in the respective inactive tab after an active medication change (optimally; always also possible)
Currently implementing: solution using ChangeNotifier
UserData.instance.activeDrugNames
is used to manipulate activeMedicationsUserData.instance.activeDrugNames
is used in the UIPossible solutions
maintainState: false
toAutoRoute
definitions inlib/report/module.dart
andlib/search/module.dart
(see StackOverflow)lib/common/pages/drug/widgets/annotation_cards/drug.dart
(insideCupertinoDialogAction:onPressed
)Navigator.popUntil(context, (route) => false);
: Removes everything from the router (including tabs) and throws unhandled exceptionsmaintainState: false
to root child routes (see above): works perfectly for report page reset but not drugs page, probably due to filter state; also not optimal from usability perspective, would be better if data just updatesmaintainState
and will have same problems as aboveCode that does not work but might be useful in the future: get dependent tab and navigate to root:
The text was updated successfully, but these errors were encountered: