diff --git a/lib/components/AddDialog.dart b/lib/components/AddDialog.dart index 7e1267b..59963df 100644 --- a/lib/components/AddDialog.dart +++ b/lib/components/AddDialog.dart @@ -19,7 +19,12 @@ class AddDialog extends StatefulWidget { final void Function(String title, DateTime? dueDate)? onAddTask; final InputDecoration? decoration; final String? prefilledTitle; - const AddDialog({Key? key, this.onAdd, this.decoration, this.onAddTask, this.prefilledTitle}) + const AddDialog( + {Key? key, + this.onAdd, + this.decoration, + this.onAddTask, + this.prefilledTitle}) : super(key: key); @override diff --git a/lib/pages/landing_page.dart b/lib/pages/landing_page.dart index 9646e8c..3ecf228 100644 --- a/lib/pages/landing_page.dart +++ b/lib/pages/landing_page.dart @@ -45,7 +45,6 @@ class LandingPageState extends State { ); } - void handleMethod(List method) { switch (method[0]) { case "open_add_task": @@ -61,12 +60,13 @@ class LandingPageState extends State { void scheduleIntent() async { try { // This is needed when app is already open and quicktile is clicked - List? method = (await platform.invokeMethod("isQuickTile", "")).map((val) => val.toString()).toList(); + List? method = (await platform.invokeMethod("isQuickTile", "")) + .map((val) => val.toString()) + .toList(); - if(method != null) { + if (method != null) { handleMethod(method); } - } catch (e) { log(e.toString()); } @@ -80,11 +80,10 @@ class LandingPageState extends State { void initState() { super.initState(); - Future.delayed(Duration.zero,() { + Future.delayed(Duration.zero, () { _updateDefaultList().then((_) { scheduleIntent(); - } - ); + }); }); } @@ -183,7 +182,7 @@ class LandingPageState extends State { showDialog( context: context, builder: (_) => AddDialog( - prefilledTitle: prefilledTitle, + prefilledTitle: prefilledTitle, onAddTask: (title, dueDate) => _addTask(title, dueDate, context), decoration: new InputDecoration( labelText: 'Task Name', hintText: 'eg. Milk'))); diff --git a/lib/pages/project/project_task_list.dart b/lib/pages/project/project_task_list.dart index 1b1a66b..ee8ab98 100644 --- a/lib/pages/project/project_task_list.dart +++ b/lib/pages/project/project_task_list.dart @@ -346,7 +346,8 @@ class _ListPageState extends State { displayDoneTasks: displayDoneTasks); } - Future _addItemDialog(BuildContext context, [Bucket? bucket, String? taskName]) { + Future _addItemDialog(BuildContext context, + [Bucket? bucket, String? taskName]) { return showDialog( context: context, builder: (_) => AddDialog(