34 lines
756 B
Dart
34 lines
756 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:todo/pages/home_page.dart';
|
|
import 'package:hive_flutter/hive_flutter.dart';
|
|
|
|
void main() async {
|
|
//init hive
|
|
await Hive.initFlutter();
|
|
//open the box
|
|
var box = await Hive.openBox('todoBox');
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
class MyApp extends StatefulWidget {
|
|
const MyApp({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MyApp> createState() => _MyAppState();
|
|
}
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
// This widget is the root of your application.
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: 'Todo',
|
|
theme: ThemeData(
|
|
primarySwatch: Colors.red,
|
|
),
|
|
home: const MyHomePage(title: 'Ma liste de tache'),
|
|
);
|
|
}
|
|
}
|