mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2025-12-20 02:08:11 +08:00
- User Profile page available - Search user avavilable - Tested Message page - Tested Contact page
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
/*
|
|
* @Author : Linloir
|
|
* @Date : 2022-10-14 10:53:24
|
|
* @LastEditTime : 2022-10-14 11:12:22
|
|
* @Description :
|
|
*/
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:tcp_client/home/view/profile_page/cubit/log_out_cubit.dart';
|
|
|
|
class LogoutButton extends StatelessWidget {
|
|
const LogoutButton({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TextButton(
|
|
onPressed: () {
|
|
context.read<LogOutCubit>().onLogout();
|
|
},
|
|
style: ButtonStyle(
|
|
elevation: MaterialStateProperty.all(0),
|
|
shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0))),
|
|
minimumSize: MaterialStateProperty.all(const Size(300, 0)),
|
|
backgroundColor: MaterialStateProperty.all(Colors.red[700]),
|
|
overlayColor: MaterialStateProperty.all(Colors.red[900]!.withOpacity(0.2)),
|
|
foregroundColor: MaterialStateProperty.all(Colors.white),
|
|
),
|
|
child: const Padding(
|
|
padding: EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 12
|
|
),
|
|
child: Text(
|
|
'Log Out',
|
|
style: TextStyle(
|
|
fontSize: 20
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|