TIF_E41202429/Mobile/patrolin/skripsi/lib/widget/card_logout.dart

126 lines
4.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:skripsi/config/theme.dart';
import 'package:skripsi/view/login_page.dart';
class CardLogout extends StatelessWidget {
const CardLogout({
super.key,
});
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: secondaryColor,
borderRadius: BorderRadius.circular(12.w),
),
child: Padding(
padding: EdgeInsets.all(10.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Row(
children: [
Expanded(
child: Row(
children: [
// const Icon(
// Icons.logout,
// ),
SizedBox(width: 6.w),
Text(
'Keluar',
style: robotoSedangHitam.copyWith(
fontWeight: FontWeight.bold),
),
],
),
),
GestureDetector(
onTap: () {
showModalBottomSheet(
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(10.r),
),
),
builder: (context) {
return SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
title: Center(
child: Text(
'Anda yakin ingin keluar?',
style: robotoBesarHitam.copyWith(
fontSize: 18.sp,
fontWeight: FontWeight.w100,
color: Colors.grey,
),
),
),
),
ListTile(
title: Center(
child: Text(
'Keluar',
style: robotoBesarHitam.copyWith(
fontSize: 18.sp,
color: Colors.red,
),
),
),
onTap: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) =>
const LoginPage()),
(route) => false);
},
),
const Divider(),
ListTile(
title: Center(
child: Text(
'Batal',
style: robotoBesarHitam.copyWith(
fontSize: 18.sp,
fontWeight: FontWeight.w100,
color: const Color(0xff5E5E5E),
),
),
),
onTap: () {
Navigator.pop(context);
},
),
],
),
);
},
);
},
child: Icon(
Icons.arrow_forward_ios,
size: 16.w,
),
)
],
),
],
)
],
),
),
);
}
}