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.
This commit is contained in:
Vishesh Handa
2020-10-23 16:34:38 +02:00
parent aa805f80c5
commit 56adb27f01

View File

@ -49,13 +49,15 @@ class JournalApp extends StatefulWidget {
Widget app = ChangeNotifierProvider.value( Widget app = ChangeNotifierProvider.value(
value: repo, value: repo,
child: ChangeNotifierProvider.value( child: Consumer<Repository>(
builder: (_, repo, __) => ChangeNotifierProvider.value(
value: repo.settings, value: repo.settings,
child: ChangeNotifierProvider.value( child: ChangeNotifierProvider.value(
child: JournalApp(), child: JournalApp(),
value: repo.notesFolder, value: repo.notesFolder,
), ),
), ),
),
); );
app = ChangeNotifierProvider.value( app = ChangeNotifierProvider.value(