Pārlūkot izejas kodu

1.修复页面无背景对像时报错问题

tags/0.0.4+1
“yanghuaxuan” pirms 3 gadiem
vecāks
revīzija
91bf717070
4 mainītis faili ar 36 papildinājumiem un 31 dzēšanām
  1. +27
    -27
      example/android/app/build.gradle
  2. +1
    -2
      lib/pages/custom_page/custom_page.dart
  3. +1
    -1
      lib/pages/main_page/main_page.dart
  4. +7
    -1
      lib/pages/main_page/main_page_bloc.dart

+ 27
- 27
example/android/app/build.gradle Parādīt failu

@@ -108,33 +108,33 @@ android {


// 应用信息配置
// productFlavors {
// // 智夜生活
// zhiying {
// applicationId "cn.zhios.zhiying"
// versionCode 28
// dimension "app"
// versionName '1.2.28'
// // 签名信息
// 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")
// }
//
// variant.outputs.all { output ->
// def outputFile = output.outputFile
// if (outputFile != null && outputFile.name.endsWith('.apk')) {
// //这里修改apk文件名
// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
// outputFileName = fileName
// }
// }
// }
productFlavors {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 28
dimension "app"
versionName '1.2.28'
// 签名信息
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")
}
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
outputFileName = fileName
}
}
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->


+ 1
- 2
lib/pages/custom_page/custom_page.dart Parādīt failu

@@ -411,8 +411,7 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single

///监听页面滚动
_listenScroller(double offset) {
print(offset.toString());
if (offset > 0) {
if (offset >= 0) {
backgroundTopMargin = -offset;
if (backgroundTopMargin > -500) {
backgroundBloc.streamController.add("");


+ 1
- 1
lib/pages/main_page/main_page.dart Parādīt failu

@@ -218,7 +218,7 @@ class _MainPageContainerState extends State<_MainPageContainer> {
if (_bloc.backgroundModel != null) {
var headerBg = _bloc.backgroundModel.headerBg;
return Container(
height: double.tryParse(_bloc?.backgroundModel?.headerBg?.height)?? 0,
height: double.tryParse(_bloc?.backgroundModel?.headerBg?.height)?? 0,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,


+ 7
- 1
lib/pages/main_page/main_page_bloc.dart Parādīt failu

@@ -38,7 +38,13 @@ class MainPageBloc extends BlocBase {
_pageData = list.map((item) {
return Map<String, dynamic>.from(item);
}).toList();
backgroundModel=BackgroundModel.fromJson(Con.json.decode(json['out_data']));
try{
backgroundModel=BackgroundModel.fromJson(Con.json.decode(json['out_data']));
}catch(e,s){
print(e);
print(s);
}

_mainController.add(_pageData);
}
}

Notiek ielāde…
Atcelt
Saglabāt