2026-04-05 22:38:56 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
2026-04-08 01:47:51 +08:00
|
|
|
/// 退出登录按钮
|
2026-04-05 22:38:56 +08:00
|
|
|
class LogoutButton extends StatelessWidget {
|
|
|
|
|
final VoidCallback onLogout;
|
|
|
|
|
const LogoutButton({super.key, required this.onLogout});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2026-04-08 01:47:51 +08:00
|
|
|
final colorScheme = Theme.of(context).colorScheme;
|
|
|
|
|
|
|
|
|
|
return SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: 48,
|
|
|
|
|
child: OutlinedButton(
|
|
|
|
|
onPressed: onLogout,
|
|
|
|
|
style: OutlinedButton.styleFrom(
|
|
|
|
|
foregroundColor: colorScheme.error,
|
|
|
|
|
side: BorderSide(color: colorScheme.error),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(14),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
),
|
2026-04-08 01:47:51 +08:00
|
|
|
child: const Text(
|
|
|
|
|
'退出登錄',
|
|
|
|
|
style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500),
|
2026-04-05 22:38:56 +08:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|