mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-31 18:28:48 -04:00
wallpapers and ui cleanup
This commit is contained in:
parent
77c68aa45f
commit
6bd60207d8
32 changed files with 17947 additions and 150 deletions
44
lib/app.dart
44
lib/app.dart
|
@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -49,19 +48,24 @@ class VeilidChatApp extends StatelessWidget {
|
|||
final ThemeData initialThemeData;
|
||||
|
||||
void _reloadTheme(BuildContext context) {
|
||||
log.info('Reloading theme');
|
||||
final theme =
|
||||
PreferencesRepository.instance.value.themePreference.themeData();
|
||||
ThemeSwitcher.of(context).changeTheme(theme: theme);
|
||||
|
||||
// Hack to reload translations
|
||||
final localizationDelegate = LocalizedApp.of(context).delegate;
|
||||
singleFuture(this, () async {
|
||||
await LocalizationDelegate.create(
|
||||
fallbackLocale: localizationDelegate.fallbackLocale.toString(),
|
||||
supportedLocales: localizationDelegate.supportedLocales
|
||||
.map((x) => x.toString())
|
||||
.toList());
|
||||
log.info('Reloading theme');
|
||||
|
||||
await VeilidChatGlobalInit.loadAssetManifest();
|
||||
|
||||
final theme =
|
||||
PreferencesRepository.instance.value.themePreference.themeData();
|
||||
if (context.mounted) {
|
||||
ThemeSwitcher.of(context).changeTheme(theme: theme);
|
||||
|
||||
// Hack to reload translations
|
||||
final localizationDelegate = LocalizedApp.of(context).delegate;
|
||||
await LocalizationDelegate.create(
|
||||
fallbackLocale: localizationDelegate.fallbackLocale.toString(),
|
||||
supportedLocales: localizationDelegate.supportedLocales
|
||||
.map((x) => x.toString())
|
||||
.toList());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -164,17 +168,17 @@ class VeilidChatApp extends StatelessWidget {
|
|||
scale.primaryScale.subtleBackground,
|
||||
]);
|
||||
|
||||
final wallpaper = PreferencesRepository
|
||||
.instance.value.themePreference
|
||||
.wallpaper();
|
||||
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(gradient: gradient)),
|
||||
SvgPicture.asset(
|
||||
'assets/images/grid.svg',
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: overlayFilter,
|
||||
),
|
||||
wallpaper ??
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(gradient: gradient)),
|
||||
MaterialApp.router(
|
||||
scrollBehavior: const ScrollBehaviorModified(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue