From b9b90bcd9b985ce8b53bf8effb927bec597d53dd Mon Sep 17 00:00:00 2001 From: arpit Date: Sun, 16 Oct 2022 16:12:23 +0530 Subject: [PATCH] location of Navigation button and UI design of add Task improved --- lib/view/screens/add_task.dart | 60 ++++++++++++++++--------------- lib/view/screens/home_screen.dart | 1 + 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/lib/view/screens/add_task.dart b/lib/view/screens/add_task.dart index b13f381..4644704 100644 --- a/lib/view/screens/add_task.dart +++ b/lib/view/screens/add_task.dart @@ -15,8 +15,10 @@ class AddTask extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Expanded( + Container( + padding: EdgeInsets.all(15), child: Center( child: TextFormField( controller: taskNameController, @@ -24,38 +26,40 @@ class AddTask extends StatelessWidget { decoration: const InputDecoration( hintText: 'Enter task name', labelStyle: TextStyle( - color: Color(0xFF6200EE), + color: Colors.indigo, ), ), ), )), - Padding( - padding: const EdgeInsets.all(10), - child: - Consumer(builder: (context, provider, child) { - return CustomButton( - buttonText: "Save", - buttonCta: () { - - provider - .onAddTask(TaskData(timerData, taskNameController.text),context); - Navigator.pop(context); - }, - ); - }), - ), - Padding( - padding: const EdgeInsets.all(10), - child: CustomButton( - buttonText: "Back", - buttonCta: () { - Navigator.pop(context); - }), - ), - const SizedBox( - height: 25, - width: double.infinity, + Container( + + padding: const EdgeInsets.all(40.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children:[ + Consumer(builder: (context, provider, child) { + return ElevatedButton( + child: Text('Save',style: TextStyle(fontSize: 18),), + style: ButtonStyle(shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))) ), + onPressed: () { + provider.onAddTask(TaskData(timerData, taskNameController.text),context); + Navigator.pop(context); + }, + ); + }), + + const SizedBox( + height: 10, + ), + + ElevatedButton( + child: Text("Back",style: TextStyle(fontSize: 18),), + style: ButtonStyle(shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(20))) ), + onPressed: () { + Navigator.pop(context); + }), + ]), ), ], ), diff --git a/lib/view/screens/home_screen.dart b/lib/view/screens/home_screen.dart index 512cefe..c9a506b 100644 --- a/lib/view/screens/home_screen.dart +++ b/lib/view/screens/home_screen.dart @@ -69,6 +69,7 @@ class HomeScreenView extends StatelessWidget { // TaskCard( // taskName: // colorCode: 800), + floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: SizedBox( height: 80, width: 80,