notes/lib/main.dart

27 lines
766 B
Dart
Raw Normal View History

2022-10-29 18:06:20 +00:00
import 'package:flutter/foundation.dart';
2022-10-23 13:50:44 +00:00
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:sqflite/sqflite.dart';
2022-10-29 18:06:20 +00:00
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
2022-10-23 13:50:44 +00:00
import 'app.dart';
void main() async {
2022-10-29 18:06:20 +00:00
if (defaultTargetPlatform != TargetPlatform.android &&
defaultTargetPlatform != TargetPlatform.iOS) {
sqfliteFfiInit();
databaseFactory = databaseFactoryFfi;
2022-10-29 18:06:20 +00:00
}
WidgetsFlutterBinding.ensureInitialized();
Map<Permission, PermissionStatus> statuses =
await [Permission.manageExternalStorage, Permission.storage].request();
if (statuses.containsValue(PermissionStatus.denied)) {
// todo some error handling
}
runApp(const MaterialApp(home: App()));
2022-10-23 13:50:44 +00:00
}