34 lines
705 B
Dart
34 lines
705 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hive_flutter/hive_flutter.dart';
|
|
import 'package:story/screens/homePage.dart';
|
|
import 'package:story/screens/storyPage.dart';
|
|
|
|
void main() async {
|
|
|
|
//init hive
|
|
await Hive.initFlutter() ;
|
|
|
|
//open box
|
|
var box = Hive.openBox('storyBox');
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({ super.key}) ;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Mon Application',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.blue,
|
|
),
|
|
home: Material(child: const HomePage()),
|
|
routes: {
|
|
'storyPage': (context) => StoryPage(),
|
|
},
|
|
);
|
|
}
|
|
}
|