feat: replace mail protocol with smolmail and rebuild the UI
This commit is contained in:
parent
cb24b68069
commit
e94e4158cc
93 changed files with 6387 additions and 3479 deletions
22
lib/presentation/routes/identity_guard.dart
Normal file
22
lib/presentation/routes/identity_guard.dart
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import "package:auto_route/auto_route.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
|
||||
import "package:smol_mail/data/providers/providers.dart";
|
||||
import "package:smol_mail/presentation/routes/app_router.gr.dart";
|
||||
|
||||
/// Everything past onboarding needs an identity; the account can still be
|
||||
/// registered from settings.
|
||||
class IdentityGuard extends AutoRouteGuard {
|
||||
final WidgetRef ref;
|
||||
|
||||
IdentityGuard(this.ref);
|
||||
|
||||
@override
|
||||
void onNavigation(NavigationResolver resolver, StackRouter router) {
|
||||
if (ref.read(identityProvider) == null) {
|
||||
router.replace(OnboardingRoute());
|
||||
} else {
|
||||
resolver.next(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue