|
|
@ -36,16 +36,8 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming? _nextcloudTheme; |
|
|
|
NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming? _nextcloudTheme; |
|
|
|
final _platformBrightness = BehaviorSubject<Brightness>.seeded(WidgetsBinding.instance.window.platformBrightness); |
|
|
|
|
|
|
|
Rect? _lastBounds; |
|
|
|
Rect? _lastBounds; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void didChangePlatformBrightness() { |
|
|
|
|
|
|
|
_platformBrightness.add(WidgetsBinding.instance.window.platformBrightness); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super.didChangePlatformBrightness(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
@ -260,42 +252,43 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra |
|
|
|
if (_platform.canUseWindowManager) { |
|
|
|
if (_platform.canUseWindowManager) { |
|
|
|
windowManager.removeListener(this); |
|
|
|
windowManager.removeListener(this); |
|
|
|
} |
|
|
|
} |
|
|
|
unawaited(_platformBrightness.close()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
super.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(final BuildContext context) => StreamBuilder<Brightness>( |
|
|
|
Widget build(final BuildContext context) => OptionBuilder( |
|
|
|
stream: _platformBrightness, |
|
|
|
option: widget.globalOptions.themeMode, |
|
|
|
builder: (final context, final platformBrightnessSnapshot) => OptionBuilder( |
|
|
|
builder: (final context, final themeMode) => OptionBuilder( |
|
|
|
option: widget.globalOptions.themeMode, |
|
|
|
option: widget.globalOptions.themeOLEDAsDark, |
|
|
|
builder: (final context, final themeMode) => OptionBuilder( |
|
|
|
builder: (final context, final themeOLEDAsDark) => OptionBuilder( |
|
|
|
option: widget.globalOptions.themeOLEDAsDark, |
|
|
|
option: widget.globalOptions.themeKeepOriginalAccentColor, |
|
|
|
builder: (final context, final themeOLEDAsDark) => OptionBuilder( |
|
|
|
builder: (final context, final themeKeepOriginalAccentColor) => StreamBuilder<Account?>( |
|
|
|
option: widget.globalOptions.themeKeepOriginalAccentColor, |
|
|
|
stream: widget.accountsBloc.activeAccount, |
|
|
|
builder: (final context, final themeKeepOriginalAccentColor) => StreamBuilder<Account?>( |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
stream: widget.accountsBloc.activeAccount, |
|
|
|
if (themeMode == null || themeOLEDAsDark == null) { |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
return Container(); |
|
|
|
if (themeMode == null || !platformBrightnessSnapshot.hasData || themeOLEDAsDark == null) { |
|
|
|
} |
|
|
|
return Container(); |
|
|
|
|
|
|
|
} |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
|
|
|
|
return MaterialApp.router( |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates, |
|
|
|
return MaterialApp.router( |
|
|
|
supportedLocales: AppLocalizations.supportedLocales, |
|
|
|
localizationsDelegates: AppLocalizations.localizationsDelegates, |
|
|
|
themeMode: themeMode, |
|
|
|
supportedLocales: AppLocalizations.supportedLocales, |
|
|
|
theme: getThemeFromNextcloudTheme( |
|
|
|
theme: getThemeFromNextcloudTheme( |
|
|
|
_nextcloudTheme, |
|
|
|
_nextcloudTheme, |
|
|
|
Brightness.light, |
|
|
|
themeMode, |
|
|
|
keepOriginalAccentColor: _nextcloudTheme == null || (themeKeepOriginalAccentColor ?? false), |
|
|
|
platformBrightnessSnapshot.data!, |
|
|
|
), |
|
|
|
oledAsDark: themeOLEDAsDark, |
|
|
|
darkTheme: getThemeFromNextcloudTheme( |
|
|
|
keepOriginalAccentColor: _nextcloudTheme == null || (themeKeepOriginalAccentColor ?? false), |
|
|
|
_nextcloudTheme, |
|
|
|
), |
|
|
|
Brightness.dark, |
|
|
|
routerDelegate: _routerDelegate, |
|
|
|
oledAsDark: themeOLEDAsDark, |
|
|
|
); |
|
|
|
keepOriginalAccentColor: _nextcloudTheme == null || (themeKeepOriginalAccentColor ?? false), |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
routerDelegate: _routerDelegate, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|