mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-04-19 20:59:36 +00:00
fix: bad state when reading player for theme and new login
This commit is contained in:
parent
e7205ed874
commit
747dbdb46f
1 changed files with 28 additions and 19 deletions
|
|
@ -83,26 +83,32 @@ class MyApp extends ConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (themeSettings.useCurrentPlayerThemeThroughoutApp) {
|
if (themeSettings.useCurrentPlayerThemeThroughoutApp) {
|
||||||
final player = ref.watch(audiobookPlayerProvider);
|
try {
|
||||||
if (player.book != null) {
|
final player = ref.watch(audiobookPlayerProvider);
|
||||||
final themeLight = ref.watch(
|
if (player.book != null) {
|
||||||
themeOfLibraryItemProvider(
|
final themeLight = ref.watch(
|
||||||
player.book!.libraryItemId,
|
themeOfLibraryItemProvider(
|
||||||
highContrast: shouldUseHighContrast,
|
player.book!.libraryItemId,
|
||||||
brightness: Brightness.light,
|
highContrast: shouldUseHighContrast,
|
||||||
),
|
brightness: Brightness.light,
|
||||||
);
|
),
|
||||||
final themeDark = ref.watch(
|
);
|
||||||
themeOfLibraryItemProvider(
|
final themeDark = ref.watch(
|
||||||
player.book!.libraryItemId,
|
themeOfLibraryItemProvider(
|
||||||
highContrast: shouldUseHighContrast,
|
player.book!.libraryItemId,
|
||||||
brightness: Brightness.dark,
|
highContrast: shouldUseHighContrast,
|
||||||
),
|
brightness: Brightness.dark,
|
||||||
);
|
),
|
||||||
if (themeLight.valueOrNull != null && themeDark.valueOrNull != null) {
|
);
|
||||||
lightColorScheme = themeLight.valueOrNull!;
|
if (themeLight.valueOrNull != null && themeDark.valueOrNull != null) {
|
||||||
darkColorScheme = themeDark.valueOrNull!;
|
lightColorScheme = themeLight.valueOrNull!;
|
||||||
|
darkColorScheme = themeDark.valueOrNull!;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
debugPrintStack(stackTrace: StackTrace.current, label: e.toString());
|
||||||
|
appLogger.severe('not building with player theme');
|
||||||
|
appLogger.severe(e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final appThemeLight = ThemeData(
|
final appThemeLight = ThemeData(
|
||||||
|
|
@ -129,6 +135,8 @@ class MyApp extends ConsumerWidget {
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrintStack(stackTrace: StackTrace.current, label: e.toString());
|
debugPrintStack(stackTrace: StackTrace.current, label: e.toString());
|
||||||
|
appLogger.severe(e.toString());
|
||||||
|
|
||||||
if (needOnboarding) {
|
if (needOnboarding) {
|
||||||
routerConfig.goNamed(Routes.onboarding.name);
|
routerConfig.goNamed(Routes.onboarding.name);
|
||||||
}
|
}
|
||||||
|
|
@ -155,6 +163,7 @@ class _EagerInitialization extends ConsumerWidget {
|
||||||
ref.watch(shakeDetectorProvider);
|
ref.watch(shakeDetectorProvider);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrintStack(stackTrace: StackTrace.current, label: e.toString());
|
debugPrintStack(stackTrace: StackTrace.current, label: e.toString());
|
||||||
|
appLogger.severe(e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return child;
|
return child;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue