Skip to content

Commit 15528b5

Browse files
authored
Merge branch 'main' into post-patchset-1
2 parents b4b23e6 + faafadd commit 15528b5

File tree

13 files changed

+350
-266
lines changed

13 files changed

+350
-266
lines changed

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.29.2"
2+
"flutter": "3.38.0"
33
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,5 @@ app.*.map.json
4747
/android/app/release
4848

4949
# FVM Version Cache
50-
.fvm/
50+
.fvm/
51+
.vscode/settings.json

.vscode/launch.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"name": "taskwarrior-flutter (prod)",
10+
"request": "launch",
11+
"type": "dart",
12+
"args": [
13+
"--flavor",
14+
"prod"
15+
]
16+
},
17+
{
18+
"name": "taskwarrior-flutter (nightly)",
19+
"request": "launch",
20+
"type": "dart",
21+
"args": [
22+
"--flavor",
23+
"nightly"
24+
]
25+
},
26+
{
27+
"name": "taskwarrior-flutter (prod profile)",
28+
"request": "launch",
29+
"type": "dart",
30+
"flutterMode": "profile",
31+
"args": [
32+
"--flavor",
33+
"prod"
34+
]
35+
},
36+
{
37+
"name": "taskwarrior-flutter (nightly profile)",
38+
"request": "launch",
39+
"type": "dart",
40+
"flutterMode": "profile",
41+
"args": [
42+
"--flavor",
43+
"nightly"
44+
]
45+
},
46+
{
47+
"name": "taskwarrior-flutter (prod release)",
48+
"request": "launch",
49+
"type": "dart",
50+
"flutterMode": "release",
51+
"args": [
52+
"--flavor",
53+
"prod"
54+
]
55+
},
56+
{
57+
"name": "taskwarrior-flutter (nightly release)",
58+
"request": "launch",
59+
"type": "dart",
60+
"flutterMode": "release",
61+
"args": [
62+
"--flavor",
63+
"nightly"
64+
]
65+
}
66+
]
67+
}

android/app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ if (nightlyKeystorePropertiesFile.exists()) {
3636

3737
android {
3838
namespace "com.ccextractor.taskwarriorflutter"
39-
compileSdkVersion 35
39+
compileSdkVersion 36
4040

4141
compileOptions {
4242
sourceCompatibility JavaVersion.VERSION_1_8
4343
targetCompatibility JavaVersion.VERSION_1_8
44+
coreLibraryDesugaringEnabled true
4445
}
4546

4647
kotlinOptions {
@@ -101,5 +102,6 @@ flutter {
101102
}
102103

103104
dependencies {
105+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
104106
}
105107

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4096M
22
android.useAndroidX=true
33
android.enableJetifier=true

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

android/settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pluginManagement {
1818

1919
plugins {
2020
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.1.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
21+
id "com.android.application" version "8.6.0" apply false
22+
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
2323
}
2424

2525
include ":app"

lib/app/modules/detailRoute/controllers/detail_route_controller.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,17 @@ class DetailRouteController extends GetxController {
6060
var now = DateTime.now().toUtc();
6161
modify.save(modified: () => now);
6262
onEdit.value = false;
63-
Get.back();
63+
64+
// Show snackbar
6465
Get.snackbar(
6566
'Task Updated',
6667
'',
6768
snackPosition: SnackPosition.BOTTOM,
69+
duration: const Duration(seconds: 2),
6870
);
71+
72+
// Navigate back immediately after showing snackbar
73+
Get.back();
6974
}
7075

7176
// 'description': controller.modify.draft.description,

lib/app/modules/detailRoute/views/detail_route_view.dart

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ class DetailRouteView extends GetView<DetailRouteController> {
2828
return WillPopScope(
2929
onWillPop: () async {
3030
if (!controller.onEdit.value) {
31+
debugPrint(
32+
'DetailRouteView: No edits made, navigating back without prompt.');
3133
// Get.offAll(() => const HomeView());
32-
Get.back();
34+
Navigator.of(context).pop();
3335
// Get.toNamed(Routes.HOME);
3436
return false;
3537
}
38+
debugPrint(
39+
'DetailRouteView: Unsaved edits detected, prompting user for action.');
3640

3741
bool? save = await showDialog(
3842
context: context,
@@ -50,10 +54,14 @@ class DetailRouteView extends GetView<DetailRouteController> {
5054
actions: [
5155
TextButton(
5256
onPressed: () {
53-
controller.saveChanges();
54-
// Get.offAll(() => const HomeView());
57+
// Get.back(); // Close the dialog first
58+
// // Wait for dialog to fully close before showing snackbar
59+
// Future.delayed(const Duration(milliseconds: 100), () {
60+
// controller.saveChanges();
61+
// });
5562

56-
Get.back();
63+
controller.saveChanges();
64+
Navigator.of(context).pop(true);
5765
},
5866
child: Text(
5967
SentenceManager(
@@ -69,7 +77,7 @@ class DetailRouteView extends GetView<DetailRouteController> {
6977
onPressed: () {
7078
// Get.offAll(() => const HomeView());
7179

72-
Get.back();
80+
Navigator.of(context).pop();
7381
},
7482
child: Text(
7583
SentenceManager(
@@ -83,7 +91,7 @@ class DetailRouteView extends GetView<DetailRouteController> {
8391
),
8492
TextButton(
8593
onPressed: () {
86-
Get.back();
94+
Navigator.of(context).pop(false);
8795
},
8896
child: Text(
8997
SentenceManager(
@@ -251,7 +259,7 @@ class AttributeWidget extends StatelessWidget {
251259
Theme.of(context).extension<TaskwarriorColorTheme>()!;
252260
// Get the controller to check if the task is read-only
253261
final DetailRouteController controller = Get.find<DetailRouteController>();
254-
262+
255263
// Always allow status to be edited, but respect read-only for other attributes
256264
final bool isEditable = !controller.isReadOnly.value || name == 'status';
257265

@@ -323,9 +331,10 @@ class AttributeWidget extends StatelessWidget {
323331
isEditable: isEditable,
324332
);
325333
default:
326-
final Color? textColor = (isEditable && !['entry', 'modified', 'urgency'].contains(name))
327-
? tColors.primaryTextColor
328-
: tColors.primaryDisabledTextColor;
334+
final Color? textColor =
335+
(isEditable && !['entry', 'modified', 'urgency'].contains(name))
336+
? tColors.primaryTextColor
337+
: tColors.primaryDisabledTextColor;
329338

330339
return Card(
331340
color: tColors.secondaryBackgroundColor,

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

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class TasksBuilder extends StatelessWidget {
5353

5454
void saveChanges(
5555
BuildContext context, Modify modify, String id, String newValue) async {
56-
TaskwarriorColorTheme tColors = Theme.of(context).extension<TaskwarriorColorTheme>()!;
56+
TaskwarriorColorTheme tColors =
57+
Theme.of(context).extension<TaskwarriorColorTheme>()!;
5758
var now = DateTime.now().toUtc();
5859
modify.save(
5960
modified: () => now,
@@ -70,6 +71,7 @@ class TasksBuilder extends StatelessWidget {
7071
backgroundColor: tColors.secondaryBackgroundColor,
7172
duration: const Duration(seconds: 2),
7273
action: SnackBarAction(
74+
textColor: tColors.purpleShade,
7375
label:
7476
SentenceManager(currentLanguage: selectedLanguage).sentences.undo,
7577
onPressed: () {
@@ -110,32 +112,37 @@ class TasksBuilder extends StatelessWidget {
110112
@override
111113
Widget build(BuildContext context) {
112114
// print(taskData);
113-
TaskwarriorColorTheme tColors = Theme.of(context).extension<TaskwarriorColorTheme>()!;
115+
TaskwarriorColorTheme tColors =
116+
Theme.of(context).extension<TaskwarriorColorTheme>()!;
114117
var storageWidget = Get.find<HomeController>();
115118
return Scaffold(
116119
floatingActionButtonLocation:
117120
FloatingActionButtonLocation.miniStartFloat,
118-
floatingActionButton: showbtn ? AnimatedOpacity(
119-
duration: const Duration(milliseconds: 100), //show/hide animation
120-
opacity: showbtn ? 1.0 : 0.0, //set obacity to 1 on visible, or hide
121-
child: FloatingActionButton(
122-
heroTag: "btn2",
123-
onPressed: () {
124-
scrollController.animateTo(
125-
//go to top of scroll
126-
0, //scroll offset to go
127-
duration:
128-
const Duration(milliseconds: 500), //duration of scroll
129-
curve: Curves.fastLinearToSlowEaseIn //scroll type
130-
);
131-
},
132-
backgroundColor: tColors.primaryTextColor,
133-
child: Icon(
134-
Icons.arrow_upward,
135-
color: tColors.secondaryBackgroundColor,
136-
),
137-
),
138-
) : null,
121+
floatingActionButton: showbtn
122+
? AnimatedOpacity(
123+
duration:
124+
const Duration(milliseconds: 100), //show/hide animation
125+
opacity:
126+
showbtn ? 1.0 : 0.0, //set obacity to 1 on visible, or hide
127+
child: FloatingActionButton(
128+
heroTag: "btn2",
129+
onPressed: () {
130+
scrollController.animateTo(
131+
//go to top of scroll
132+
0, //scroll offset to go
133+
duration: const Duration(
134+
milliseconds: 500), //duration of scroll
135+
curve: Curves.fastLinearToSlowEaseIn //scroll type
136+
);
137+
},
138+
backgroundColor: tColors.primaryTextColor,
139+
child: Icon(
140+
Icons.arrow_upward,
141+
color: tColors.secondaryBackgroundColor,
142+
),
143+
),
144+
)
145+
: null,
139146
backgroundColor: Colors.transparent,
140147
body: Obx(
141148
() => taskData.isEmpty
@@ -152,8 +159,7 @@ class TasksBuilder extends StatelessWidget {
152159
style: TextStyle(
153160
fontFamily: FontFamily.poppins,
154161
fontSize: TaskWarriorFonts.fontSizeLarge,
155-
color: tColors.primaryTextColor
156-
),
162+
color: tColors.primaryTextColor),
157163
// style: GoogleFonts.poppins(
158164
// fontSize: TaskWarriorFonts.fontSizeLarge,
159165
// color: AppSettings.isDarkMode
@@ -193,7 +199,8 @@ class TasksBuilder extends StatelessWidget {
193199
}
194200
},
195201
icon: Icons.done,
196-
label: SentenceManager(currentLanguage: selectedLanguage)
202+
label: SentenceManager(
203+
currentLanguage: selectedLanguage)
197204
.sentences
198205
.complete,
199206
backgroundColor: TaskWarriorColors.green,
@@ -222,7 +229,8 @@ class TasksBuilder extends StatelessWidget {
222229
}
223230
},
224231
icon: Icons.delete,
225-
label: SentenceManager(currentLanguage: selectedLanguage)
232+
label: SentenceManager(
233+
currentLanguage: selectedLanguage)
226234
.sentences
227235
.delete,
228236
backgroundColor: TaskWarriorColors.red,

0 commit comments

Comments
 (0)