my_tab.dart
1.53 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
import 'package:doublefeel_flutter/app/routes/app_pages.dart';
import 'package:doublefeel_flutter/core/services/user_state_service.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class MyTab extends StatelessWidget {
const MyTab({super.key});
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () async {
var userStateService = Get.find<UserStateService>();
await userStateService.onLogout();
Get.offAllNamed(AppRoutes.initial);
},
child: Container(
padding: const EdgeInsets.all(10),
margin: const EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(10),
),
child: const Text('Logout'),
)),
GestureDetector(
onTap: () async {
Get.offAllNamed(AppRoutes.userOnboarding);
},
child: Container(
padding: const EdgeInsets.all(10),
margin: const EdgeInsets.only(top: 10),
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(10),
),
child: const Text('Onboarding'),
)),
],
),
);
}
}