diff --git a/lib/widgets/goods_details/footer/goods_details_footer_widget.dart b/lib/widgets/goods_details/footer/goods_details_footer_widget.dart index 3968c51..dcf400d 100644 --- a/lib/widgets/goods_details/footer/goods_details_footer_widget.dart +++ b/lib/widgets/goods_details/footer/goods_details_footer_widget.dart @@ -30,7 +30,8 @@ class GoodsDetailsFooterWidget extends StatelessWidget { visible: !EmptyUtil.isEmpty(model), replacement: GoodsDetailsFooterSkeleton(), child: BlocProvider( - create: (_) => GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), + create: (_) => + GoodsDetailsFooterBloc(repository: GoodsDetailsFooterRepository()), //..add(GoodsDetailsFooterInitEvent(model: model)), child: GooddsDetailsFooterContainer( model, @@ -47,16 +48,18 @@ class GooddsDetailsFooterContainer extends StatefulWidget { const GooddsDetailsFooterContainer(this.model, {Key key}) : super(key: key); @override - _GooddsDetailsFooterContainerState createState() => _GooddsDetailsFooterContainerState(); + _GooddsDetailsFooterContainerState createState() => + _GooddsDetailsFooterContainerState(); } -class _GooddsDetailsFooterContainerState extends State { - +class _GooddsDetailsFooterContainerState + extends State { UserInfoModel _user; @override void initState() { - BlocProvider.of(context).add(GoodsDetailsFooterInitEvent(model: widget?.model)); + BlocProvider.of(context) + .add(GoodsDetailsFooterInitEvent(model: widget?.model)); super.initState(); } @@ -64,7 +67,9 @@ class _GooddsDetailsFooterContainerState extends State PageFactory.create('homePage', null)), + CupertinoPageRoute( + builder: (BuildContext context) => + PageFactory.create('homePage', null)), (Route route) => false, ); } @@ -100,7 +105,8 @@ class _GooddsDetailsFooterContainerState extends State GoodsSharePage(widget.model))); + Navigator.of(context).push(CupertinoPageRoute( + builder: (context) => GoodsSharePage(widget.model))); } } @@ -170,7 +176,8 @@ class _GooddsDetailsFooterContainerState extends State 10 ? 0 : 8), top: 8, left: 21, right: 12.5), + padding: EdgeInsets.only( + bottom: (height > 10 ? 0 : 8), top: 8, left: 21, right: 12.5), decoration: BoxDecoration( // boxShadow: [ // BoxShadow(color: Colors.grey[300], offset: Offset(0.0, 0.0), blurRadius: 5.0, spreadRadius: 2.0), @@ -209,12 +216,18 @@ class _GooddsDetailsFooterContainerState extends State _openHome(), child: Padding( padding: const EdgeInsets.only(right: 35), - child: _getCustomWidget(model?.home ?? '首页', model?.home_color ?? '999999', model?.home_icon ?? ''), + child: _getCustomWidget(model?.home ?? '首页', + model?.home_color ?? '999999', model?.home_icon ?? ''), )), GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => _collectOnClick(), - child: Padding(padding: const EdgeInsets.only(right: 0), child: _getCustomWidget(model?.collect ?? '收藏', model?.collect_color ?? '999999', model?.collect_icon ?? ''))) + child: Padding( + padding: const EdgeInsets.only(right: 0), + child: _getCustomWidget( + model?.collect ?? '收藏', + model?.collect_color ?? '999999', + model?.collect_icon ?? ''))) ], ); } @@ -241,30 +254,40 @@ class _GooddsDetailsFooterContainerState extends State[ RichText( - text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.share_earn_val_color ?? 'FFFFFF')), children: [ - TextSpan( - text: model?.share_value ?? '0.0', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), - fontFamily: 'Din', - package: 'zhiying_base_widget')), - ]), + text: TextSpan( + text: '¥ ', + style: TextStyle( + fontSize: 12, + color: HexColor.fromHex( + model?.share_earn_val_color ?? 'FFFFFF')), + children: [ + TextSpan( + text: model?.share_value ?? '0.0', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + color: HexColor.fromHex( + model?.share_earn_color ?? '#FFFFFF'), + fontFamily: 'Din', + package: 'zhiying_base_widget')), + ]), ), Text( model?.share_earn ?? '分享赚', - style: TextStyle(color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), fontSize: 12), + style: TextStyle( + color: HexColor.fromHex(model?.share_earn_color ?? '#FFFFFF'), + fontSize: 12), ), ], ), @@ -283,29 +306,42 @@ class _GooddsDetailsFooterContainerState extends State[ RichText( - text: TextSpan(text: '¥ ', style: TextStyle(fontSize: 12, color: HexColor.fromHex(model?.save_earn_val_color ?? 'FFFFFF')), children: [ - TextSpan( - text: model?.slef_buy_value ?? '0.0', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: HexColor.fromHex(model?.save_earn_val_color ?? '#FFFFFF'), - fontFamily: 'Din', - package: 'zhiying_base_widget', - )), - ]), + text: TextSpan( + text: '¥ ', + style: TextStyle( + fontSize: 12, + color: HexColor.fromHex( + model?.save_earn_val_color ?? 'FFFFFF')), + children: [ + TextSpan( + text: model?.self_buy_value ?? '0.0', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + color: HexColor.fromHex( + model?.save_earn_val_color ?? '#FFFFFF'), + fontFamily: 'Din', + package: 'zhiying_base_widget', + )), + ]), ), - Text(model?.save_earn ?? '自购省', style: TextStyle(color: HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'), fontSize: 12)) + Text(model?.save_earn ?? '自购省', + style: TextStyle( + color: + HexColor.fromHex(model?.save_earn_color ?? '#FFFFFF'), + fontSize: 12)) ], ), ), @@ -328,7 +364,8 @@ class _GooddsDetailsFooterContainerState extends State json) { - return GoodsDetailsFooterModel( - collect: json['collect'], - collect_color: json['collect_color'], - collect_icon: json['collect_icon'], - home: json['home'], - home_color: json['home_color'], - home_icon: json['home_icon'], - save_earn: json['save_earn'], - save_earn_bg1_color: json['save_earn_bg1_color'], - save_earn_bg2_color: json['save_earn_bg2_color'], - save_earn_color: json['save_earn_color'], - save_earn_val_color: json['save_earn_val_color'], - share_earn: json['share_earn'], - share_earn_bg1_color: json['share_earn_bg1_color'], - share_earn_bg2_color: json['share_earn_bg2_color'], - share_earn_color: json['share_earn_color'], - share_earn_val_color: json['share_earn_val_color'], - share_value: json['share_value'], - slef_buy_value: json['slef_buy_value'], - ); - } + factory GoodsDetailsFooterModel.fromJson(Map json) { + return GoodsDetailsFooterModel( + collect: json['collect'], + collect_color: json['collect_color'], + collect_icon: json['collect_icon'], + home: json['home'], + home_color: json['home_color'], + home_icon: json['home_icon'], + save_earn: json['save_earn'], + save_earn_bg1_color: json['save_earn_bg1_color'], + save_earn_bg2_color: json['save_earn_bg2_color'], + save_earn_color: json['save_earn_color'], + save_earn_val_color: json['save_earn_val_color'], + share_earn: json['share_earn'], + share_earn_bg1_color: json['share_earn_bg1_color'], + share_earn_bg2_color: json['share_earn_bg2_color'], + share_earn_color: json['share_earn_color'], + share_earn_val_color: json['share_earn_val_color'], + share_value: json['share_value'], + self_buy_value: json['self_buy_value'], + ); + } - Map toJson() { - final Map data = new Map(); - data['collect'] = this.collect; - data['collect_color'] = this.collect_color; - data['collect_icon'] = this.collect_icon; - data['home'] = this.home; - data['home_color'] = this.home_color; - data['home_icon'] = this.home_icon; - data['save_earn'] = this.save_earn; - data['save_earn_bg1_color'] = this.save_earn_bg1_color; - data['save_earn_bg2_color'] = this.save_earn_bg2_color; - data['save_earn_color'] = this.save_earn_color; - data['save_earn_val_color'] = this.save_earn_val_color; - data['share_earn'] = this.share_earn; - data['share_earn_bg1_color'] = this.share_earn_bg1_color; - data['share_earn_bg2_color'] = this.share_earn_bg2_color; - data['share_earn_color'] = this.share_earn_color; - data['share_earn_val_color'] = this.share_earn_val_color; - data['share_value'] = this.share_value; - data['slef_buy_value'] = this.slef_buy_value; - return data; - } -} \ No newline at end of file + Map toJson() { + final Map data = new Map(); + data['collect'] = this.collect; + data['collect_color'] = this.collect_color; + data['collect_icon'] = this.collect_icon; + data['home'] = this.home; + data['home_color'] = this.home_color; + data['home_icon'] = this.home_icon; + data['save_earn'] = this.save_earn; + data['save_earn_bg1_color'] = this.save_earn_bg1_color; + data['save_earn_bg2_color'] = this.save_earn_bg2_color; + data['save_earn_color'] = this.save_earn_color; + data['save_earn_val_color'] = this.save_earn_val_color; + data['share_earn'] = this.share_earn; + data['share_earn_bg1_color'] = this.share_earn_bg1_color; + data['share_earn_bg2_color'] = this.share_earn_bg2_color; + data['share_earn_color'] = this.share_earn_color; + data['share_earn_val_color'] = this.share_earn_val_color; + data['share_value'] = this.share_value; + data['self_buy_value'] = this.self_buy_value; + return data; + } +}