kickoff library item

This commit is contained in:
Dr-Blank 2024-05-09 23:23:50 -04:00
parent f8597f7430
commit 6c60d1c6ed
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
13 changed files with 439 additions and 99 deletions

View file

@ -12,25 +12,34 @@ void main() async {
// initialize the storage
await initStorage();
runApp(const ProviderScope(
child: MyApp(),
runApp(
const ProviderScope(
child: MyApp(),
),
);
}
// final _router = MyAppRouter(needOnboarding: _needAuth());
// bool _needAuth() {
// final apiSettings = ApiSettings().readFromBoxOrCreate();
// final servers = AudiobookShelfServer().readFromBoxOrCreate();
// return apiSettings.activeUser == null || servers.isEmpty;
// }
class MyApp extends ConsumerWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final servers = ref.watch(audiobookShelfServerProvider);
final appSettings = ref.watch(appSettingsProvider);
final apiSettings = ref.watch(apiSettingsProvider);
bool needOnboarding() {
return apiSettings.activeUser == null || servers.isEmpty;
}
return MaterialApp.router(
theme: lightTheme,
darkTheme: darkTheme,
@ -38,6 +47,8 @@ class MyApp extends ConsumerWidget {
? ThemeMode.dark
: ThemeMode.light,
routerConfig: MyAppRouter(needOnboarding: needOnboarding()).config,
// routerConfig: _router.config,
);
}
}