From d9d9ae187e8f6d5625fd957a51d72e8b51d30942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Tue, 5 Mar 2024 18:26:22 +0000 Subject: [PATCH 1/2] hotfix: session provider has null state on 1st use --- uni/lib/main.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 854cf9755..0cfd8e6d5 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -132,6 +132,9 @@ Future main() async { plausible: plausible, child: MultiProvider( providers: [ + ChangeNotifierProvider( + create: (context) => stateProviders.sessionProvider, + ), ChangeNotifierProvider( create: (context) => stateProviders.lectureProvider, ), @@ -150,9 +153,6 @@ Future main() async { ChangeNotifierProvider( create: (context) => stateProviders.courseUnitsInfoProvider, ), - ChangeNotifierProvider( - create: (context) => stateProviders.sessionProvider, - ), ChangeNotifierProvider( create: (context) => stateProviders.calendarProvider, ), From 7b7bac4d632d1eefbf0c1f28c74de21ccb3b7e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lima?= Date: Tue, 5 Mar 2024 18:55:11 +0000 Subject: [PATCH 2/2] refactor: move profile provider after session provider --- uni/lib/main.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 0cfd8e6d5..76e9e780a 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -135,6 +135,9 @@ Future main() async { ChangeNotifierProvider( create: (context) => stateProviders.sessionProvider, ), + ChangeNotifierProvider( + create: (context) => stateProviders.profileProvider, + ), ChangeNotifierProvider( create: (context) => stateProviders.lectureProvider, ), @@ -147,9 +150,6 @@ Future main() async { ChangeNotifierProvider( create: (context) => stateProviders.restaurantProvider, ), - ChangeNotifierProvider( - create: (context) => stateProviders.profileProvider, - ), ChangeNotifierProvider( create: (context) => stateProviders.courseUnitsInfoProvider, ),