2024-06-08 11:52:29 +02:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cpd/pages/homepage.dart';
|
|
|
|
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
|
|
|
import 'database/db.dart';
|
|
|
|
import 'database/db_interface.dart';
|
|
|
|
|
|
|
|
void main() async {
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
|
|
|
|
if (defaultTargetPlatform == TargetPlatform.macOS) {
|
|
|
|
sqfliteFfiInit();
|
|
|
|
databaseFactory = databaseFactoryFfi;
|
|
|
|
}
|
|
|
|
final HabitDatabase database = HabitDatabase();
|
|
|
|
runApp(MyApp(database: database));
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
final HabitDbInterface database;
|
|
|
|
const MyApp({super.key, required this.database});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
|
|
|
title: 'homepage',
|
2024-06-19 17:21:08 +02:00
|
|
|
debugShowCheckedModeBanner: false,
|
2024-06-08 11:52:29 +02:00
|
|
|
theme: ThemeData(
|
|
|
|
useMaterial3: true,
|
|
|
|
),
|
|
|
|
home: MyHomePage(database: database, title: 'homepage'),
|
|
|
|
);
|
|
|
|
}
|
2024-06-16 17:12:28 +02:00
|
|
|
}
|