Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/account/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';

class LoginPage extends StatefulWidget {
final VoidCallback popRegister;
final VoidCallback popModal;
final bool anonymous;

const LoginPage({super.key, required this.popRegister, this.anonymous = false});
const LoginPage({super.key, required this.popRegister, required this.popModal, this.anonymous = false});

@override
State<LoginPage> createState() => _LoginPageState();
Expand Down Expand Up @@ -149,7 +150,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix

showSnackbar(AppLocalizations.of(context)!.loginFailed(state.errorMessage ?? AppLocalizations.of(context)!.missingErrorMessage));
} else if (state.status == AuthStatus.success && context.read<AuthBloc>().state.isLoggedIn) {
Navigator.of(context).pop();
widget.popModal();
showSnackbar(AppLocalizations.of(context)!.loginSucceeded);
} else if (state.status == AuthStatus.contentWarning) {
bool acceptedContentWarning = false;
Expand Down
6 changes: 5 additions & 1 deletion lib/account/widgets/profile_modal_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class _ProfileModalBodyState extends State<ProfileModalBody> {
ProfileModalBody.shellNavigatorKey.currentState!.pop();
}

void popModal() {
Navigator.of(context).pop();
}

@override
Widget build(BuildContext context) {
return Navigator(
Expand Down Expand Up @@ -86,7 +90,7 @@ class _ProfileModalBodyState extends State<ProfileModalBody> {
break;

case '/login':
page = LoginPage(popRegister: popRegister, anonymous: (settings.arguments as Map<String, bool>)['anonymous']!);
page = LoginPage(popRegister: popRegister, popModal: popModal, anonymous: (settings.arguments as Map<String, bool>)['anonymous']!);
break;
}
return SwipeablePageRoute<dynamic>(
Expand Down
Loading