Skip to content

Commit ed4f927

Browse files
committed
added add_bottom_sheet, ccsync creds, debug logs option to i18n
1 parent 5cb7657 commit ed4f927

File tree

14 files changed

+510
-34
lines changed

14 files changed

+510
-34
lines changed

.github/workflows/flutterci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Flutter CI
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- reports
84
pull_request:
95
branches:
106
- main
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Nightly F-Droid CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Step 1: Checkout the main branch
14+
- name: Checkout Main Branch
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
# Step 2: Setup Java with version 17.x
20+
- name: Setup Java
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: "17.x"
24+
25+
# Step 3: Setup Flutter with version 3.29.2
26+
- name: Setup Flutter
27+
uses: subosito/flutter-action@v1
28+
with:
29+
flutter-version: "3.29.2"
30+
31+
# Step 4: Get dependencies
32+
- name: Get dependencies
33+
run: flutter pub get
34+
35+
# # Step 5: Analyze and test (uncomment if needed)
36+
# - name: Analyze code
37+
# run: flutter analyze --no-fatal-warnings --no-fatal-infos
38+
# # - name: Run tests
39+
# # run: flutter test
40+
41+
# Step 6: Build APK
42+
- name: Build APK
43+
run: |
44+
flutter build apk --build-number=${{ github.run_number }} --release
45+
mv build/app/outputs/flutter-apk/app-release.apk /home/runner/work/com.ccextractor.taskwarriorflutter.apk
46+
# The `--flavor fdroid` is optional but a good practice for F-Droid builds.
47+
# The mv command ensures a unique filename with the build number.
48+
49+
# Step 7: Push the APK to the fdroid-repo branch
50+
- name: Configure and push to fdroid-repo
51+
run: |
52+
# Configure Git credentials with the GITHUB_TOKEN
53+
git config --global user.name "github-actions[bot]"
54+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
55+
56+
# Checkout the fdroid-repo branch
57+
git fetch origin fdroid-repo:fdroid-repo
58+
git checkout fdroid-repo
59+
60+
# Create a directory if it doesn't exist and move the APK
61+
mkdir -p repo
62+
rm -f repo/com.ccextractor.taskwarriorflutter.apk || true
63+
mv /home/runner/work/com.ccextractor.taskwarriorflutter.apk repo/
64+
65+
# Add, commit, and push the new APK file
66+
git add repo/
67+
git commit -m "chore: Add new APK from build ${{ github.run_number }}"
68+
git push origin fdroid-repo
69+
70+
# Step 8: Setup f-droid and run update
71+
- name: Setup F-Droid
72+
uses: subosito/flutter-action@v1 # A common action, but you'll need to install fdroidserver
73+
- name: Run F-Droid Update
74+
env:
75+
FDROID_CONFIG_YML_B64: ${{ secrets.FDROID_CONFIG_YML }}
76+
FDROID_KEYSTORE_P12_B64: ${{ secrets.FDROID_KEYSTORE_P12 }}
77+
run: |
78+
# Decode the secrets into files
79+
echo $FDROID_CONFIG_YML_B64 | base64 --decode > config.yml
80+
echo $FDROID_KEYSTORE_P12_B64 | base64 --decode > keystore.p12
81+
82+
# Install fdroidserver
83+
sudo apt-get update
84+
sudo apt-get install -y fdroidserver
85+
86+
# Run the update command, referencing the files
87+
fdroid update -c
88+
89+
# Step 9: Push the updated repo files
90+
- name: Push F-Droid updates
91+
run: |
92+
git add .
93+
git commit -m "feat: F-Droid repo update n:${{ github.run_number }}"
94+
git push origin fdroid-repo

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

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class AddTaskBottomSheet extends StatelessWidget {
4545
onPressed: () {
4646
Get.back();
4747
},
48-
child: const Text("Cancel"),
48+
child: Text(SentenceManager(
49+
currentLanguage:
50+
homeController.selectedLanguage.value)
51+
.sentences
52+
.cancel),
4953
),
5054
Text(
5155
SentenceManager(
@@ -66,7 +70,11 @@ class AddTaskBottomSheet extends StatelessWidget {
6670
onSaveButtonClicked(context);
6771
}
6872
},
69-
child: const Text("Save"),
73+
child: Text(SentenceManager(
74+
currentLanguage:
75+
homeController.selectedLanguage.value)
76+
.sentences
77+
.save),
7078
),
7179
],
7280
),
@@ -80,10 +88,18 @@ class AddTaskBottomSheet extends StatelessWidget {
8088
child: TextFormField(
8189
controller: homeController.namecontroller,
8290
validator: (value) => value!.isEmpty
83-
? "Description cannot be empty"
91+
? SentenceManager(
92+
currentLanguage:
93+
homeController.selectedLanguage.value)
94+
.sentences
95+
.descriprtionCannotBeEmpty
8496
: null,
85-
decoration: const InputDecoration(
86-
labelText: 'Enter Task Description',
97+
decoration: InputDecoration(
98+
labelText: SentenceManager(
99+
currentLanguage:
100+
homeController.selectedLanguage.value)
101+
.sentences
102+
.enterTaskDescription,
87103
border: OutlineInputBorder(),
88104
),
89105
),
@@ -168,15 +184,21 @@ class AddTaskBottomSheet extends StatelessWidget {
168184
(context, textEditingController, focusNode, onFieldSubmitted) =>
169185
TextFormField(
170186
controller: textEditingController,
171-
decoration: const InputDecoration(
172-
labelText: 'Project',
187+
decoration: InputDecoration(
188+
labelText: SentenceManager(
189+
currentLanguage: homeController.selectedLanguage.value)
190+
.sentences
191+
.enterProject,
173192
border: OutlineInputBorder(),
174193
),
175194
onChanged: (value) => homeController.projectcontroller.text = value,
176195
focusNode: focusNode,
177196
validator: (value) {
178197
if (value != null && value.contains(" ")) {
179-
return "Can not have Whitespace";
198+
return SentenceManager(
199+
currentLanguage: homeController.selectedLanguage.value)
200+
.sentences
201+
.canNotHaveWhiteSpace;
180202
}
181203
return null;
182204
},
@@ -208,7 +230,10 @@ class AddTaskBottomSheet extends StatelessWidget {
208230
.priority.value), // Display the selected priority
209231
),
210232
decoration: InputDecoration(
211-
labelText: 'Priority',
233+
labelText: SentenceManager(
234+
currentLanguage: homeController.selectedLanguage.value)
235+
.sentences
236+
.priority,
212237
border: const OutlineInputBorder(),
213238
suffixIcon: Padding(
214239
padding: const EdgeInsets.only(right: 8.0),
@@ -304,7 +329,10 @@ class AddTaskBottomSheet extends StatelessWidget {
304329
homeController.projectcontroller.text = '';
305330
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
306331
content: Text(
307-
'Task Added Successfully!',
332+
SentenceManager(
333+
currentLanguage: homeController.selectedLanguage.value)
334+
.sentences
335+
.addTaskTaskAddedSuccessfully,
308336
style: TextStyle(
309337
color: AppSettings.isDarkMode
310338
? TaskWarriorColors.kprimaryTextColor

lib/app/modules/manage_task_champion_creds/views/manage_task_champion_creds_view.dart

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import 'package:flutter/material.dart';
22
import 'package:get/get.dart';
33
import 'package:google_fonts/google_fonts.dart';
4+
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
45
import 'package:taskwarrior/app/utils/constants/constants.dart';
6+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
57
import 'package:taskwarrior/app/utils/themes/theme_extension.dart';
68
import 'package:url_launcher/url_launcher.dart';
79
import '../controllers/manage_task_champion_creds_controller.dart';
@@ -24,7 +26,9 @@ class ManageTaskChampionCredsView
2426
crossAxisAlignment: CrossAxisAlignment.start,
2527
children: [
2628
Text(
27-
"Configure TaskChampion",
29+
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
30+
.sentences
31+
.configureTaskchampion,
2832
style: GoogleFonts.poppins(
2933
color: TaskWarriorColors.white,
3034
fontSize: TaskWarriorFonts.fontSizeLarge,
@@ -65,7 +69,10 @@ class ManageTaskChampionCredsView
6569
style: TextStyle(color: tColors.primaryTextColor),
6670
controller: controller.encryptionSecretController,
6771
decoration: InputDecoration(
68-
labelText: 'Encryption Secret',
72+
labelText: SentenceManager(
73+
currentLanguage: AppSettings.selectedLanguage)
74+
.sentences
75+
.encryptionSecret,
6976
labelStyle: TextStyle(color: tColors.primaryTextColor),
7077
border: const OutlineInputBorder(),
7178
),
@@ -75,7 +82,10 @@ class ManageTaskChampionCredsView
7582
style: TextStyle(color: tColors.primaryTextColor),
7683
controller: controller.clientIdController,
7784
decoration: InputDecoration(
78-
labelText: 'Client ID',
85+
labelText: SentenceManager(
86+
currentLanguage: AppSettings.selectedLanguage)
87+
.sentences
88+
.ccsyncClientId,
7989
labelStyle: TextStyle(color: tColors.primaryTextColor),
8090
border: const OutlineInputBorder(),
8191
),
@@ -85,7 +95,10 @@ class ManageTaskChampionCredsView
8595
style: TextStyle(color: tColors.primaryTextColor),
8696
controller: controller.ccsyncBackendUrlController,
8797
decoration: InputDecoration(
88-
labelText: 'CCSync Backend URL',
98+
labelText: SentenceManager(
99+
currentLanguage: AppSettings.selectedLanguage)
100+
.sentences
101+
.ccsyncBackendUrl,
89102
labelStyle: TextStyle(color: tColors.primaryTextColor),
90103
border: const OutlineInputBorder(),
91104
),
@@ -95,8 +108,14 @@ class ManageTaskChampionCredsView
95108
onPressed: () async {
96109
await controller.saveCredentials();
97110
Get.snackbar(
98-
'Success',
99-
'Credentials saved successfully',
111+
SentenceManager(
112+
currentLanguage: AppSettings.selectedLanguage)
113+
.sentences
114+
.success,
115+
SentenceManager(
116+
currentLanguage: AppSettings.selectedLanguage)
117+
.sentences
118+
.credentialsSavedSuccessfully,
100119
snackPosition: SnackPosition.BOTTOM,
101120
duration: Duration(seconds: 2),
102121
);
@@ -105,7 +124,10 @@ class ManageTaskChampionCredsView
105124
),
106125
const SizedBox(height: 10),
107126
Text(
108-
'Tip: Click on the info icon in the top right corner to get your credentials',
127+
SentenceManager(
128+
currentLanguage: AppSettings.selectedLanguage)
129+
.sentences
130+
.tip,
109131
style: TextStyle(
110132
fontSize: 15,
111133
color: tColors.primaryTextColor,

lib/app/utils/add_task_dialogue/date_picker_input.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:flutter/material.dart';
2+
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
3+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
24
import 'package:taskwarrior/app/utils/taskfunctions/add_task_dialog_utils.dart';
35
import 'package:taskwarrior/app/utils/themes/theme_extension.dart';
46

@@ -51,12 +53,12 @@ class _AddTaskDatePickerInputState extends State<AddTaskDatePickerInput> {
5153
bool isNextDateSelected = _selectedDates[getNextIndex()] != null;
5254
bool isPreviousDateSelected = _selectedDates[getPreviousIndex()] != null;
5355
String nextDateText = isNextDateSelected
54-
? "Change ${dateLabels[getNextIndex()]} Date"
55-
: "Add ${dateLabels[getNextIndex()]} Date";
56+
? "${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.change} ${dateLabels[getNextIndex()]} ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.date}"
57+
: "${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.add} ${dateLabels[getNextIndex()]} ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.date}";
5658

5759
String prevDateText = isPreviousDateSelected
58-
? "Change ${dateLabels[getPreviousIndex()]} Date"
59-
: "Add ${dateLabels[getPreviousIndex()]} Date";
60+
? "${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.change} ${dateLabels[getPreviousIndex()]} ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.date}"
61+
: "${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.add} ${dateLabels[getPreviousIndex()]} ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.date}";
6062
return Column(
6163
mainAxisSize: MainAxisSize.min,
6264
children: [
@@ -127,8 +129,10 @@ class _AddTaskDatePickerInputState extends State<AddTaskDatePickerInput> {
127129
return TextFormField(
128130
controller: _controllers[forIndex],
129131
decoration: InputDecoration(
130-
labelText: '${dateLabels[forIndex]} Date',
131-
hintText: 'Select a ${dateLabels[forIndex]}',
132+
labelText:
133+
'${dateLabels[forIndex]} ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.date}',
134+
hintText:
135+
'${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.select} ${dateLabels[forIndex]}',
132136
suffixIcon: const Icon(Icons.calendar_today),
133137
border: const OutlineInputBorder(),
134138
),
@@ -165,7 +169,7 @@ class _AddTaskDatePickerInputState extends State<AddTaskDatePickerInput> {
165169
DateTime? dt = _selectedDates[i];
166170
String? label = dateLabels[i];
167171
if (dt != null && dt.isBefore(DateTime.now())) {
168-
return "$label date cannot be in the past";
172+
return "$label ${SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.dateCanNotBeInPast}";
169173
}
170174
}
171175
return null;

lib/app/utils/add_task_dialogue/tags_input.dart

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:flutter/material.dart';
2+
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
3+
import 'package:taskwarrior/app/utils/language/sentence_manager.dart';
24
import 'package:textfield_tags/textfield_tags.dart';
35

46
class AddTaskTagsInput extends StatefulWidget {
@@ -80,10 +82,22 @@ class _AddTaskTagsInputState extends State<AddTaskTagsInput> {
8082
if (tags.contains(tag)) {
8183
stringTagController.onTagRemoved(tag);
8284
stringTagController.onTagSubmitted(tag);
83-
return "Tag already exists";
85+
return SentenceManager(
86+
currentLanguage: SentenceManager(
87+
currentLanguage: AppSettings.selectedLanguage)
88+
.currentLanguage)
89+
.sentences
90+
.tagAlreadyExists;
8491
}
8592
for (String tag in tags) {
86-
if (tag.contains(" ")) return "Tag should not contain spaces";
93+
if (tag.contains(" ")) {
94+
return SentenceManager(
95+
currentLanguage: SentenceManager(
96+
currentLanguage: AppSettings.selectedLanguage)
97+
.currentLanguage)
98+
.sentences
99+
.tagShouldNotContainSpaces;
100+
}
87101
}
88102
return null;
89103
},
@@ -92,7 +106,12 @@ class _AddTaskTagsInputState extends State<AddTaskTagsInput> {
92106
controller: inputFieldValues.textEditingController,
93107
focusNode: inputFieldValues.focusNode,
94108
decoration: InputDecoration(
95-
labelText: "Enter tags",
109+
labelText: SentenceManager(
110+
currentLanguage: SentenceManager(
111+
currentLanguage: AppSettings.selectedLanguage)
112+
.currentLanguage)
113+
.sentences
114+
.addTaskAddTags,
96115
border: const OutlineInputBorder(),
97116
prefixIconConstraints: BoxConstraints(
98117
maxWidth:

0 commit comments

Comments
 (0)