-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathprofile_controller.dart
More file actions
61 lines (54 loc) · 1.85 KB
/
profile_controller.dart
File metadata and controls
61 lines (54 loc) · 1.85 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
54
55
56
57
58
59
60
61
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:taskwarrior/app/modules/splash/controllers/splash_controller.dart';
import 'package:taskwarrior/app/tour/profile_page_tour.dart';
import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart';
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
class ProfileController extends GetxController {
var profilesWidget = Get.find<SplashController>();
late RxMap<String, String?> profilesMap;
late RxString currentProfile;
@override
void onInit() {
profilesMap = profilesWidget.profilesMap;
currentProfile = profilesWidget.currentProfile;
super.onInit();
}
late TutorialCoachMark tutorialCoachMark;
final GlobalKey currentProfileKey = GlobalKey();
final GlobalKey addNewProfileKey = GlobalKey();
final GlobalKey manageSelectedProfileKey = GlobalKey();
void initProfilePageTour() {
tutorialCoachMark = TutorialCoachMark(
targets: addProfilePage(
currentProfileKey: currentProfileKey,
addNewProfileKey: addNewProfileKey,
manageSelectedProfileKey: manageSelectedProfileKey,
),
colorShadow: TaskWarriorColors.black,
paddingFocus: 10,
opacityShadow: 1.00,
hideSkip: true,
onFinish: () {
SaveTourStatus.saveProfileTourStatus(true);
},
);
}
void showProfilePageTour(BuildContext context) {
Future.delayed(
const Duration(milliseconds: 500),
() {
SaveTourStatus.getProfileTourStatus().then((value) {
if (!context.mounted) return;
if (value == false) {
tutorialCoachMark.show(context: context);
} else {
// ignore: avoid_print
print('User has seen this page');
}
});
},
);
}
}