From 9be2f160636c08e00058f71825915df877a74d55 Mon Sep 17 00:00:00 2001 From: Anton Malofeev Date: Fri, 22 Oct 2021 06:23:14 +0300 Subject: [PATCH] bump: 3.3.2+1 --- lib/screens/app/app_store_initializer.dart | 19 +++++++++++++++++++ pubspec.yaml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/screens/app/app_store_initializer.dart b/lib/screens/app/app_store_initializer.dart index 84eee322..c9efad9e 100644 --- a/lib/screens/app/app_store_initializer.dart +++ b/lib/screens/app/app_store_initializer.dart @@ -17,20 +17,25 @@ class AppStoreInitializer extends ConsumerWidget { .platformBrightness; return FutureBuilder( future: () async { + print('start'); if (settings.appInitialStateLoaded) { return !settings.appInitialStateIsLoading; } + print('settings to true'); settings ..appInitialStateLoaded = true ..appInitialStateIsLoading = true; await SettingsStateScope.of(context).load(); + print('settings loaded'); await Hive.openBox( HiveBoxesIds.ideaProjectAnswerKey, ); + print('ideaProjectAnswerKey loaded'); final ideas = await Hive.openBox(HiveBoxesIds.ideaProjectKey); + print('ideas loaded'); final questions = await Hive.openBox( HiveBoxesIds.ideaProjectQuestionKey, @@ -48,50 +53,64 @@ class AppStoreInitializer extends ConsumerWidget { questions.values.map((final e) => MapEntry(e.id, e)), ), ); + print('questions loaded'); ref.read(ideaProjectsProvider.notifier).putAll( Map.fromEntries( ideas.values.map((final e) => MapEntry(e.id, e)), ), ); + print('ideaProjectsProvider loaded'); final notes = await Hive.openBox(HiveBoxesIds.noteProjectKey); + print('notes loaded'); ref.read(noteProjectsProvider.notifier).putAll( Map.fromEntries( notes.values.map((final e) => MapEntry(e.id, e)), ), ); + print('noteProjectsProvider loaded'); await Hive.openBox(HiveBoxesIds.storyProjectKey); + print('StoryProject loaded'); /// ***************** MIGRATION START ******************* // TODO(arenukvern): remove old stores after all devices migration + print('migration started'); try { + print('darkModeKey started'); if (await Hive.boxExists(HiveBoxesIds.darkModeKey)) { await Hive.deleteBoxFromDisk(HiveBoxesIds.darkModeKey); } + print('darkModeKey ended'); + print('answers migration started'); if (await Hive.boxExists(HiveBoxesIds.projectsKey) && await Hive.boxExists(HiveBoxesIds.answersKey)) { await Hive.openBox(HiveBoxesIds.answersKey); final projects = await Hive.openBox(HiveBoxesIds.projectsKey); + print('projects started'); for (final project in projects.values) { + print('project $project'); await project.saveAsIdeaProject(ref); } await Hive.deleteBoxFromDisk(HiveBoxesIds.answersKey); await Hive.deleteBoxFromDisk(HiveBoxesIds.projectsKey); } + print('projects completed and removed'); } catch (e) { print('error: $e'); } /// ***************** MIGRATION END ******************* settings.appInitialStateIsLoading = false; + print('loaded. preparing to reload'); WidgetsBinding.instance?.addPostFrameCallback((final _) { + print('notifying to reload'); settings.notify(); }); return true; diff --git a/pubspec.yaml b/pubspec.yaml index 75239858..f4265a01 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.3.1+1 +version: 3.3.2+1 environment: sdk: ">=2.14.0 <3.0.0"