修复 图片加载

hmxc
张萌 4 years ago
parent ab97bd8db6
commit c6ee2c5817

@ -1,3 +1,3 @@
{
"flutterSdkVersion": "2.0.0"
"flutterSdkVersion": "2.0.2"
}

@ -1,3 +1,3 @@
{
"dart.flutterSdkPath": "/Users/zhangmeng/fvm/versions/2.0.0"
"dart.flutterSdkPath": "/Users/zhangmeng/fvm/versions/2.0.2"
}

@ -4,7 +4,7 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application android:name="io.flutter.app.FlutterApplication" android:label="小蜜蜂智慧社区" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<application android:name="io.flutter.app.FlutterApplication" android:label="小蜜蜂智慧社区管家端" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<meta-data android:name="com.amap.api.v2.apikey" android:value="872b909f2ebc8150b809d692c4349f22"/>
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as

@ -6,8 +6,8 @@ class InspectionCheckDetialModel {
int type;
String completeDate;
List<CheckFBIVoList> checkFBIVoList;
List<String> faceImg;
List<String> spaceImg;
List<FaceImg> faceImg;
List<FaceImg> spaceImg;
InspectionCheckDetialModel(
{this.id,
@ -33,8 +33,18 @@ class InspectionCheckDetialModel {
checkFBIVoList.add(new CheckFBIVoList.fromJson(v));
});
}
faceImg = json['faceImg'].cast<String>();
spaceImg = json['spaceImg'].cast<String>();
if (json['faceImg'] != null) {
faceImg = new List<FaceImg>();
json['faceImg'].forEach((v) {
faceImg.add(new FaceImg.fromJson(v));
});
}
if (json['spaceImg'] != null) {
spaceImg = new List<FaceImg>();
json['spaceImg'].forEach((v) {
spaceImg.add(new FaceImg.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
@ -49,8 +59,12 @@ class InspectionCheckDetialModel {
data['checkFBIVoList'] =
this.checkFBIVoList.map((v) => v.toJson()).toList();
}
data['faceImg'] = this.faceImg;
data['spaceImg'] = this.spaceImg;
if (this.faceImg != null) {
data['faceImg'] = this.faceImg.map((v) => v.toJson()).toList();
}
if (this.spaceImg != null) {
data['spaceImg'] = this.spaceImg.map((v) => v.toJson()).toList();
}
return data;
}
}
@ -79,3 +93,31 @@ class CheckFBIVoList {
return data;
}
}
class FaceImg {
String url;
int size;
int longs;
int paragraph;
int sort;
FaceImg({this.url, this.size, this.longs, this.paragraph, this.sort});
FaceImg.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -1,3 +1,4 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/inspection/inspection_check_detail_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_utils.dart';
@ -99,7 +100,10 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
? Container(
width: 320.w,
height: 320.w,
child: Placeholder(),
child: FadeInImage.assetNetwork(
fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(_detialModel.faceImg?.first?.url ?? '')),
)
: DottedBorder(
borderType: BorderType.RRect,
@ -148,7 +152,10 @@ class _InspectionPointDetailPageState extends State<InspectionPointDetailPage> {
? Container(
width: 320.w,
height: 320.w,
child: Placeholder(),
child: FadeInImage.assetNetwork(
fit: BoxFit.fill,
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(_detialModel.spaceImg?.first?.url ?? '')),
)
: DottedBorder(
borderType: BorderType.RRect,

@ -54,7 +54,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: _detailModel.firstImg?.url ?? '',
image: API.image(_detailModel.firstImg?.url ?? ''),
fit: BoxFit.cover,
),
Padding(

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/activity_item_model.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_detail_page.dart';
import 'package:flutter/material.dart';
@ -40,7 +41,7 @@ class ActivityManagerCard extends StatelessWidget {
tag: model.title,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: model.firstImg?.url ?? '',
image: API.image(model.firstImg?.url ?? ''),
fit: BoxFit.cover,
),
),

@ -1,4 +1,5 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_community_manager/models/manager/bussiness_and_fix/dispatch_detail_model.dart';
import 'package:aku_community_manager/models/manager/bussiness_and_fix/dispatch_report_model.dart';
@ -123,7 +124,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
builder: (context) {
final userProvider =
Provider.of<UserProvider>(context, listen: false);
if (userProvider.infoModel.canOperation&&widget.model.status<2) {
if (userProvider.infoModel.canOperation && widget.model.status < 2) {
return AkuMaterialButton(
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
@ -180,7 +181,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
),
);
}
} else if ((widget.model.status==3) &&
} else if ((widget.model.status == 3) &&
userProvider.infoModel.canPickUpTicket)
return Container(
height: 96.w,
@ -291,7 +292,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: e.url),
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url)),
);
}).toList(),
shrinkWrap: true,
@ -472,7 +474,8 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: e.url));
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url)));
}).toList(),
),
],

@ -1,5 +1,8 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/tools/aku_map.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart';
import 'package:flutter/material.dart';
@ -11,8 +14,6 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart';
// Project imports:
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
@ -29,9 +30,9 @@ class BusinessFixCard extends StatefulWidget {
}
class _BusinessFixCardState extends State<BusinessFixCard> {
USER_ROLE get userRole {
UserInfoModel get userInfoModel {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return userProvider.userInfoModel.role;
return userProvider.infoModel;
}
String get dateStart => DateUtil.formatDateStr(widget.model.repairDate,
@ -61,10 +62,9 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false);
return GestureDetector(
onTap: () {
Get.to(BusinessAndFixDetailPage(model: widget.model));
Get.to(() => BusinessAndFixDetailPage(model: widget.model));
},
child: Container(
padding: EdgeInsets.all(24.w),
@ -86,12 +86,10 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
),
Text(
AkuMap.fixStatus(
userProvider.infoModel.canOperation,
userProvider.infoModel.canPickUpTicket,
widget.model.status),
AkuMap.fixStatus(userInfoModel.canOperation,
userInfoModel.canPickUpTicket, widget.model.status),
style: TextStyle(
color: widget.model.status <4
color: widget.model.status < 4
? Color(0XFFFF4501)
: AppStyle.minorTextColor,
),
@ -141,7 +139,8 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: imgObj),
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(imgObj ?? '')),
);
},
itemCount: widget.model.imgUrls.length,
@ -150,8 +149,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
}
_buildBottomCard() {
switch (userRole) {
case USER_ROLE.FIXER:
if (userInfoModel.canPickUpTicket) {
if (widget.model.status > 4) return SizedBox();
return Column(
children: [
@ -233,8 +231,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
],
);
break;
default:
} else {
return Column(
children: [
widget.homeDisplay ? Divider(height: 24.w) : Divider(height: 48.w),
@ -243,7 +240,7 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
child: AkuMaterialButton(
height: 64.w,
onPressed: () {
// Get.to(BusinessAndFixDetailPage(model: widget.model));
Get.to(() => BusinessAndFixDetailPage(model: widget.model));
},
radius: 4,
color: AppStyle.primaryColor,
@ -261,7 +258,6 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
),
],
);
break;
}
}
}

@ -96,8 +96,9 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: widget.model.repairDetail.imgUrls[index].url,
));
image: API.image(
widget.model.repairDetail.imgUrls[index].url,
)));
},
itemCount: widget.model.repairDetail.imgUrls.length,
),
@ -389,8 +390,8 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
// materialPrice: double.parse(_materialController.text),
// );
// Get.back();
List<String> urls = await NetUtil()
.uploadFiles(_imgs, API.upload.uploadArtical);
List<String> urls =
await NetUtil().uploadFiles(_imgs, API.upload.uploadArtical);
BaseModel baseModel = await ManageFunc.handleResult(
widget.model.repairDetail.dispatchId,
_descriptionController.text,

@ -112,8 +112,9 @@ class _BeeListViewState<T> extends State<BeeListView> {
params: _params,
);
_models.addAll(widget.convert(_model) as List<T>);
if (_pageNum >= _model.pageCount)
widget.controller.finishLoad(noMore: true);
// if (_pageNum >= _model.pageCount) {
widget.controller.finishLoad();
// }
setState(() {});
},
child: widget.builder(_models),

Loading…
Cancel
Save