fix(auth): trigger AuthLoggedOut event on logout
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import '../../../../core/theme/design_tokens.dart';
|
import '../../../../core/theme/design_tokens.dart';
|
||||||
import '../../../../shared/widgets/page_header.dart' as widgets;
|
import '../../../../shared/widgets/page_header.dart' as widgets;
|
||||||
|
import '../../../auth/presentation/bloc/auth_bloc.dart';
|
||||||
|
import '../../../auth/presentation/bloc/auth_event.dart';
|
||||||
|
|
||||||
class AccountScreen extends StatelessWidget {
|
class AccountScreen extends StatelessWidget {
|
||||||
const AccountScreen({super.key});
|
const AccountScreen({super.key});
|
||||||
@@ -211,6 +214,7 @@ class AccountScreen extends StatelessWidget {
|
|||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(dialogContext).pop();
|
Navigator.of(dialogContext).pop();
|
||||||
|
context.read<AuthBloc>().add(AuthLoggedOut());
|
||||||
context.go('/');
|
context.go('/');
|
||||||
},
|
},
|
||||||
child: const Text('退出', style: TextStyle(color: Color(0xFFDC2626))),
|
child: const Text('退出', style: TextStyle(color: Color(0xFFDC2626))),
|
||||||
|
|||||||
Reference in New Issue
Block a user