improved ux
This commit is contained in:
@@ -96,7 +96,13 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
minLines: 3,
|
||||
maxLines: 10,
|
||||
),
|
||||
TextFormField(
|
||||
Flex(
|
||||
direction: Axis.horizontal,
|
||||
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 3,
|
||||
child: TextFormField(
|
||||
focusNode: dueDateFocusNode,
|
||||
controller: dueDateController,
|
||||
onChanged: maybeEnableDueTime,
|
||||
@@ -107,7 +113,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
label: Text('Due Date'),
|
||||
suffix: IconButton(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () async {
|
||||
final result = await onOpenCalendarPickerPressed();
|
||||
if (result != null) {
|
||||
@@ -125,14 +131,18 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
keyboardType: TextInputType.datetime,
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
TextFormField(
|
||||
),
|
||||
Padding(padding: EdgeInsetsGeometry.only(left: 10)),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: TextFormField(
|
||||
focusNode: dueTimeFocusNode,
|
||||
onFieldSubmitted: (_) => dueTimeFocusNode.nextFocus(),
|
||||
controller: dueTimeController,
|
||||
enabled: isDueTimeEnabled,
|
||||
decoration: InputDecoration(
|
||||
label: Text('Due Time'),
|
||||
suffix: IconButton(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () async {
|
||||
final result = await onOpenTimePickerPressed();
|
||||
if (result != null && context.mounted) {
|
||||
@@ -147,6 +157,9 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
keyboardType: TextInputType.text,
|
||||
textInputAction: TextInputAction.next,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
TextFormField(
|
||||
focusNode: categoryFocusNode,
|
||||
controller: categoryController,
|
||||
@@ -198,7 +211,9 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
||||
title: titleController.text,
|
||||
description: descriptionController.text,
|
||||
start: null,
|
||||
due: null,
|
||||
due: DateTime.tryParse(
|
||||
'${dueDateController.text} ${dueTimeController.text}'.trim(),
|
||||
),
|
||||
isCompleted: false,
|
||||
category: categoryController.text,
|
||||
subtasks: [],
|
||||
|
||||
Reference in New Issue
Block a user