Skip to content

Commit 6445362

Browse files
committed
menubar language fix
This fixes the menubars reactivity with language and profile change
1 parent ff669a1 commit 6445362

File tree

1 file changed

+66
-64
lines changed

1 file changed

+66
-64
lines changed

lib/app/modules/home/views/nav_drawer.dart

Lines changed: 66 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ class NavDrawer extends StatelessWidget {
3838
child: Row(
3939
mainAxisAlignment: MainAxisAlignment.spaceBetween,
4040
children: [
41-
Text(
42-
SentenceManager(
43-
currentLanguage:
44-
homeController.selectedLanguage.value)
45-
.sentences
46-
.homePageMenu,
47-
style: TextStyle(
48-
fontSize: TaskWarriorFonts.fontSizeExtraLarge,
49-
fontWeight: TaskWarriorFonts.bold,
50-
color: tColors.primaryTextColor,
51-
),
52-
),
41+
Obx(() => Text(
42+
SentenceManager(
43+
currentLanguage:
44+
homeController.selectedLanguage.value)
45+
.sentences
46+
.homePageMenu,
47+
style: TextStyle(
48+
fontSize: TaskWarriorFonts.fontSizeExtraLarge,
49+
fontWeight: TaskWarriorFonts.bold,
50+
color: tColors.primaryTextColor,
51+
),
52+
)),
5353
Padding(
5454
padding: const EdgeInsets.only(right: 10),
5555
child: ThemeSwitcherClipper(
@@ -78,72 +78,74 @@ class NavDrawer extends StatelessWidget {
7878
color: tColors.dialogBackgroundColor,
7979
height: Get.height * 0.03,
8080
),
81-
Visibility(
82-
visible: homeController.taskchampion.value,
83-
child: NavDrawerMenuItem(
84-
icon: Icons.delete,
85-
text: SentenceManager(
86-
currentLanguage: homeController.selectedLanguage.value,
87-
).sentences.deleteTaskTitle,
88-
onTap: () {
89-
showDialog<void>(
90-
context: context,
91-
builder: (BuildContext context) {
92-
return Utils.showAlertDialog(
93-
title: Text(
94-
SentenceManager(
95-
currentLanguage:
96-
homeController.selectedLanguage.value,
97-
).sentences.deleteTaskConfirmation,
98-
style: TextStyle(
99-
color: tColors.primaryTextColor,
100-
),
101-
),
102-
content: Text(
103-
SentenceManager(
104-
currentLanguage:
105-
homeController.selectedLanguage.value,
106-
).sentences.deleteTaskWarning,
107-
style: TextStyle(
108-
color: tColors.primaryDisabledTextColor,
109-
),
110-
),
111-
actions: <Widget>[
112-
TextButton(
113-
child: Text(
81+
Obx(() => Visibility(
82+
visible: homeController.taskchampion.value,
83+
child: NavDrawerMenuItem(
84+
icon: Icons.delete,
85+
text: SentenceManager(
86+
currentLanguage: homeController.selectedLanguage.value,
87+
).sentences.deleteTaskTitle,
88+
onTap: () {
89+
showDialog<void>(
90+
context: context,
91+
builder: (BuildContext context) {
92+
return Utils.showAlertDialog(
93+
title: Text(
11494
SentenceManager(
11595
currentLanguage:
11696
homeController.selectedLanguage.value,
117-
).sentences.homePageCancel,
97+
).sentences.deleteTaskConfirmation,
11898
style: TextStyle(
11999
color: tColors.primaryTextColor,
120100
),
121101
),
122-
onPressed: () {
123-
Navigator.of(context).pop(); // Close the dialog
124-
},
125-
),
126-
TextButton(
127-
child: Text(
102+
content: Text(
128103
SentenceManager(
129104
currentLanguage:
130105
homeController.selectedLanguage.value,
131-
).sentences.navDrawerConfirm,
106+
).sentences.deleteTaskWarning,
132107
style: TextStyle(
133-
color: tColors.primaryTextColor,
108+
color: tColors.primaryDisabledTextColor,
134109
),
135110
),
136-
onPressed: () {
137-
homeController.deleteAllTasksInDB();
138-
Navigator.of(context).pop(); // Close the dialog
139-
},
140-
),
141-
],
111+
actions: <Widget>[
112+
TextButton(
113+
child: Text(
114+
SentenceManager(
115+
currentLanguage:
116+
homeController.selectedLanguage.value,
117+
).sentences.homePageCancel,
118+
style: TextStyle(
119+
color: tColors.primaryTextColor,
120+
),
121+
),
122+
onPressed: () {
123+
Navigator.of(context)
124+
.pop(); // Close the dialog
125+
},
126+
),
127+
TextButton(
128+
child: Text(
129+
SentenceManager(
130+
currentLanguage:
131+
homeController.selectedLanguage.value,
132+
).sentences.navDrawerConfirm,
133+
style: TextStyle(
134+
color: tColors.primaryTextColor,
135+
),
136+
),
137+
onPressed: () {
138+
homeController.deleteAllTasksInDB();
139+
Navigator.of(context)
140+
.pop(); // Close the dialog
141+
},
142+
),
143+
],
144+
);
145+
},
142146
);
143-
},
144-
);
145-
}),
146-
),
147+
}),
148+
)),
147149
Obx(
148150
() => NavDrawerMenuItem(
149151
icon: Icons.person_rounded,

0 commit comments

Comments
 (0)