mirror of
https://github.com/lucavenir/go_router_riverpod.git
synced 2025-08-06 14:59:53 +08:00
19 lines
488 B
Dart
19 lines
488 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
import '../state/auth_controller.dart';
|
|
import 'action_button.dart';
|
|
|
|
class LogoutButton extends ConsumerWidget {
|
|
const LogoutButton({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
return ActionButton(
|
|
onPressed: ref.read(authControllerProvider.notifier).logout,
|
|
icon: const Icon(Icons.logout),
|
|
label: const Text('Logout'),
|
|
);
|
|
}
|
|
}
|