cpd/lib/main.dart

34 lines
925 B
Dart
Raw Normal View History

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,
theme: ThemeData(
useMaterial3: true,
),
home: MyHomePage(database: database, title: 'homepage'),
);
}
}