|
...
|
...
|
@@ -205,6 +205,75 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { |
|
|
|
Utils.setBarStatus(true, color: Colors.white);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> imagesWidgets() {
|
|
|
|
List<Widget> images = [];
|
|
|
|
for (int i = 0; i < marketingCenterProvider.templeteDatas.length; i++) {
|
|
|
|
SellerTemplateColorListSunModel themeSunModel =
|
|
|
|
marketingCenterProvider.templeteDatas[i];
|
|
|
|
images.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// _selectTheme(themeDatas[themeColor].urls[index].id);
|
|
|
|
//跳转到下一页
|
|
|
|
NavigatorUtil.goInvitationThemeHomePreviewPage(
|
|
|
|
context, themeSunModel);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: (ScreenUtil().screenWidth - w(32) - w(15)) / 2,
|
|
|
|
// height: w(390),
|
|
|
|
margin: EdgeInsets.only(right: i % 2 == 0 ? w(15) : 0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
border: Border.all(
|
|
|
|
color: themeType == themeSunModel.id
|
|
|
|
? MyColours.color_005AA7
|
|
|
|
: MyColours.color_DBDBDB,
|
|
|
|
width: themeType == themeSunModel.id ? w(2) : w(1))),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
// VEmptyView(10),
|
|
|
|
ClipRRect(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(r(8)),
|
|
|
|
topRight: Radius.circular(r(8))),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: themeSunModel.colors == null ||
|
|
|
|
themeSunModel.colors.length == 0
|
|
|
|
? themeSunModel.url
|
|
|
|
: themeSunModel
|
|
|
|
.colors[themeColor == null
|
|
|
|
? 0
|
|
|
|
: themeSunModel.colors.indexWhere((element) =>
|
|
|
|
element.colorName ==
|
|
|
|
themeSunModel.themeColorDefault)]
|
|
|
|
.url,
|
|
|
|
width: (ScreenUtil().screenWidth - w(32) - w(15)) / 2,
|
|
|
|
height: w(348),
|
|
|
|
fit: BoxFit.fitWidth,
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: w(7), horizontal: w(3)),
|
|
|
|
width: double.infinity,
|
|
|
|
child: Text(
|
|
|
|
themeSunModel.templateName,
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000, fontSize: font(14)),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
marketingCenterProvider.templeteDatas.forEach((themeSunModel) {});
|
|
|
|
return images;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
marketingCenterProvider =
|
|
...
|
...
|
@@ -229,84 +298,94 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> { |
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(24),
|
|
|
|
GridView.builder(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
controller: controller,
|
|
|
|
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: marketingCenterProvider.templeteDatas.length,
|
|
|
|
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
//横轴元素个数
|
|
|
|
crossAxisCount: 2,
|
|
|
|
//纵轴间距
|
|
|
|
mainAxisSpacing: w(15),
|
|
|
|
//横轴间距
|
|
|
|
crossAxisSpacing: w(15),
|
|
|
|
//子组件宽高长度比例
|
|
|
|
childAspectRatio:
|
|
|
|
(ScreenUtil().screenWidth - w(62)) / 2 / 370),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
SellerTemplateColorListSunModel themeSunModel =
|
|
|
|
marketingCenterProvider.templeteDatas[index];
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// _selectTheme(themeDatas[themeColor].urls[index].id);
|
|
|
|
//跳转到下一页
|
|
|
|
NavigatorUtil.goInvitationThemeHomePreviewPage(
|
|
|
|
context, themeSunModel);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
border: Border.all(
|
|
|
|
color: themeType == themeSunModel.id
|
|
|
|
? MyColours.color_005AA7
|
|
|
|
: MyColours.color_DBDBDB,
|
|
|
|
width: themeType == themeSunModel.id
|
|
|
|
? w(2)
|
|
|
|
: w(1))),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(10),
|
|
|
|
CachedNetworkImage(
|
|
|
|
imageUrl: themeSunModel.colors == null ||
|
|
|
|
themeSunModel.colors.length == 0
|
|
|
|
? themeSunModel.url
|
|
|
|
: themeSunModel
|
|
|
|
.colors[themeColor == null
|
|
|
|
? 0
|
|
|
|
: themeSunModel.colors
|
|
|
|
.indexWhere((element) =>
|
|
|
|
element.colorName ==
|
|
|
|
themeSunModel
|
|
|
|
.themeColorDefault)]
|
|
|
|
.url,
|
|
|
|
width:
|
|
|
|
(ScreenUtil().screenWidth - w(62)) / 2,
|
|
|
|
height: w(348),
|
|
|
|
fit: BoxFit.fitWidth,
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: w(6), horizontal: w(2)),
|
|
|
|
width: double.infinity,
|
|
|
|
child: Text(
|
|
|
|
themeSunModel.templateName,
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_000000,
|
|
|
|
fontSize: font(14)),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
child: Wrap(
|
|
|
|
runSpacing: w(15),
|
|
|
|
// spacing: w(15),
|
|
|
|
children: imagesWidgets(),
|
|
|
|
)),
|
|
|
|
VEmptyView(24),
|
|
|
|
// GridView.builder(
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
// controller: controller,
|
|
|
|
// // padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
|
|
|
|
// shrinkWrap: true,
|
|
|
|
// itemCount: marketingCenterProvider.templeteDatas.length,
|
|
|
|
// //SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
|
|
|
|
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
// //横轴元素个数
|
|
|
|
// crossAxisCount: 2,
|
|
|
|
// //纵轴间距
|
|
|
|
// mainAxisSpacing: w(15),
|
|
|
|
// //横轴间距
|
|
|
|
// crossAxisSpacing: w(15),
|
|
|
|
// //子组件宽高长度比例
|
|
|
|
// // childAspectRatio:
|
|
|
|
// // (ScreenUtil().screenWidth - w(62)) / 2 / 370
|
|
|
|
// ),
|
|
|
|
// itemBuilder: (BuildContext context, int index) {
|
|
|
|
// SellerTemplateColorListSunModel themeSunModel =
|
|
|
|
// marketingCenterProvider.templeteDatas[index];
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// // _selectTheme(themeDatas[themeColor].urls[index].id);
|
|
|
|
// //跳转到下一页
|
|
|
|
// NavigatorUtil.goInvitationThemeHomePreviewPage(
|
|
|
|
// context, themeSunModel);
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// height: w(385),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
// border: Border.all(
|
|
|
|
// color: themeType == themeSunModel.id
|
|
|
|
// ? MyColours.color_005AA7
|
|
|
|
// : MyColours.color_DBDBDB,
|
|
|
|
// width: themeType == themeSunModel.id
|
|
|
|
// ? w(2)
|
|
|
|
// : w(1))),
|
|
|
|
// child: Column(
|
|
|
|
// children: [
|
|
|
|
// VEmptyView(10),
|
|
|
|
// CachedNetworkImage(
|
|
|
|
// imageUrl: themeSunModel.colors == null ||
|
|
|
|
// themeSunModel.colors.length == 0
|
|
|
|
// ? themeSunModel.url
|
|
|
|
// : themeSunModel
|
|
|
|
// .colors[themeColor == null
|
|
|
|
// ? 0
|
|
|
|
// : themeSunModel.colors
|
|
|
|
// .indexWhere((element) =>
|
|
|
|
// element.colorName ==
|
|
|
|
// themeSunModel
|
|
|
|
// .themeColorDefault)]
|
|
|
|
// .url,
|
|
|
|
// width:
|
|
|
|
// (ScreenUtil().screenWidth - w(62)) / 2,
|
|
|
|
// height: w(348),
|
|
|
|
// fit: BoxFit.fitWidth,
|
|
|
|
// alignment: Alignment.topCenter,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(20),
|
|
|
|
// Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// vertical: w(6), horizontal: w(2)),
|
|
|
|
// width: double.infinity,
|
|
|
|
// child: Text(
|
|
|
|
// themeSunModel.templateName,
|
|
|
|
// maxLines: 1,
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
// textAlign: TextAlign.left,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_000000,
|
|
|
|
// fontSize: font(14)),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// }),
|
|
|
|
],
|
|
|
|
)))
|
|
|
|
],
|
...
|
...
|
|