-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings_screen.dart
More file actions
54 lines (51 loc) · 1.61 KB
/
settings_screen.dart
File metadata and controls
54 lines (51 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import 'package:flutter/material.dart';
import '../../../../core/theme/app_colors.dart';
import '../../../auth/services/auth_helper.dart';
class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Cai dat'),
),
body: Padding(
padding: const EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Tai khoan',
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.error,
foregroundColor: AppColors.white,
padding: const EdgeInsets.symmetric(vertical: 14),
),
onPressed: () async {
try {
await signOut();
} catch (error) {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Dang xuat that bai: $error')),
);
}
},
icon: const Icon(Icons.logout_rounded),
label: const Text('Dang xuat'),
),
),
],
),
),
);
}
}