Skip to content

Commit

Permalink
Merge pull request #225 from its-me-abhishek/main
Browse files Browse the repository at this point in the history
Fixed dialog box and keyboard fixes
  • Loading branch information
Pavel401 authored Dec 23, 2023
2 parents b972f3b + 3580d03 commit d854c5f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
23 changes: 19 additions & 4 deletions lib/widgets/add_Task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
}

Widget buildName() => TextFormField(
autofocus: true,
controller: namecontroller,
style: TextStyle(
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
Expand Down Expand Up @@ -321,8 +322,12 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
if (formKey.currentState!.validate()) {
if (due == null) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: const Text(
'Due date cannot be empty. Please select a due date.'),
content: Text(
'Due date cannot be empty. Please select a due date.',
style: TextStyle(
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
backgroundColor:
AppSettings.isDarkMode ? Colors.black : Colors.white,
duration: const Duration(seconds: 2),
Expand All @@ -343,7 +348,12 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
widgetController.fetchAllData();

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: const Text('Task Added Successfully, Tap to Edit'),
content: Text(
'Task Added Successfully, Tap to Edit',
style: TextStyle(
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
backgroundColor:
AppSettings.isDarkMode ? Colors.black : Colors.white,
duration: const Duration(seconds: 2),
Expand All @@ -360,7 +370,12 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
}
} on FormatException catch (e) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(e.message),
content: Text(
e.message,
style: TextStyle(
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
backgroundColor: AppSettings.isDarkMode
? const Color.fromARGB(255, 61, 61, 61)
: const Color.fromARGB(255, 39, 39, 39),
Expand Down
12 changes: 0 additions & 12 deletions lib/widgets/buildTasks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ class _TasksBuilderState extends State<TasksBuilder> {
},
child: const Text('No'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Cancel'),
),
],
);
},
Expand Down Expand Up @@ -242,12 +236,6 @@ class _TasksBuilderState extends State<TasksBuilder> {
},
child: const Text('No'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text('Cancel'),
),
],
);
},
Expand Down

0 comments on commit d854c5f

Please sign in to comment.