diff --git a/lib/src/App.dart b/lib/src/App.dart index d9e08c4..d821dfc 100644 --- a/lib/src/App.dart +++ b/lib/src/App.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'screens/home_screen.dart'; -import 'screens/login_screen.dart'; import 'screens/initial_loading_screen.dart'; +import 'screens/login_screen.dart'; +import 'screens/new_task_screen.dart'; class App extends StatelessWidget { Widget build(BuildContext context) { @@ -36,9 +37,17 @@ class App extends StatelessWidget { }, ); } else if (routeTokens.first == 'home') { - return MaterialPageRoute(builder: (BuildContext context) { - return HomeScreen(); - }); + return MaterialPageRoute( + builder: (BuildContext context) { + return HomeScreen(); + }, + ); + } else if (routeTokens.first == 'newTask') { + return MaterialPageRoute( + builder: (BuildContext context) { + return NewTaskScreen(); + }, + ); } } } diff --git a/lib/src/screens/new_task_screen.dart b/lib/src/screens/new_task_screen.dart index 8388fe9..669d307 100644 --- a/lib/src/screens/new_task_screen.dart +++ b/lib/src/screens/new_task_screen.dart @@ -1,10 +1,16 @@ import 'package:flutter/material.dart'; +import '../blocs/new_task_bloc.dart'; + class NewTaskScreen extends StatefulWidget { @override State createState() => _NewTaskScreenState(); } class _NewTaskScreenState extends State { - Widget build(BuildContext context) {} + final NewTaskBloc bloc = NewTaskBloc(); + + Widget build(BuildContext context) { + return Scaffold(); + } } diff --git a/lib/src/widgets/new_item_dialog_button.dart b/lib/src/widgets/new_item_dialog_button.dart index 95e847a..f4d9175 100644 --- a/lib/src/widgets/new_item_dialog_button.dart +++ b/lib/src/widgets/new_item_dialog_button.dart @@ -10,9 +10,9 @@ class NewItemDialogButton extends StatelessWidget { final String label; NewItemDialogButton({ - this.onTap, + @required this.onTap, this.label = '', - }); + }) : assert(onTap != null); Widget build(BuildContext context) { return Container( @@ -39,7 +39,7 @@ class NewItemDialogButton extends StatelessWidget { ), FloatingActionButton( child: Icon(FontAwesomeIcons.plus), - onPressed: () {}, + onPressed: onTap, ), ], ), diff --git a/lib/src/widgets/new_item_dialog_route.dart b/lib/src/widgets/new_item_dialog_route.dart index 260ffff..c029e05 100644 --- a/lib/src/widgets/new_item_dialog_route.dart +++ b/lib/src/widgets/new_item_dialog_route.dart @@ -35,12 +35,15 @@ class NewItemDialogRoute extends PopupRoute { children: [ NewItemDialogButton( label: 'Task', + onTap: () => + Navigator.of(context).pushReplacementNamed('newTask/'), ), SizedBox( width: 20, ), NewItemDialogButton( label: 'Media', + onTap: () {}, ), ], ),