|
|
@ -2,6 +2,7 @@ import 'dart:async'; |
|
|
|
import 'dart:convert'; |
|
|
|
import 'dart:convert'; |
|
|
|
|
|
|
|
|
|
|
|
import 'package:collection/collection.dart'; |
|
|
|
import 'package:collection/collection.dart'; |
|
|
|
|
|
|
|
import 'package:dynamic_color/dynamic_color.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_native_splash/flutter_native_splash.dart'; |
|
|
|
import 'package:flutter_native_splash/flutter_native_splash.dart'; |
|
|
|
import 'package:meta/meta.dart'; |
|
|
|
import 'package:meta/meta.dart'; |
|
|
@ -284,42 +285,48 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(final BuildContext context) => OptionsCollectionBuilder( |
|
|
|
Widget build(final BuildContext context) => DynamicColorBuilder( |
|
|
|
valueListenable: _globalOptions, |
|
|
|
builder: (final deviceThemeLight, final deviceThemeDark) => OptionsCollectionBuilder( |
|
|
|
builder: (final context, final options, final _) => StreamBuilder<Account?>( |
|
|
|
valueListenable: _globalOptions, |
|
|
|
stream: _accountsBloc.activeAccount, |
|
|
|
builder: (final context, final options, final _) => StreamBuilder<Account?>( |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
stream: _accountsBloc.activeAccount, |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
builder: (final context, final activeAccountSnapshot) { |
|
|
|
return ResultBuilder<core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data?>.behaviorSubject( |
|
|
|
FlutterNativeSplash.remove(); |
|
|
|
subject: activeAccountSnapshot.hasData |
|
|
|
return ResultBuilder<core.OcsGetCapabilitiesResponseApplicationJson_Ocs_Data?>.behaviorSubject( |
|
|
|
? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities |
|
|
|
subject: activeAccountSnapshot.hasData |
|
|
|
: null, |
|
|
|
? _accountsBloc.getCapabilitiesBlocFor(activeAccountSnapshot.data!).capabilities |
|
|
|
builder: (final context, final capabilitiesSnapshot) { |
|
|
|
: null, |
|
|
|
final appTheme = AppTheme( |
|
|
|
builder: (final context, final capabilitiesSnapshot) { |
|
|
|
capabilitiesSnapshot.data?.capabilities.themingPublicCapabilities?.theming, |
|
|
|
final appTheme = AppTheme( |
|
|
|
useNextcloudTheme: options.themeUseNextcloudTheme.value, |
|
|
|
nextcloudTheme: capabilitiesSnapshot.data?.capabilities.themingPublicCapabilities?.theming, |
|
|
|
oledAsDark: options.themeOLEDAsDark.value, |
|
|
|
useNextcloudTheme: options.themeUseNextcloudTheme.value, |
|
|
|
appThemes: _appImplementations.map((final a) => a.theme).whereNotNull(), |
|
|
|
deviceThemeLight: deviceThemeLight, |
|
|
|
neonTheme: widget.neonTheme, |
|
|
|
deviceThemeDark: deviceThemeDark, |
|
|
|
); |
|
|
|
oledAsDark: options.themeOLEDAsDark.value, |
|
|
|
|
|
|
|
appThemes: _appImplementations.map((final a) => a.theme).whereNotNull(), |
|
|
|
return MaterialApp.router( |
|
|
|
neonTheme: widget.neonTheme, |
|
|
|
localizationsDelegates: [ |
|
|
|
); |
|
|
|
..._appImplementations.map((final app) => app.localizationsDelegate), |
|
|
|
|
|
|
|
...NeonLocalizations.localizationsDelegates, |
|
|
|
return MaterialApp.router( |
|
|
|
], |
|
|
|
localizationsDelegates: [ |
|
|
|
supportedLocales: { |
|
|
|
..._appImplementations.map((final app) => app.localizationsDelegate), |
|
|
|
..._appImplementations.map((final app) => app.supportedLocales).expand((final element) => element), |
|
|
|
...NeonLocalizations.localizationsDelegates, |
|
|
|
...NeonLocalizations.supportedLocales, |
|
|
|
], |
|
|
|
}, |
|
|
|
supportedLocales: { |
|
|
|
themeMode: options.themeMode.value, |
|
|
|
..._appImplementations |
|
|
|
theme: appTheme.lightTheme, |
|
|
|
.map((final app) => app.supportedLocales) |
|
|
|
darkTheme: appTheme.darkTheme, |
|
|
|
.expand((final element) => element), |
|
|
|
routerConfig: _routerDelegate, |
|
|
|
...NeonLocalizations.supportedLocales, |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
themeMode: options.themeMode.value, |
|
|
|
); |
|
|
|
theme: appTheme.lightTheme, |
|
|
|
}, |
|
|
|
darkTheme: appTheme.darkTheme, |
|
|
|
|
|
|
|
routerConfig: _routerDelegate, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|