|
|
@ -2,18 +2,9 @@ part of '../../neon.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class NeonApp extends StatefulWidget { |
|
|
|
class NeonApp extends StatefulWidget { |
|
|
|
const NeonApp({ |
|
|
|
const NeonApp({ |
|
|
|
required this.accountsBloc, |
|
|
|
|
|
|
|
required this.sharedPreferences, |
|
|
|
|
|
|
|
required this.platform, |
|
|
|
|
|
|
|
required this.globalOptions, |
|
|
|
|
|
|
|
super.key, |
|
|
|
super.key, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
final AccountsBloc accountsBloc; |
|
|
|
|
|
|
|
final SharedPreferences sharedPreferences; |
|
|
|
|
|
|
|
final NeonPlatform platform; |
|
|
|
|
|
|
|
final GlobalOptions globalOptions; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
State<NeonApp> createState() => _NeonAppState(); |
|
|
|
State<NeonApp> createState() => _NeonAppState(); |
|
|
|
} |
|
|
|
} |
|
|
@ -253,13 +244,13 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(final BuildContext context) => OptionBuilder( |
|
|
|
Widget build(final BuildContext context) => OptionBuilder( |
|
|
|
option: widget.globalOptions.themeMode, |
|
|
|
option: _globalOptions.themeMode, |
|
|
|
builder: (final context, final themeMode) => OptionBuilder( |
|
|
|
builder: (final context, final themeMode) => OptionBuilder( |
|
|
|
option: widget.globalOptions.themeOLEDAsDark, |
|
|
|
option: _globalOptions.themeOLEDAsDark, |
|
|
|
builder: (final context, final themeOLEDAsDark) => OptionBuilder( |
|
|
|
builder: (final context, final themeOLEDAsDark) => OptionBuilder( |
|
|
|
option: widget.globalOptions.themeKeepOriginalAccentColor, |
|
|
|
option: _globalOptions.themeKeepOriginalAccentColor, |
|
|
|
builder: (final context, final themeKeepOriginalAccentColor) => StreamBuilder<Account?>( |
|
|
|
builder: (final context, final themeKeepOriginalAccentColor) => StreamBuilder<Account?>( |
|
|
|
stream: widget.accountsBloc.activeAccount, |
|
|
|
stream: _accountsBloc.activeAccount, |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
if (themeMode == null || themeOLEDAsDark == null) { |
|
|
|
if (themeMode == null || themeOLEDAsDark == null) { |
|
|
|
return Container(); |
|
|
|
return Container(); |
|
|
@ -268,7 +259,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
return ResultBuilder<Capabilities?>( |
|
|
|
return ResultBuilder<Capabilities?>( |
|
|
|
stream: activeAccountSnapshot.hasData |
|
|
|
stream: activeAccountSnapshot.hasData |
|
|
|
? widget.accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities |
|
|
|
? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
builder: (final context, final capabilitiesSnapshot) { |
|
|
|
builder: (final context, final capabilitiesSnapshot) { |
|
|
|
final nextcloudTheme = capabilitiesSnapshot.data?.capabilities.theming; |
|
|
|
final nextcloudTheme = capabilitiesSnapshot.data?.capabilities.theming; |
|
|
|