-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.dart
53 lines (50 loc) · 1.39 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
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:provider/provider.dart';
import 'package:studio/app_state.dart';
import 'package:studio/file_upload.dart';
import 'package:studio/object_adapter.dart';
void main() {
for (var i = 0; i < 224; i++) {
Hive.registerAdapter(ObjectAdapter(), i);
}
runApp(MyApp());
}
final appState = AppState();
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hive Studio',
theme: ThemeData(
primarySwatch: Colors.blue,
fontFamily: 'OpenSans',
),
home: Scaffold(
backgroundColor: Color(0xFFE6EBEB),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 400),
child: Image.asset('assets/logo.png'),
),
onTap: () {
appState.status = UploadStatus.none;
},
),
SizedBox(height: 20),
Expanded(
child: ChangeNotifierProvider(
child: FileUpload(),
create: (context) => appState,
),
),
],
),
),
);
}
}