protoc and localization

This commit is contained in:
Christien Rioux 2023-07-07 19:33:28 -04:00
parent dc59703f41
commit 41906366e6
21 changed files with 1717 additions and 1110 deletions

View file

@ -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,
));
},
);
}