Skip to content

Commit

Permalink
Merge pull request #24 from hkamran80/release/1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hkamran80 authored Apr 9, 2023
2 parents 8c53bc3 + 5ce536a commit daa5175
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 38 deletions.
5 changes: 2 additions & 3 deletions lib/screens/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:ramadan_taskminder/constants.dart';
import 'package:ramadan_taskminder/theme.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/stacked_card.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';
Expand Down Expand Up @@ -124,9 +125,7 @@ class _AboutScreenState extends State<AboutScreen> {
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12),
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:ramadan_taskminder/theme.dart';
import 'package:ramadan_taskminder/tasks.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/statistic_card.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';
Expand Down Expand Up @@ -307,9 +308,7 @@ class _HomeScreenState extends State<HomeScreen> {
content: "Submit feedback",
onTap: () => _launchUrl(),
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/prayers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ramadan_taskminder/prayers.dart';
import 'package:ramadan_taskminder/theme.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';

Expand Down Expand Up @@ -172,9 +173,7 @@ class _PrayersScreenState extends State<PrayersScreen> {
)
],
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/quran.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:ramadan_taskminder/quran.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/quran_addition_row.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/stacked_card.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';
Expand Down Expand Up @@ -332,9 +333,7 @@ class _QuranScreenState extends State<QuranScreen> {
: const Text("Log some reading first!"),
],
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:ramadan_taskminder/tasks.dart';
import 'package:ramadan_taskminder/theme.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/statistic_card.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';
Expand Down Expand Up @@ -91,9 +92,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
onTap: () =>
GoRouter.of(context).push("/settings/about"),
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
15 changes: 9 additions & 6 deletions lib/screens/settings_tasks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:ramadan_taskminder/tasks.dart';
import 'package:ramadan_taskminder/widgets/add_task_modal.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';

class SettingsTasksScreen extends StatefulWidget {
Expand Down Expand Up @@ -118,9 +119,11 @@ class _SettingsTasksScreenState extends State<SettingsTasksScreen> {
header: appName,
title: "Edit Tasks",
priorPathName: "Settings",
hintText: "Drag the handles on each task to rearrange. Long press on a task to delete.",
rightAlign: TextButton(
onPressed: () => showModalBottomSheet(
onPressed: () => showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) => AddTaskModal(
addTask: (String task) {
setState(
Expand Down Expand Up @@ -158,8 +161,10 @@ class _SettingsTasksScreenState extends State<SettingsTasksScreen> {
content: task,
trailing: ReorderableDragStartListener(
index: allTasks.indexOf(task),
child:
const Icon(LucideIcons.gripVertical),
child: Icon(
LucideIcons.gripVertical,
color: getButtonTextColor(context),
),
),
onLongPress: () {
deletingTask = task;
Expand All @@ -170,9 +175,7 @@ class _SettingsTasksScreenState extends State<SettingsTasksScreen> {
],
),
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/tasks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ramadan_taskminder/theme.dart';
import 'package:ramadan_taskminder/tasks.dart';
import 'package:ramadan_taskminder/widgets/page_footer.dart';
import 'package:ramadan_taskminder/widgets/page_header.dart';
import 'package:ramadan_taskminder/widgets/screen_footer.dart';
import 'package:ramadan_taskminder/widgets/section_header.dart';
import 'package:ramadan_taskminder/widgets/wide_card.dart';

Expand Down Expand Up @@ -164,9 +165,7 @@ class _TasksScreenState extends State<TasksScreen> {
)
],
),
const SizedBox(
height: 75,
),
const ScreenFooter(),
],
),
),
Expand Down
3 changes: 1 addition & 2 deletions lib/widgets/add_task_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class _AddTaskModalState extends State<AddTaskModal> {
const SizedBox(height: 10),
TextField(
controller: controller,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: "Task",
focusColor: getPrimaryColor(context),
Expand All @@ -80,7 +79,7 @@ class _AddTaskModalState extends State<AddTaskModal> {
)
: const SizedBox(),
const SizedBox(
height: 45,
height: 15,
)
],
),
Expand Down
30 changes: 19 additions & 11 deletions lib/widgets/quran_addition_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,30 @@ class QuranAdditionRow extends StatefulWidget {

class _QuranAdditionRowState extends State<QuranAdditionRow> {
final surahNames = surahs.map((surah) => surah["name"].toString()).toList();
final controller = TextEditingController();

@override
void dispose() {
controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
final ayahsCount = int.tryParse(widget.surahIndex != -1
? surahs[widget.surahIndex]["ayahs"].toString()
: "0");

controller.addListener(
() {
String value = controller.text.trim();
int? ayah = int.tryParse(value.replaceAll(RegExp(r"[^0-9]"), ""));
if (ayah != null && ayah > 0 && ayah <= ayahsCount!) {
widget.setAyah(ayah);
}
},
);

return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down Expand Up @@ -87,22 +104,13 @@ class _QuranAdditionRowState extends State<QuranAdditionRow> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Enter the ayah (1-$ayahsCount). Due to a bug with the system, you may have to double-tap the text field before it will let you type.",
"Enter the ayah (1-$ayahsCount)",
textAlign: TextAlign.left,
),
const SizedBox(height: 10),
TextField(
onChanged: (value) {
int? ayah = int.tryParse(
value.replaceAll(RegExp(r"[^0-9]"), ""));
if (ayah != null &&
ayah > 0 &&
ayah <= ayahsCount!) {
widget.setAyah(ayah);
}
},
onEditingComplete: () => Navigator.pop(context),
controller: TextEditingController(),
controller: controller,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: "Ayah",
Expand Down
14 changes: 14 additions & 0 deletions lib/widgets/screen_footer.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:flutter/material.dart';

class ScreenFooter extends StatelessWidget {
const ScreenFooter({
Key? key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
);
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.9.1+2
version: 1.0.0+3

environment:
sdk: ">=2.18.4 <3.0.0"
Expand Down

0 comments on commit daa5175

Please sign in to comment.