王亚玲 2 years ago
commit 9bfe528181

@ -20,13 +20,11 @@ def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) { if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0'
} }
def keystoreProperties = new Properties() def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties') def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

@ -72,11 +72,7 @@ class _MyAppState extends State<MyApp> {
void initState() { void initState() {
super.initState(); super.initState();
// final service = FlutterBackgroundService(); // final service = FlutterBackgroundService();
// Future.delayed(const Duration(milliseconds: 0), () async {
// //Hive.initFlutter;
// });
_Getpermission(); _Getpermission();
HiveStore.init();
registerWxApi( registerWxApi(
appId: "wxd930ea5d5a228f5f", appId: "wxd930ea5d5a228f5f",
// universalLink:"http://api.dxbs.vip/ " // universalLink:"http://api.dxbs.vip/ "

@ -1,7 +1,15 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:project_telephony/ui/tab_navigator.dart';
import 'dart:async'; import 'dart:async';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import 'package:provider/provider.dart';
import '../constants/environment/environment.dart';
import '../providers/user_provider.dart';
import '../utils/hive_store.dart';
import 'login/login_page.dart';
class Loading extends StatefulWidget { class Loading extends StatefulWidget {
Loading({Key? key}) : super(key: key); Loading({Key? key}) : super(key: key);
@ -12,11 +20,27 @@ class Loading extends StatefulWidget {
class _LoadingState extends State<Loading> { class _LoadingState extends State<Loading> {
Future initialAll() async {
await HiveStore.init();
}
@override @override
void initState() { void initState() {
// TODO: implement initState
super.initState(); super.initState();
final userProvider = Provider.of<UserProvider>(context, listen: false);
var env = const String.fromEnvironment('ENV', defaultValue: 'dev');
if (kDebugMode) {
print('env :$env');
}
DevEV.instance.setEnvironment( context, environment: env == 'dev',);
Future.delayed(const Duration(milliseconds: 1000), () async {
await initialAll();
if (!await userProvider.init()) {
await Get.offAll(() => const LoginPage());
} else {
await Get.offAll(() => const TabNavigator());
}
});
Future.delayed(const Duration(seconds: 3),(){ Future.delayed(const Duration(seconds: 3),(){
//3 //3
Navigator.of(context).pushReplacementNamed("/TabNavigator"); Navigator.of(context).pushReplacementNamed("/TabNavigator");

@ -5,6 +5,7 @@ import 'package:project_telephony/ui/user/user_page.dart';
import 'package:project_telephony/utils/headers.dart'; import 'package:project_telephony/utils/headers.dart';
import '../utils/hive_store.dart';
import 'home/home_page.dart'; import 'home/home_page.dart';
class TabNavigator extends StatefulWidget { class TabNavigator extends StatefulWidget {
@ -29,8 +30,8 @@ class _TabNavigatorState extends State<TabNavigator>
super.initState(); super.initState();
// //
Future.delayed(const Duration(milliseconds: 0), () async { Future.delayed(const Duration(milliseconds: 0), () async {
// Hive.initFLutter; //Hive.initFlutter;
// await HiveStore.init() await HiveStore.init();
}); });
_pages = [const HomePage(), const UserPage()]; _pages = [const HomePage(), const UserPage()];
_tabController = TabController( _tabController = TabController(

Loading…
Cancel
Save