mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 22:51:00 -04:00
protoc and localization
This commit is contained in:
parent
dc59703f41
commit
41906366e6
21 changed files with 1717 additions and 1110 deletions
23
lib/app.dart
23
lib/app.dart
|
@ -1,7 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:animated_theme_switcher/animated_theme_switcher.dart';
|
||||
import 'router/router.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
|
||||
class VeilidChatApp extends ConsumerWidget {
|
||||
const VeilidChatApp({
|
||||
|
@ -15,14 +17,25 @@ class VeilidChatApp extends ConsumerWidget {
|
|||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final router = ref.watch(routerProvider);
|
||||
|
||||
var localizationDelegate = LocalizedApp.of(context).delegate;
|
||||
|
||||
return ThemeProvider(
|
||||
initTheme: theme,
|
||||
builder: (_, theme) {
|
||||
return MaterialApp.router(
|
||||
routerConfig: router,
|
||||
title: 'VeilidChat',
|
||||
theme: theme,
|
||||
);
|
||||
return LocalizationProvider(
|
||||
state: LocalizationProvider.of(context).state,
|
||||
child: MaterialApp.router(
|
||||
routerConfig: router,
|
||||
title: 'VeilidChat',
|
||||
theme: theme,
|
||||
localizationsDelegates: [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
localizationDelegate
|
||||
],
|
||||
supportedLocales: localizationDelegate.supportedLocales,
|
||||
locale: localizationDelegate.currentLocale,
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue