From 56adb27f013ca462d486f8ae34872e5b70b56b18 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 23 Oct 2020 16:34:38 +0200 Subject: [PATCH] App: Use a provider consumer I'm hoping with this if any value in the repo changes it will result in a rubuild of the entire subtree, so this way I can change the entire NotesFolderFS easily. --- lib/app.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/app.dart b/lib/app.dart index 8b95ac36..057f0e6d 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -49,11 +49,13 @@ class JournalApp extends StatefulWidget { Widget app = ChangeNotifierProvider.value( value: repo, - child: ChangeNotifierProvider.value( - value: repo.settings, - child: ChangeNotifierProvider.value( - child: JournalApp(), - value: repo.notesFolder, + child: Consumer( + builder: (_, repo, __) => ChangeNotifierProvider.value( + value: repo.settings, + child: ChangeNotifierProvider.value( + child: JournalApp(), + value: repo.notesFolder, + ), ), ), );