refactor: improvements
This commit is contained in:
@@ -249,10 +249,9 @@ final apiTokenUpdaterProvider = Provider<void>((ref) {
|
||||
ref.listen<String?>(authTokenProvider3, (previous, next) {
|
||||
final api = ref.read(apiServiceProvider);
|
||||
if (api != null) {
|
||||
api.updateAuthToken(next ?? '');
|
||||
foundation.debugPrint(
|
||||
'DEBUG: Applied auth token to API (len=${next?.length ?? 0})',
|
||||
);
|
||||
api.updateAuthToken(next);
|
||||
final length = next?.length ?? 0;
|
||||
foundation.debugPrint('DEBUG: Applied auth token to API (len=$length)');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -160,8 +160,13 @@ final appStartupFlowProvider = Provider<void>((ref) {
|
||||
// match theme after the first frame. Avoids flicker at startup.
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
try {
|
||||
final isDark =
|
||||
WidgetsBinding.instance.window.platformBrightness == Brightness.dark;
|
||||
final context = NavigationService.context;
|
||||
final view = context != null ? View.maybeOf(context) : null;
|
||||
final dispatcher = WidgetsBinding.instance.platformDispatcher;
|
||||
final platformBrightness =
|
||||
view?.platformDispatcher.platformBrightness ??
|
||||
dispatcher.platformBrightness;
|
||||
final isDark = platformBrightness == Brightness.dark;
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
statusBarIconBrightness: isDark ? Brightness.light : Brightness.dark,
|
||||
|
||||
Reference in New Issue
Block a user