|
|
@@ -11,6 +11,7 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
final Map<String, dynamic> data; |
|
|
|
CustomBannerModel _model; |
|
|
|
|
|
|
|
|
|
|
|
CustomBannerWidget(this.data, {Key key}) : super(key: key) { |
|
|
|
try { |
|
|
|
_model = CustomBannerModel.fromJson(jsonDecode(data['data'])); |
|
|
@@ -97,6 +98,9 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
|
|
|
|
/// 左1右2 |
|
|
|
Widget _buildStyle3(BuildContext context, List<CustomBannerListStyle> listStyle) { |
|
|
|
const bool inProduction = const bool.fromEnvironment("dart.vm.product"); |
|
|
|
// if(!inProduction )return Container(); |
|
|
|
|
|
|
|
CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); |
|
|
|
CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); |
|
|
|
CustomBannerListStyle right2 = listStyle.firstWhere((element) => element.locationType == 'right2'); |
|
|
@@ -107,11 +111,15 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
Flexible(flex: 1, child: _buildSingleWidthWidget(context, left1)), |
|
|
|
Flexible( |
|
|
|
flex: 1, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), |
|
|
|
], |
|
|
|
child: Visibility( |
|
|
|
replacement: Container(), |
|
|
|
visible: inProduction, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
@@ -120,6 +128,10 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
|
|
|
|
/// 左2右1 |
|
|
|
Widget _buildStyle4(BuildContext context, List<CustomBannerListStyle> listStyle) { |
|
|
|
|
|
|
|
const bool inProduction = const bool.fromEnvironment("dart.vm.product"); |
|
|
|
// if(!inProduction )return Container(); |
|
|
|
|
|
|
|
CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); |
|
|
|
CustomBannerListStyle left2 = listStyle.firstWhere((element) => element.locationType == 'left2'); |
|
|
|
CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); |
|
|
@@ -128,11 +140,15 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
children: <Widget>[ |
|
|
|
Flexible( |
|
|
|
flex: 1, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left2), child: CachedNetworkImage(imageUrl: left2?.img ?? ''))), |
|
|
|
], |
|
|
|
child: Visibility( |
|
|
|
replacement: Container(), |
|
|
|
visible: inProduction, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left1), child: CachedNetworkImage(imageUrl: left1?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, left2), child: CachedNetworkImage(imageUrl: left2?.img ?? ''))), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
// Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), |
|
|
@@ -143,6 +159,10 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
|
|
|
|
/// 左1右3 |
|
|
|
Widget _buildStyle5(BuildContext context, List<CustomBannerListStyle> listStyle) { |
|
|
|
|
|
|
|
const bool inProduction = const bool.fromEnvironment("dart.vm.product"); |
|
|
|
// if(!inProduction )return Container(); |
|
|
|
|
|
|
|
CustomBannerListStyle left1 = listStyle.firstWhere((element) => element.locationType == 'left1'); |
|
|
|
CustomBannerListStyle right1 = listStyle.firstWhere((element) => element.locationType == 'right1'); |
|
|
|
CustomBannerListStyle right2 = listStyle.firstWhere((element) => element.locationType == 'right2'); |
|
|
@@ -155,16 +175,20 @@ class CustomBannerWidget extends StatelessWidget { |
|
|
|
Flexible(flex: 4, child: _buildSingleWidthWidget(context, left1)), |
|
|
|
Flexible( |
|
|
|
flex: 6, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), |
|
|
|
Row( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right3), child: CachedNetworkImage(imageUrl: right3?.img ?? ''))), |
|
|
|
], |
|
|
|
) |
|
|
|
], |
|
|
|
child: Visibility( |
|
|
|
replacement: Container(), |
|
|
|
visible: inProduction, |
|
|
|
child: Column( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right1), child: CachedNetworkImage(imageUrl: right1?.img ?? ''))), |
|
|
|
Row( |
|
|
|
children: <Widget>[ |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right2), child: CachedNetworkImage(imageUrl: right2?.img ?? ''))), |
|
|
|
Flexible(flex: 1, child: GestureDetector(onTap: () => _itemOnClick(context, right3), child: CachedNetworkImage(imageUrl: right3?.img ?? ''))), |
|
|
|
], |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|