From e2950d274afaeaf96a593221cb65e596aa493ba8 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Sat, 8 Jun 2024 11:53:38 -0400 Subject: [PATCH] invert wear check --- lib/main.dart | 97 +++++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index bfed6a7d..7f821e22 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -79,7 +79,7 @@ Future main() async { //initDio(); mainLogger.fine("Init Sentry"); await SentryFlutter.init( - (options) async { + (options) async { options.dsn = 'https://cd338ff75dd419608f4704e517904a1d@o4507396530307072.ingest.de.sentry.io/4507396677501008'; options.addIntegration(LoggingIntegration()); options.attachScreenshot = true; //not supported on GlitchTip @@ -95,15 +95,14 @@ Future main() async { }, // Init your App. // ignore: missing_provider_scope - appRunner: () => - runApp( - DefaultAssetBundle( - bundle: SentryAssetBundle(), - child: SentryScreenshotWidget( - child: TailApp(), - ), - ), + appRunner: () => runApp( + DefaultAssetBundle( + bundle: SentryAssetBundle(), + child: SentryScreenshotWidget( + child: TailApp(), ), + ), + ), ); } @@ -237,28 +236,28 @@ class _TailAppState extends State { child: _EagerInitialization( child: BtAppStateController( child: BetterFeedback( - themeMode: ThemeMode.system, - darkTheme: FeedbackThemeData.dark(), - child: ValueListenableBuilder( - valueListenable: SentryHive.box(settings).listenable(keys: [appColor]), - builder: (BuildContext context, value, Widget? child) { - setupSystemColor(context); - Future(() => FlutterNativeSplash.remove()); //remove the splash screen one frame later - Color color = Color(HiveProxy.getOrDefault(settings, appColor, defaultValue: appColorDefault)); - return MaterialApp.router( - title: title(), - color: color, - theme: buildTheme(Brightness.light, color), - darkTheme: buildTheme(Brightness.dark, color), - routerConfig: router, - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - themeMode: ThemeMode.system, - debugShowCheckedModeBanner: false, - ); - }, - ), - )), + themeMode: ThemeMode.system, + darkTheme: FeedbackThemeData.dark(), + child: ValueListenableBuilder( + valueListenable: SentryHive.box(settings).listenable(keys: [appColor]), + builder: (BuildContext context, value, Widget? child) { + setupSystemColor(context); + Future(() => FlutterNativeSplash.remove()); //remove the splash screen one frame later + Color color = Color(HiveProxy.getOrDefault(settings, appColor, defaultValue: appColorDefault)); + return MaterialApp.router( + title: title(), + color: color, + theme: buildTheme(Brightness.light, color), + darkTheme: buildTheme(Brightness.dark, color), + routerConfig: router, + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + themeMode: ThemeMode.system, + debugShowCheckedModeBanner: false, + ); + }, + ), + )), ), ); } @@ -302,31 +301,39 @@ class RiverpodProviderObserver extends ProviderObserver { final Logger riverpodLogger = Logger('Riverpod'); @override - void didAddProvider(ProviderBase provider, - Object? value, - ProviderContainer container,) { + void didAddProvider( + ProviderBase provider, + Object? value, + ProviderContainer container, + ) { riverpodLogger.info('Provider $provider was initialized with $value'); } @override - void didDisposeProvider(ProviderBase provider, - ProviderContainer container,) { + void didDisposeProvider( + ProviderBase provider, + ProviderContainer container, + ) { riverpodLogger.info('Provider $provider was disposed'); } @override - void didUpdateProvider(ProviderBase provider, - Object? previousValue, - Object? newValue, - ProviderContainer container,) { + void didUpdateProvider( + ProviderBase provider, + Object? previousValue, + Object? newValue, + ProviderContainer container, + ) { riverpodLogger.info('Provider $provider updated from $previousValue to $newValue'); } @override - void providerDidFail(ProviderBase provider, - Object error, - StackTrace stackTrace, - ProviderContainer container,) { + void providerDidFail( + ProviderBase provider, + Object error, + StackTrace stackTrace, + ProviderContainer container, + ) { riverpodLogger.warning('Provider $provider threw $error at $stackTrace', error, stackTrace); } } @@ -345,7 +352,7 @@ class _EagerInitialization extends ConsumerWidget { //ref.watch(moveListsProvider); //ref.watch(favoriteActionsProvider); ref.watch(appShortcutsProvider); - if (!kDebugMode) { + if (kDebugMode) { ref.watch(initWearProvider); } return child;