File tree Expand file tree Collapse file tree 3 files changed +53
-9
lines changed
Expand file tree Collapse file tree 3 files changed +53
-9
lines changed Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+
4+ class AddUserPage extends StatefulWidget {
5+ const AddUserPage ({Key ? key}) : super (key: key);
6+
7+ @override
8+ State <AddUserPage > createState () => _AddUserPageState ();
9+ }
10+
11+ class _AddUserPageState extends State <AddUserPage > {
12+ @override
13+ Widget build (BuildContext context) {
14+ return Container ();
15+ }
16+ }
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2+ import 'package:flutter_graphql/views/users_page.dart' ;
3+ import 'add_user_page.dart' ;
24
35class HomeScreen extends StatefulWidget {
46 const HomeScreen ({Key ? key}) : super (key: key);
@@ -12,20 +14,30 @@ class _HomeScreenState extends State<HomeScreen>{
1214
1315 @override
1416 Widget build (BuildContext context){
17+ Widget content = const UsersPage ();
1518 return Scaffold (
1619 appBar: AppBar (
17- title: const Text ('' ),
20+ title: const Text (
21+ "User's and Hobbies" ,
22+ style: TextStyle (
23+ color: Colors .grey,
24+ fontSize: 19 ,
25+ fontWeight: FontWeight .bold,
26+ ),
27+ ),
28+ backgroundColor: Colors .transparent,
29+ elevation: 0 ,
1830 ),
1931 body: Center (
20- child: Column (
21- mainAxisAlignment: MainAxisAlignment .center,
22- children: const < Widget > [],
23- ),
32+ child: content,
2433 ),
25- floatingActionButton: const FloatingActionButton (
26- onPressed: null ,
27- tooltip: 'Increment' ,
28- child: Icon (Icons .add),
34+ floatingActionButton: FloatingActionButton (
35+ onPressed: () async {
36+ final route = MaterialPageRoute (builder: (context) => const AddUserPage ());
37+ await Navigator .push (context, route);
38+ },
39+ backgroundColor: Colors .lightGreenAccent,
40+ child: const Icon (Icons .group_add),
2941 ),
3042 );
3143 }
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+ class UsersPage extends StatefulWidget {
4+ const UsersPage ({Key ? key}) : super (key: key);
5+
6+ @override
7+ State <UsersPage > createState () => _UsersPageState ();
8+ }
9+
10+ class _UsersPageState extends State <UsersPage > {
11+ @override
12+ Widget build (BuildContext context) {
13+ return Container ();
14+
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments