-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.dart
More file actions
71 lines (62 loc) · 1.81 KB
/
main.dart
File metadata and controls
71 lines (62 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import 'package:flutter/material.dart';
import '/presentation/screens/employees_list_screen.dart';
import './data/routes.dart';
import '/presentation/screens/employee_dialog.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Employee App",
home: const MyHomePage(),
routes: {
Routes.employeeListScreenRouteName: (context) =>
const EmployeesListScreen(),
Routes.employeeDialogRouteName: (context) => const EmployeeDialog(),
},
theme: ThemeData(
primaryColor: Colors.blue.shade900,
splashColor: Colors.blue,
textTheme: ThemeData.light().textTheme.copyWith(
headline6: const TextStyle(
fontFamily: 'Raleway-Bold',
fontSize: 20,
color: Colors.black,
),
),
),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Employee App'),
backgroundColor: Theme.of(context).primaryColor,
centerTitle: true,
),
body: Center(
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, Routes.employeeListScreenRouteName);
},
child: const Text('Get Employees List'),
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(Theme.of(context).primaryColor),
),
),
),
);
}
}