mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-06-09 07:02:48 -04:00
more refactor
This commit is contained in:
parent
ba4ef05a28
commit
b83aa3a64b
39 changed files with 722 additions and 514 deletions
14
lib/app.dart
14
lib/app.dart
|
@ -8,24 +8,25 @@ import 'package:form_builder_validators/form_builder_validators.dart';
|
|||
|
||||
import 'account_manager/account_manager.dart';
|
||||
import 'router/router.dart';
|
||||
import 'settings/settings.dart';
|
||||
import 'tick.dart';
|
||||
|
||||
class VeilidChatApp extends StatelessWidget {
|
||||
const VeilidChatApp({
|
||||
required this.themeData,
|
||||
required this.initialThemeData,
|
||||
super.key,
|
||||
});
|
||||
|
||||
static const String name = 'VeilidChat';
|
||||
|
||||
final ThemeData themeData;
|
||||
final ThemeData initialThemeData;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localizationDelegate = LocalizedApp.of(context).delegate;
|
||||
|
||||
return ThemeProvider(
|
||||
initTheme: themeData,
|
||||
initTheme: initialThemeData,
|
||||
builder: (_, theme) => LocalizationProvider(
|
||||
state: LocalizationProvider.of(context).state,
|
||||
child: MultiBlocProvider(
|
||||
|
@ -46,6 +47,10 @@ class VeilidChatApp extends StatelessWidget {
|
|||
create: (context) =>
|
||||
ActiveUserLoginCubit(AccountRepository.instance),
|
||||
),
|
||||
BlocProvider<PreferencesCubit>(
|
||||
create: (context) =>
|
||||
PreferencesCubit(PreferencesRepository.instance),
|
||||
)
|
||||
],
|
||||
child: BackgroundTicker(
|
||||
builder: (context) => MaterialApp.router(
|
||||
|
@ -70,6 +75,7 @@ class VeilidChatApp extends StatelessWidget {
|
|||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(DiagnosticsProperty<ThemeData>('themeData', themeData));
|
||||
properties
|
||||
.add(DiagnosticsProperty<ThemeData>('themeData', initialThemeData));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue