mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-09 04:29:29 +00:00
Refactor onboarding to single page
bottom navigation bar
This commit is contained in:
parent
d9345cad2b
commit
5e152a0baf
10 changed files with 285 additions and 101 deletions
|
|
@ -20,13 +20,7 @@ void main() async {
|
|||
);
|
||||
}
|
||||
|
||||
// final _router = MyAppRouter(needOnboarding: _needAuth());
|
||||
|
||||
// bool _needAuth() {
|
||||
// final apiSettings = ApiSettings().readFromBoxOrCreate();
|
||||
// final servers = AudiobookShelfServer().readFromBoxOrCreate();
|
||||
// return apiSettings.activeUser == null || servers.isEmpty;
|
||||
// }
|
||||
var routerConfig = const MyAppRouter().config;
|
||||
|
||||
class MyApp extends ConsumerWidget {
|
||||
const MyApp({super.key});
|
||||
|
|
@ -36,16 +30,12 @@ class MyApp extends ConsumerWidget {
|
|||
final servers = ref.watch(audiobookShelfServerProvider);
|
||||
final apiSettings = ref.watch(apiSettingsProvider);
|
||||
|
||||
bool needOnboarding() {
|
||||
return apiSettings.activeUser == null || servers.isEmpty;
|
||||
final needOnboarding = apiSettings.activeUser == null || servers.isEmpty;
|
||||
|
||||
if (needOnboarding) {
|
||||
routerConfig.goNamed(Routes.onboarding.name);
|
||||
}
|
||||
|
||||
var routerConfig = MyAppRouter(needOnboarding: needOnboarding()).config;
|
||||
// if (needOnboarding()) {
|
||||
// routerConfig.goNamed(Routes.onboarding);
|
||||
// }
|
||||
|
||||
|
||||
return MaterialApp.router(
|
||||
theme: lightTheme,
|
||||
darkTheme: darkTheme,
|
||||
|
|
@ -53,7 +43,6 @@ class MyApp extends ConsumerWidget {
|
|||
? ThemeMode.dark
|
||||
: ThemeMode.light,
|
||||
routerConfig: routerConfig,
|
||||
// routerConfig: _router.config,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue