Skip to content

Commit

Permalink
invert wear check
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jun 8, 2024
1 parent 82b5226 commit e2950d2
Showing 1 changed file with 52 additions and 45 deletions.
97 changes: 52 additions & 45 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Future<void> 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
Expand All @@ -95,15 +95,14 @@ Future<void> 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(),
),
),
),
);
}

Expand Down Expand Up @@ -237,28 +236,28 @@ class _TailAppState extends State<TailApp> {
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,
);
},
),
)),
),
);
}
Expand Down Expand Up @@ -302,31 +301,39 @@ class RiverpodProviderObserver extends ProviderObserver {
final Logger riverpodLogger = Logger('Riverpod');

@override
void didAddProvider(ProviderBase<Object?> provider,
Object? value,
ProviderContainer container,) {
void didAddProvider(
ProviderBase<Object?> provider,
Object? value,
ProviderContainer container,
) {
riverpodLogger.info('Provider $provider was initialized with $value');
}

@override
void didDisposeProvider(ProviderBase<Object?> provider,
ProviderContainer container,) {
void didDisposeProvider(
ProviderBase<Object?> provider,
ProviderContainer container,
) {
riverpodLogger.info('Provider $provider was disposed');
}

@override
void didUpdateProvider(ProviderBase<Object?> provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,) {
void didUpdateProvider(
ProviderBase<Object?> provider,
Object? previousValue,
Object? newValue,
ProviderContainer container,
) {
riverpodLogger.info('Provider $provider updated from $previousValue to $newValue');
}

@override
void providerDidFail(ProviderBase<Object?> provider,
Object error,
StackTrace stackTrace,
ProviderContainer container,) {
void providerDidFail(
ProviderBase<Object?> provider,
Object error,
StackTrace stackTrace,
ProviderContainer container,
) {
riverpodLogger.warning('Provider $provider threw $error at $stackTrace', error, stackTrace);
}
}
Expand All @@ -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;
Expand Down

0 comments on commit e2950d2

Please sign in to comment.