Skip to content

Commit 1e989b6

Browse files
committed
feat: created views and updated home page and routes
1 parent 113d5fe commit 1e989b6

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
}

client/lib/views/home_screen.dart

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_graphql/views/users_page.dart';
3+
import 'add_user_page.dart';
24

35
class 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
}

client/lib/views/users_page.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
}

0 commit comments

Comments
 (0)