forked from flutterph/devs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
60 lines (55 loc) · 1.53 KB
/
main.dart
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
import 'package:devs/core/datasource/local/devs_local_datasource.dart';
import 'package:devs/core/repositories/devs_repository.dart';
import 'package:devs/features/dashboard/dashboard_page.dart';
import 'package:devs/features/dashboard/dashboard_model.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
void main() {
runApp(DevsApp());
}
class DevsApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _DevsAppState();
}
}
class _DevsAppState extends State<DevsApp> {
IDevsLocalDataSource devsLocalDataSource;
IDevsRepository devsRepository;
@override
void initState() {
devsLocalDataSource = DevsLocalDataSource();
devsRepository = DevsRepository(
devsLocalDataSource,
);
super.initState();
}
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(
create: (_) => DashboardModel(),
),
Provider(
create: (_) => devsLocalDataSource,
),
Provider(
create: (_) => devsRepository,
),
],
child: MaterialApp(
title: 'Devs App by Flutter Philippines',
theme: ThemeData(
textTheme: GoogleFonts.latoTextTheme(
Theme.of(context).textTheme,
),
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: DashboardPage(),
),
);
}
}