63 lines
1.8 KiB
Dart
Raw Normal View History

2025-08-12 21:20:20 +07:00
import 'package:flutter/material.dart';
2025-08-16 19:29:21 +07:00
import 'package:flutter_bloc/flutter_bloc.dart';
2025-08-12 21:20:20 +07:00
2025-08-16 19:29:21 +07:00
import '../../../../application/auth/logout_form/logout_form_bloc.dart';
2025-08-12 21:20:20 +07:00
import '../../../../common/theme/theme.dart';
import '../../../components/spacer/spacer.dart';
import 'profile_tile.dart';
class ProfileDangerZone extends StatelessWidget {
const ProfileDangerZone({super.key});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(horizontal: AppValue.margin),
decoration: BoxDecoration(
color: AppColor.surface,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: AppColor.error.withOpacity(0.3)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16),
child: Row(
children: [
Icon(Icons.warning_outlined, color: AppColor.error, size: 20),
const SpaceWidth(8),
Text(
'Danger Zone',
style: AppStyle.xl.copyWith(
fontWeight: FontWeight.bold,
color: AppColor.error,
),
),
],
),
),
ProfileTile(
icon: Icons.logout,
title: 'Logout',
subtitle: 'Sign out from your account',
iconColor: AppColor.error,
textColor: AppColor.error,
2025-08-16 19:29:21 +07:00
onTap: () {
context.read<LogoutFormBloc>().add(LogoutFormEvent.submitted());
},
2025-08-12 21:20:20 +07:00
),
],
),
);
}
}