Merge branch 'master' of http://192.168.2.201:8099/laiiihz/akuCommunity
commit
c1eb0b20a8
@ -0,0 +1,161 @@
|
|||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
|
||||||
|
class AdviceDetailModel {
|
||||||
|
AppAdviceDetailVo appAdviceDetailVo;
|
||||||
|
|
||||||
|
AdviceDetailModel({this.appAdviceDetailVo});
|
||||||
|
|
||||||
|
AdviceDetailModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
appAdviceDetailVo = json['appAdviceDetailVo'] != null
|
||||||
|
? new AppAdviceDetailVo.fromJson(json['appAdviceDetailVo'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.appAdviceDetailVo != null) {
|
||||||
|
data['appAdviceDetailVo'] = this.appAdviceDetailVo.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppAdviceDetailVo {
|
||||||
|
AppAdviceVo appAdviceVo;
|
||||||
|
List<AppAdviceContentVos> appAdviceContentVos;
|
||||||
|
|
||||||
|
AppAdviceDetailVo({this.appAdviceVo, this.appAdviceContentVos});
|
||||||
|
|
||||||
|
AppAdviceDetailVo.fromJson(Map<String, dynamic> json) {
|
||||||
|
appAdviceVo = json['appAdviceVo'] != null
|
||||||
|
? new AppAdviceVo.fromJson(json['appAdviceVo'])
|
||||||
|
: null;
|
||||||
|
if (json['appAdviceContentVos'] != null) {
|
||||||
|
appAdviceContentVos = new List<AppAdviceContentVos>();
|
||||||
|
json['appAdviceContentVos'].forEach((v) {
|
||||||
|
appAdviceContentVos.add(new AppAdviceContentVos.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.appAdviceVo != null) {
|
||||||
|
data['appAdviceVo'] = this.appAdviceVo.toJson();
|
||||||
|
}
|
||||||
|
if (this.appAdviceContentVos != null) {
|
||||||
|
data['appAdviceContentVos'] =
|
||||||
|
this.appAdviceContentVos.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppAdviceVo {
|
||||||
|
int id;
|
||||||
|
int type;
|
||||||
|
int status;
|
||||||
|
String content;
|
||||||
|
String createDate;
|
||||||
|
List<ImgUrls> imgUrls;
|
||||||
|
|
||||||
|
DateTime get date => DateUtil.getDateTime(createDate);
|
||||||
|
|
||||||
|
AppAdviceVo(
|
||||||
|
{this.id,
|
||||||
|
this.type,
|
||||||
|
this.status,
|
||||||
|
this.content,
|
||||||
|
this.createDate,
|
||||||
|
this.imgUrls});
|
||||||
|
|
||||||
|
AppAdviceVo.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
type = json['type'];
|
||||||
|
status = json['status'];
|
||||||
|
content = json['content'];
|
||||||
|
createDate = json['createDate'];
|
||||||
|
if (json['imgUrls'] != null) {
|
||||||
|
imgUrls = new List<ImgUrls>();
|
||||||
|
json['imgUrls'].forEach((v) {
|
||||||
|
imgUrls.add(new ImgUrls.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['type'] = this.type;
|
||||||
|
data['status'] = this.status;
|
||||||
|
data['content'] = this.content;
|
||||||
|
data['createDate'] = this.createDate;
|
||||||
|
if (this.imgUrls != null) {
|
||||||
|
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImgUrls {
|
||||||
|
String url;
|
||||||
|
String size;
|
||||||
|
int longs;
|
||||||
|
int paragraph;
|
||||||
|
int sort;
|
||||||
|
|
||||||
|
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
|
||||||
|
|
||||||
|
ImgUrls.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppAdviceContentVos {
|
||||||
|
int id;
|
||||||
|
int createUserType;
|
||||||
|
String content;
|
||||||
|
String createDate;
|
||||||
|
int parentId;
|
||||||
|
|
||||||
|
AppAdviceContentVos(
|
||||||
|
{this.id,
|
||||||
|
this.createUserType,
|
||||||
|
this.content,
|
||||||
|
this.createDate,
|
||||||
|
this.parentId});
|
||||||
|
|
||||||
|
DateTime get date => DateUtil.getDateTime(createDate);
|
||||||
|
|
||||||
|
AppAdviceContentVos.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
createUserType = json['createUserType'];
|
||||||
|
content = json['content'];
|
||||||
|
createDate = json['createDate'];
|
||||||
|
parentId = json['parentId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['createUserType'] = this.createUserType;
|
||||||
|
data['content'] = this.content;
|
||||||
|
data['createDate'] = this.createDate;
|
||||||
|
data['parentId'] = this.parentId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
import 'package:akuCommunity/constants/api.dart';
|
||||||
|
import 'package:akuCommunity/utils/headers.dart';
|
||||||
|
import 'package:akuCommunity/utils/network/base_model.dart';
|
||||||
|
import 'package:akuCommunity/utils/network/net_util.dart';
|
||||||
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||||
|
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class AdviceAddCommentPage extends StatefulWidget {
|
||||||
|
final int id;
|
||||||
|
AdviceAddCommentPage({Key key, @required this.id}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AdviceAddCommentPageState createState() => _AdviceAddCommentPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdviceAddCommentPageState extends State<AdviceAddCommentPage> {
|
||||||
|
TextEditingController _textEditingController = TextEditingController();
|
||||||
|
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_textEditingController?.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeScaffold(
|
||||||
|
title: '继续回复',
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.all(32.w),
|
||||||
|
children: [
|
||||||
|
'请输入内容'.text.size(28.sp).make(),
|
||||||
|
24.hb,
|
||||||
|
Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: TextFormField(
|
||||||
|
controller: _textEditingController,
|
||||||
|
validator: (text) {
|
||||||
|
if (TextUtil.isEmpty(text)) return '内容不能为空';
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
minLines: 7,
|
||||||
|
maxLines: 99,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFFD4CFBE),
|
||||||
|
width: 1.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
vertical: 32.w,
|
||||||
|
horizontal: 22.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bottomNavi: BottomButton(
|
||||||
|
onPressed: () async {
|
||||||
|
if (_formKey.currentState.validate()) {
|
||||||
|
BaseModel baseModel = await NetUtil().post(
|
||||||
|
API.manager.adviceQuestion,
|
||||||
|
params: {
|
||||||
|
'adviceId': widget.id,
|
||||||
|
'content': _textEditingController.text,
|
||||||
|
'parentId': 0,
|
||||||
|
},
|
||||||
|
showMessage: true,
|
||||||
|
);
|
||||||
|
if (baseModel.status) {
|
||||||
|
Get.back(result: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: '提交'.text.bold.make(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,191 @@
|
|||||||
|
import 'package:akuCommunity/base/base_style.dart';
|
||||||
|
import 'package:akuCommunity/constants/api.dart';
|
||||||
|
import 'package:akuCommunity/model/manager/advice_detail_model.dart';
|
||||||
|
import 'package:akuCommunity/model/manager/suggestion_or_complain_model.dart';
|
||||||
|
import 'package:akuCommunity/ui/manager/advice/advice_add_comment_page.dart';
|
||||||
|
import 'package:akuCommunity/utils/network/net_util.dart';
|
||||||
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||||
|
import 'package:akuCommunity/utils/headers.dart';
|
||||||
|
import 'package:akuCommunity/widget/buttons/bottom_button.dart';
|
||||||
|
import 'package:akuCommunity/widget/views/bee_grid_image_view.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
|
import 'package:get/get.dart' hide Response;
|
||||||
|
import 'package:shimmer/shimmer.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class AdviceDetailPage extends StatefulWidget {
|
||||||
|
final SuggestionOrComplainModel model;
|
||||||
|
AdviceDetailPage({Key key, @required this.model}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AdviceDetailPageState createState() => _AdviceDetailPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdviceDetailPageState extends State<AdviceDetailPage> {
|
||||||
|
bool _loading = true;
|
||||||
|
EasyRefreshController _refreshController = EasyRefreshController();
|
||||||
|
AdviceDetailModel _model;
|
||||||
|
String get adviceValue {
|
||||||
|
switch (widget.model.type) {
|
||||||
|
case 1:
|
||||||
|
return '咨询';
|
||||||
|
case 2:
|
||||||
|
return '建议';
|
||||||
|
case 3:
|
||||||
|
return '投诉';
|
||||||
|
case 4:
|
||||||
|
return '表扬';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildShimmer() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(32.w),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Shimmer.fromColors(
|
||||||
|
baseColor: Colors.black12,
|
||||||
|
highlightColor: Colors.white10,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
VxBox().height(53.w).width(152.w).color(Colors.white).make(),
|
||||||
|
30.hb,
|
||||||
|
VxBox().height(40.w).width(600.w).color(Colors.white).make(),
|
||||||
|
24.hb,
|
||||||
|
VxBox().height(33.w).width(263.w).color(Colors.white).make(),
|
||||||
|
50.hb,
|
||||||
|
VxBox().height(53.w).width(152.w).color(Colors.white).make(),
|
||||||
|
30.hb,
|
||||||
|
VxBox().height(40.w).width(600.w).color(Colors.white).make(),
|
||||||
|
24.hb,
|
||||||
|
VxBox().height(33.w).width(263.w).color(Colors.white).make(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 50.w,
|
||||||
|
thickness: 1.w,
|
||||||
|
color: Color(0xFFD8D8D8),
|
||||||
|
),
|
||||||
|
BeeGridImageView(
|
||||||
|
urls: widget.model.imgUrls.map((e) => e.url).toList(),
|
||||||
|
padding: EdgeInsets.only(right: 100.w),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildAdviceContent(AppAdviceContentVos item) {
|
||||||
|
String type = '';
|
||||||
|
switch (item.createUserType) {
|
||||||
|
case 1:
|
||||||
|
type = '您';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
type = '装修公司';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
type = '物业';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
'$type\的回复'.text.size(38.sp).bold.make(),
|
||||||
|
28.hb,
|
||||||
|
item.content.text.size(28.sp).color(ktextSubColor).make(),
|
||||||
|
24.hb,
|
||||||
|
DateUtil.formatDate(item.date, format: 'yyyy年MM月dd日 HH:mm')
|
||||||
|
.text
|
||||||
|
.size(24.sp)
|
||||||
|
.color(Color(0xFF999999))
|
||||||
|
.make(),
|
||||||
|
50.hb,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildChild() {
|
||||||
|
return ListView(
|
||||||
|
padding: EdgeInsets.all(32.w),
|
||||||
|
children: [
|
||||||
|
'您的$adviceValue'.text.black.bold.size(38.sp).make(),
|
||||||
|
30.hb,
|
||||||
|
_model.appAdviceDetailVo.appAdviceVo.content.text
|
||||||
|
.color(ktextSubColor)
|
||||||
|
.size(28.sp)
|
||||||
|
.make(),
|
||||||
|
24.hb,
|
||||||
|
DateUtil.formatDate(
|
||||||
|
_model.appAdviceDetailVo.appAdviceVo.date,
|
||||||
|
format: 'yyyy年MM月dd日 HH:mm',
|
||||||
|
).text.size(24.sp).color(Color(0xFF999999)).make(),
|
||||||
|
Divider(
|
||||||
|
height: 50.w,
|
||||||
|
thickness: 1.w,
|
||||||
|
color: Color(0xFFD8D8D8),
|
||||||
|
),
|
||||||
|
BeeGridImageView(
|
||||||
|
urls: widget.model.imgUrls.map((e) => e.url).toList(),
|
||||||
|
padding: EdgeInsets.only(right: 100.w),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 50.w,
|
||||||
|
thickness: 1.w,
|
||||||
|
color: Color(0xFFD8D8D8),
|
||||||
|
),
|
||||||
|
..._model.appAdviceDetailVo.appAdviceContentVos
|
||||||
|
.map((e) => _buildAdviceContent(e))
|
||||||
|
.toList(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_refreshController?.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeScaffold(
|
||||||
|
title: '查看详情',
|
||||||
|
actions: [
|
||||||
|
FlatButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: '评价'.text.make(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
body: EasyRefresh(
|
||||||
|
firstRefresh: true,
|
||||||
|
child: _loading ? _buildShimmer() : _buildChild(),
|
||||||
|
controller: _refreshController,
|
||||||
|
header: MaterialHeader(),
|
||||||
|
onRefresh: () async {
|
||||||
|
Response res = await NetUtil().dio.get(
|
||||||
|
API.manager.adviceDetail,
|
||||||
|
queryParameters: {'adviceId': widget.model.id},
|
||||||
|
);
|
||||||
|
_model = AdviceDetailModel.fromJson(res.data);
|
||||||
|
_loading = false;
|
||||||
|
if (mounted) setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
bottomNavi: BottomButton(
|
||||||
|
onPressed: () async {
|
||||||
|
bool result = await Get.to(AdviceAddCommentPage(id: widget.model.id));
|
||||||
|
if (result && mounted) _refreshController.callRefresh();
|
||||||
|
},
|
||||||
|
child: '继续提问'.text.bold.make(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,43 +0,0 @@
|
|||||||
import 'package:akuCommunity/constants/api.dart';
|
|
||||||
import 'package:akuCommunity/utils/headers.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/rendering.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:akuCommunity/const/resource.dart';
|
|
||||||
|
|
||||||
class HorizontalImageView extends StatefulWidget {
|
|
||||||
final List<String> urls;
|
|
||||||
HorizontalImageView(
|
|
||||||
this.urls, {
|
|
||||||
Key key,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_HorizontalImageViewState createState() => _HorizontalImageViewState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _HorizontalImageViewState extends State<HorizontalImageView> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
if (widget.urls.isEmpty) return 15.hb;
|
|
||||||
return Container(
|
|
||||||
height: 184.w + 24.w,
|
|
||||||
child: ListView.builder(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.all(16.w),
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(8.w),
|
|
||||||
child: FadeInImage.assetNetwork(
|
|
||||||
placeholder: R.ASSETS_ICONS_PROPOSAL_PNG,
|
|
||||||
image: API.image(widget.urls[index]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
itemCount: widget.urls.length,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,54 @@
|
|||||||
|
import 'package:akuCommunity/const/resource.dart';
|
||||||
|
import 'package:akuCommunity/constants/api.dart';
|
||||||
|
import 'package:akuCommunity/utils/headers.dart';
|
||||||
|
import 'package:akuCommunity/widget/picker/bee_image_preview.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class BeeGridImageView extends StatelessWidget {
|
||||||
|
final List<String> urls;
|
||||||
|
final EdgeInsetsGeometry padding;
|
||||||
|
const BeeGridImageView({
|
||||||
|
Key key,
|
||||||
|
@required this.urls,
|
||||||
|
this.padding = EdgeInsets.zero,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GridView.builder(
|
||||||
|
padding: padding,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 3,
|
||||||
|
crossAxisSpacing: 16.w,
|
||||||
|
mainAxisSpacing: 16.w,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.to(
|
||||||
|
BeeImagePreview.path(path: urls[index]),
|
||||||
|
opaque: false,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Hero(
|
||||||
|
tag: urls[index],
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
child: FadeInImage.assetNetwork(
|
||||||
|
height: 184.w,
|
||||||
|
width: 184.w,
|
||||||
|
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||||
|
image: API.image(urls[index]),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: urls.length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
import 'package:akuCommunity/constants/api.dart';
|
||||||
|
import 'package:akuCommunity/utils/headers.dart';
|
||||||
|
import 'package:akuCommunity/widget/picker/bee_image_preview.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/rendering.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:akuCommunity/const/resource.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class HorizontalImageView extends StatelessWidget {
|
||||||
|
final List<String> urls;
|
||||||
|
HorizontalImageView(
|
||||||
|
this.urls, {
|
||||||
|
Key key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (urls.isEmpty) return 15.hb;
|
||||||
|
return Container(
|
||||||
|
height: 184.w + 32.w,
|
||||||
|
child: ListView.separated(
|
||||||
|
padding: EdgeInsets.all(16.w),
|
||||||
|
separatorBuilder: (_, __) => 16.wb,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.to(
|
||||||
|
BeeImagePreview.path(path: urls[index]),
|
||||||
|
opaque: false,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Hero(
|
||||||
|
tag: urls[index],
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
child: FadeInImage.assetNetwork(
|
||||||
|
height: 184.w,
|
||||||
|
width: 184.w,
|
||||||
|
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
|
||||||
|
image: API.image(urls[index]),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: urls.length,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue