mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
migrate l10n, state preloading
This commit is contained in:
@@ -1,38 +1,13 @@
|
||||
import 'package:drift/drift.dart' show Value;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
||||
import 'app/router.dart';
|
||||
import 'database/database.dart';
|
||||
import 'l10n/generated/app_localizations.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
final db = SubtracksDatabase();
|
||||
await db
|
||||
.into(db.sources)
|
||||
.insertOnConflictUpdate(
|
||||
SourcesCompanion.insert(
|
||||
id: Value(1),
|
||||
name: 'test navidrome',
|
||||
),
|
||||
);
|
||||
await db
|
||||
.into(db.subsonicSettings)
|
||||
.insertOnConflictUpdate(
|
||||
SubsonicSettingsCompanion.insert(
|
||||
sourceId: Value(1),
|
||||
address: Uri.parse('http://demo.subsonic.org'),
|
||||
username: 'guest1',
|
||||
password: 'guest',
|
||||
// address: Uri.parse('http://10.0.2.2:4533'),
|
||||
// username: 'admin',
|
||||
// password: 'password',
|
||||
useTokenAuth: Value(true),
|
||||
),
|
||||
);
|
||||
|
||||
runApp(const MainApp());
|
||||
runApp(ProviderScope(child: const MainApp()));
|
||||
}
|
||||
|
||||
class MainApp extends StatelessWidget {
|
||||
@@ -40,13 +15,13 @@ class MainApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ProviderScope(
|
||||
child: MaterialApp.router(
|
||||
themeMode: ThemeMode.dark,
|
||||
darkTheme: ThemeData.dark(useMaterial3: true),
|
||||
debugShowCheckedModeBanner: false,
|
||||
routerConfig: router,
|
||||
),
|
||||
return MaterialApp.router(
|
||||
themeMode: ThemeMode.dark,
|
||||
darkTheme: ThemeData.dark(useMaterial3: true),
|
||||
debugShowCheckedModeBanner: false,
|
||||
routerConfig: router,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user