forked from eatvio/eatvio_app
Initialize Hive asynchoniously in order to improve app performance
This commit is contained in:
@@ -41,7 +41,7 @@ android {
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.eatvioapp.app"
|
||||
minSdkVersion 21
|
||||
minSdkVersion 23
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
multiDexEnabled true
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
|
||||
@@ -2,18 +2,17 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'core/app_export.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
|
||||
var globalMessengerKey = GlobalKey<ScaffoldMessengerState>();
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
Future.wait([
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
]),
|
||||
PrefUtils().init()
|
||||
]).then((value) {
|
||||
runApp(MyApp());
|
||||
});
|
||||
void main() async {
|
||||
var path = '/';
|
||||
await Hive.initFlutter(path);
|
||||
SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
]);
|
||||
await PrefUtils().init();
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
@@ -15,7 +15,8 @@ dependencies:
|
||||
flutter_svg: ^2.0.9
|
||||
equatable: ^2.0.0
|
||||
validators: ^3.0.0
|
||||
hive: ^4.0.0
|
||||
hive: ^2.2.3
|
||||
hive_flutter: ^1.1.0
|
||||
isar_flutter_libs: ^4.0.0-dev.13
|
||||
path_provider: ^2.1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user