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