Skip to content

Commit

Permalink
Merge pull request #210 from its-me-abhishek/main
Browse files Browse the repository at this point in the history
Fixed UI of add task
  • Loading branch information
Pavel401 authored Nov 23, 2023
2 parents 5149f64 + 0063ff0 commit 452c8d9
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ class _MyAppState extends State<MyApp> {

return Sizer(builder: ((context, orientation, deviceType) {
return GetMaterialApp(
builder: (context, child) {
return Builder(
builder: (BuildContext context) {
return child!;
},
);
},
debugShowCheckedModeBanner: false,
title: 'Taskwarrior',
theme: ThemeData(
Expand Down
68 changes: 68 additions & 0 deletions lib/widgets/add_Task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,81 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
: null,
onTap: () async {
var date = await showDatePicker(
builder: (BuildContext context, Widget? child) {
return Theme(
data: Theme.of(context).copyWith(
colorScheme: AppSettings.isDarkMode
? const ColorScheme(
brightness: Brightness.dark,
primary: Colors.white,
onPrimary: Colors.black,
secondary: Colors.black,
onSecondary: Colors.white,
error: Colors.red,
onError: Colors.black,
background: Colors.black,
onBackground: Colors.white,
surface: Colors.black,
onSurface: Colors.white,
)
: const ColorScheme(
brightness: Brightness.light,
primary: Colors.black,
onPrimary: Colors.white,
secondary: Colors.white,
onSecondary: Colors.black,
error: Colors.red,
onError: Colors.white,
background: Colors.white,
onBackground: Colors.black,
surface: Colors.white,
onSurface: Colors.black,
)),
child: child!,
);
},
fieldHintText: "Month/Date/Year",
context: context,
initialDate: due ?? DateTime.now(),
firstDate: DateTime(1990),
lastDate: DateTime(2037, 12, 31),
);
if (date != null) {
var time = await showTimePicker(
builder: (BuildContext context, Widget? child) {
return Theme(
data: Theme.of(context).copyWith(
textTheme: const TextTheme(),
colorScheme: AppSettings.isDarkMode
? const ColorScheme(
brightness: Brightness.dark,
primary: Colors.white,
onPrimary: Colors.black,
secondary: Colors.black,
onSecondary: Colors.white,
error: Colors.red,
onError: Colors.black,
background: Colors.black,
onBackground: Colors.white,
surface: Colors.black,
onSurface: Colors.white,
)
: const ColorScheme(
brightness: Brightness.light,
primary: Colors.black,
onPrimary: Colors.white,
secondary: Colors.white,
onSecondary: Colors.black,
error: Colors.red,
onError: Colors.white,
background: Colors.white,
onBackground: Colors.black,
surface: Colors.white,
onSurface: Colors.black,
)),
child: child!,
);
},
context: context,
initialTime:
TimeOfDay.fromDateTime(due ?? DateTime.now()),
Expand Down

0 comments on commit 452c8d9

Please sign in to comment.