diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 7d845be..3020b6f 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -109,19 +109,19 @@ android { // 应用信息配置 - productFlavors { - // 智夜生活 - zhiying { - applicationId "cn.zhios.zhiying" - versionCode 53 - dimension "app" - versionName '1.3.13' - // 签名信息 - signingConfig signingConfigs.zhiying - } - } - - // 打包脚本 +// productFlavors { +// // 智夜生活 +// zhiying { +// applicationId "cn.zhios.zhiying" +// versionCode 53 +// dimension "app" +// versionName '1.3.13' +// // 签名信息 +// signingConfig signingConfigs.zhiying +// } +// } +// +// // 打包脚本 // android.applicationVariants.all { variant -> // if (variant.buildType.name != "debug") { // variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") @@ -136,18 +136,18 @@ android { // } // } // } -// -// configurations.all { -// resolutionStrategy.eachDependency { DependencyResolveDetails details -> -// def requested = details.requested -// if (requested.group == 'com.android.support') { -// if (!requested.name.startsWith("multidex")) { -// details.useVersion '28.0.3' -// } -// } -// resolutionStrategy.force 'com.android.support:support-v4:28.0.0' -// } -// } + + configurations.all { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + def requested = details.requested + if (requested.group == 'com.android.support') { + if (!requested.name.startsWith("multidex")) { + details.useVersion '28.0.3' + } + } + resolutionStrategy.force 'com.android.support:support-v4:28.0.0' + } + } } diff --git a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index 86b54c6..d569792 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -162,8 +162,13 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN // map.put("secret_key", "123456"); ///正式 - map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 - map.put("master_id", "99813608"); +// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 +// map.put("master_id", "99813608"); +// map.put("secret_key", "123456"); + + //客户测试 + map.put("domain", "http://api.zhiyingos.com/");//45678910,api.zhios.cn84198689 + map.put("master_id", "80685217"); map.put("secret_key", "123456"); // map.put("token", "123465"); diff --git a/lib/pages/custom_page/custom_item_page.dart b/lib/pages/custom_page/custom_item_page.dart index 83afea4..df6db39 100644 --- a/lib/pages/custom_page/custom_item_page.dart +++ b/lib/pages/custom_page/custom_item_page.dart @@ -166,6 +166,7 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit header: RefreshGifHeader(), // footer: RefreshFooter(), child: CustomScrollView( + physics: BouncingScrollPhysics(), controller: _controller, slivers: _buildContentWidgets(model), ), diff --git a/lib/pages/guide_page/guide_page.dart b/lib/pages/guide_page/guide_page.dart index 837e140..7dc71a9 100644 --- a/lib/pages/guide_page/guide_page.dart +++ b/lib/pages/guide_page/guide_page.dart @@ -59,15 +59,21 @@ class _GuidePageState extends State { height: double.infinity, decoration: BoxDecoration( image: DecorationImage( - image: Image.memory( - bgImage, - ).image, + image: bgImage != null + ? Image.memory( + bgImage, + ).image + : CachedNetworkImageProvider(""), fit: BoxFit.fill)), child: Center( - child: Image.memory( - widget.imageDatas[index], - fit: BoxFit.fitWidth, - ))), + child: widget.imageDatas[index] != null + ? Image.memory( + widget.imageDatas[index], + fit: BoxFit.fitWidth, + ) + : Container( + color: Colors.white, + ))), index == widget?.bgImageDatas?.length - 1 ? Positioned( left: 0, diff --git a/lib/pages/launch_page/launch_page.dart b/lib/pages/launch_page/launch_page.dart index 3dc5fc5..21c38c6 100644 --- a/lib/pages/launch_page/launch_page.dart +++ b/lib/pages/launch_page/launch_page.dart @@ -59,7 +59,6 @@ class _LaunchPageState extends State with TickerProviderStateMixin { Logger.debug('ConnectivityResult.wifi'); print('ConnectivityResult.wifi'); Application.init().then((_) async { - ///引导页 PackageInfo packageInfo = await PackageInfo.fromPlatform(); String versionNumber = await SharedPreferencesUtil.getStringValue(Constants.versionNumber); @@ -76,7 +75,7 @@ class _LaunchPageState extends State with TickerProviderStateMixin { // CupertinoPageRoute(builder: (context) => HomePage())); Navigator.of(context).pushReplacementNamed('/homePage'); } - }).catchError((err,s) async { + }).catchError((err, s) async { print(s); // if (err.toString().contains("BaseSettingModel")) { // await showDialog( @@ -122,22 +121,30 @@ class _LaunchPageState extends State with TickerProviderStateMixin { Dio dio = Dio(); print("加载图片"); List guideImages = List(); - ListbgImages = List(); + List bgImages = List(); for (int i = 0; i < guide.guideData.guideCss.length; i++) { - Response response = await dio.get(guide.guideData.guideCss[i].contentImage, options: Options(responseType: ResponseType.bytes)); - if (response.statusCode == 200) { - Uint8List data = Uint8List.fromList(response.data); - guideImages.add(data); + try { + Response response = await dio.get(guide.guideData.guideCss[i].contentImage, options: Options(responseType: ResponseType.bytes)); + if (response.statusCode == 200) { + Uint8List data = Uint8List.fromList(response.data); + guideImages.add(data); + } + } catch (e, s) { + guideImages.add(null); } - response = await dio.get(guide.guideData.guideCss[i].bgImage, options: Options(responseType: ResponseType.bytes)); - if (response.statusCode == 200) { - Uint8List data = Uint8List.fromList(response.data); - bgImages.add(data); + + try { + Response response = await dio.get(guide.guideData.guideCss[i].bgImage, options: Options(responseType: ResponseType.bytes)); + if (response.statusCode == 200) { + Uint8List data = Uint8List.fromList(response.data); + bgImages.add(data); + } + } catch (e, s) { + bgImages.add(null); } } - NativeUtil.notifyInitSuccess(); - await Navigator.of(context).push(CupertinoPageRoute(builder: (context) => GuidePage(guide.guideData, guideImages,bgImages))); + await Navigator.of(context).push(CupertinoPageRoute(builder: (context) => GuidePage(guide.guideData, guideImages, bgImages))); } } catch (e) { throw "引导图加载失败"; diff --git a/pubspec.yaml b/pubspec.yaml index f27a314..5eea53f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,7 @@ dependencies: flutter_user_agent: ^1.2.2 + dev_dependencies: flutter_test: sdk: flutter @@ -66,7 +67,6 @@ dev_dependencies: zhiying_comm: path: ../zhiying_comm - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec