|
|
@@ -26,6 +26,7 @@ import 'package:zhiying_comm/util/shared_prefe_util.dart'; |
|
|
|
import 'package:package_info/package_info.dart'; |
|
|
|
import 'package:fluttertoast/fluttertoast.dart'; |
|
|
|
import 'package:zhiying_comm/util/update/app_update_util.dart'; |
|
|
|
|
|
|
|
// 启动页,页面初始化等操作~跟原生启动页保持一致,防止白屏问题 |
|
|
|
class LaunchPage extends StatefulWidget { |
|
|
|
final WidgetBuilder builder; |
|
|
@@ -57,19 +58,20 @@ class _LaunchPageState extends State<LaunchPage> with TickerProviderStateMixin { |
|
|
|
///检查是否覆盖安装 |
|
|
|
//取masterId |
|
|
|
|
|
|
|
String lasterMasterId = await SharedPreferencesUtil.getStringValue(Constants.masterId, defaultVal: "1"); |
|
|
|
Map setting = await NativeUtil.getSetting(); |
|
|
|
String masterId = setting['master_id']; |
|
|
|
if (lasterMasterId != "1") { |
|
|
|
if (masterId != lasterMasterId) { |
|
|
|
await SharedPreferencesUtil.clean(); |
|
|
|
} |
|
|
|
String lasterMasterId = await SharedPreferencesUtil.getStringValue(Constants.masterId, defaultVal: "1"); |
|
|
|
Map setting = await NativeUtil.getSetting(); |
|
|
|
String masterId = setting['master_id']; |
|
|
|
if (lasterMasterId != "1") { |
|
|
|
if (masterId != lasterMasterId) { |
|
|
|
await SharedPreferencesUtil.clean(); |
|
|
|
} |
|
|
|
SharedPreferencesUtil.setStringValue(Constants.masterId, masterId); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
SharedPreferencesUtil.setStringValue(Constants.masterId, masterId); |
|
|
|
|
|
|
|
Application.init().then((_) async { |
|
|
|
///初始化广告SDK |
|
|
|
await AdvertisingUtils.init(); |
|
|
|
|
|
|
|
///引导页 |
|
|
|
PackageInfo packageInfo = await PackageInfo.fromPlatform(); |
|
|
|
String versionNumber = await SharedPreferencesUtil.getStringValue(Constants.versionNumber); |
|
|
@@ -86,7 +88,6 @@ class _LaunchPageState extends State<LaunchPage> with TickerProviderStateMixin { |
|
|
|
// CupertinoPageRoute(builder: (context) => HomePage())); |
|
|
|
print("打开首页"); |
|
|
|
Navigator.of(context).pushReplacementNamed('/homePage'); |
|
|
|
|
|
|
|
} |
|
|
|
}).catchError((err, s) async { |
|
|
|
print(s); |
|
|
|