Files
todo/lib/main.dart
streaper2 979fcfa2a1 hive implementation
save todo in hive
first release
2023-09-29 11:22:28 +02:00

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'),
);
}
}