mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-21 05:38:42 -04:00
more refactor
This commit is contained in:
parent
ba4ef05a28
commit
b83aa3a64b
39 changed files with 722 additions and 514 deletions
|
@ -9,6 +9,7 @@ import 'package:intl/date_symbol_data_local.dart';
|
|||
|
||||
import 'app.dart';
|
||||
import 'init.dart';
|
||||
import 'settings/preferences_repository.dart';
|
||||
import 'theme/theme.dart';
|
||||
import 'tools/tools.dart';
|
||||
|
||||
|
@ -31,10 +32,11 @@ void main() async {
|
|||
// Logs
|
||||
initLoggy();
|
||||
|
||||
// Prepare theme
|
||||
// Prepare preferences from SharedPreferences and theme
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
final themeRepository = await ThemeRepository.instance;
|
||||
final themeData = themeRepository.themeData();
|
||||
await PreferencesRepository.instance.init();
|
||||
final initialThemeData =
|
||||
PreferencesRepository.instance.value.themePreferences.themeData();
|
||||
|
||||
// Manage window on desktop platforms
|
||||
await initializeWindowControl();
|
||||
|
@ -45,11 +47,12 @@ void main() async {
|
|||
await initializeDateFormatting();
|
||||
|
||||
// Start up Veilid and Veilid processor in the background
|
||||
unawaited(initializeVeilid());
|
||||
unawaited(initializeVeilidChat());
|
||||
|
||||
// Run the app
|
||||
// Hot reloads will only restart this part, not Veilid
|
||||
runApp(LocalizedApp(delegate, VeilidChatApp(themeData: themeData)));
|
||||
runApp(LocalizedApp(
|
||||
delegate, VeilidChatApp(initialThemeData: initialThemeData)));
|
||||
}, (error, stackTrace) {
|
||||
log.error('Dart Runtime: {$error}\n{$stackTrace}');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue