Added route for the new task screen, changed the [NewItemDialogButton] to use the onTap method passed to it instead of a dummy one
This commit is contained in:
parent
39ddba0fce
commit
8b3bd37df7
4 changed files with 26 additions and 8 deletions
|
|
@ -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();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../blocs/new_task_bloc.dart';
|
||||
|
||||
class NewTaskScreen extends StatefulWidget {
|
||||
@override
|
||||
State<NewTaskScreen> createState() => _NewTaskScreenState();
|
||||
}
|
||||
|
||||
class _NewTaskScreenState extends State<NewTaskScreen> {
|
||||
Widget build(BuildContext context) {}
|
||||
final NewTaskBloc bloc = NewTaskBloc();
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -35,12 +35,15 @@ class NewItemDialogRoute extends PopupRoute {
|
|||
children: <Widget>[
|
||||
NewItemDialogButton(
|
||||
label: 'Task',
|
||||
onTap: () =>
|
||||
Navigator.of(context).pushReplacementNamed('newTask/'),
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
NewItemDialogButton(
|
||||
label: 'Media',
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue