diff --git a/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart b/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart index 791f8e6..1edc153 100644 --- a/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart +++ b/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart @@ -57,6 +57,8 @@ class _GoodsShareImageState extends State { imgCheckSelected: _style.cssList.chooseImage, child: GoodsShareEdit( _content, + imgCheck: _style.cssList.unChooseImage, + imgCheckSelected: _style.cssList.chooseImage, onCopyClick: () { Clipboard.setData(ClipboardData(text: _content)); Fluttertoast.showToast(msg: '文案已复制'); diff --git a/lib/pages/goods_share_page/widgets/goods_share_edit.dart b/lib/pages/goods_share_page/widgets/goods_share_edit.dart index 7bf0526..523686c 100644 --- a/lib/pages/goods_share_page/widgets/goods_share_edit.dart +++ b/lib/pages/goods_share_page/widgets/goods_share_edit.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; class GoodsShareEdit extends StatelessWidget { @@ -5,11 +6,19 @@ class GoodsShareEdit extends StatelessWidget { final VoidCallback onEditorClick; final VoidCallback onCopyClick; - // final String imgCheck; - // final String imgCheckSelected; + final String imgCheck; + final String imgCheckSelected; + final String imgEdit; + final String imgCopy; const GoodsShareEdit(this.message, - {Key key, this.onEditorClick, this.onCopyClick}) + {Key key, + this.onEditorClick, + this.onCopyClick, + this.imgCheck, + this.imgCheckSelected, + this.imgEdit, + this.imgCopy}) : super(key: key); @override @@ -23,7 +32,8 @@ class GoodsShareEdit extends StatelessWidget { child: Column( children: [ Padding( - padding: const EdgeInsets.only(left: 16, top: 10, right: 16), + padding: + const EdgeInsets.only(left: 16, top: 10, right: 16, bottom: 10), child: Text( message, style: TextStyle( @@ -32,74 +42,82 @@ class GoodsShareEdit extends StatelessWidget { ), ), ), - Container( - padding: - const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16), - width: double.infinity, - child: Wrap( - spacing: 10, - runSpacing: 6, - children: [ - GoodsShareCheckButton( - '标题', - isSelected: true, - ), - GoodsShareCheckButton( - '收益', - isSelected: false, - ), - GoodsShareCheckButton( - '邀请码', - isSelected: true, - ), - GoodsShareCheckButton( - '链接', - isSelected: true, - ), - ], - ), - ), - Container( - width: double.infinity, - height: 0.5, - color: Color(0xffececec), - ), - Container( - height: 44, - child: Row( - children: [ - Expanded( - child: GestureDetector( - child: Container( - color: Colors.transparent, - child: GoodsShareCheckButton( - '编辑模版', - isSelected: true, - ), - ), - onTap: onEditorClick, - ), - ), - Container( - width: 0.5, - height: 20, - color: Color(0xffececec), - ), - Expanded( - child: GestureDetector( - child: Container( - color: Colors.transparent, - child: GoodsShareCheckButton( - '复制文案', - isSelected: false, - ), - ), - onTap: onCopyClick, - ), - ), - ], - ), - ) + // Container( + // padding: + // const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16), + // width: double.infinity, + // child: Wrap( + // spacing: 10, + // runSpacing: 6, + // children: [ + // GoodsShareCheckButton( + // '标题', + // imgIcon: this.imgCheck, + // imgIconSelected: this.imgCheckSelected, + // isSelected: false, + // ), + // GoodsShareCheckButton( + // '收益', + // imgIcon: this.imgCheck, + // imgIconSelected: this.imgCheckSelected, + // isSelected: false, + // ), + // GoodsShareCheckButton( + // '邀请码', + // imgIcon: this.imgCheck, + // imgIconSelected: this.imgCheckSelected, + // isSelected: false, + // ), + // GoodsShareCheckButton( + // '链接', + // imgIcon: this.imgCheck, + // imgIconSelected: this.imgCheckSelected, + // isSelected: false, + // ), + // ], + // ), + // ), + // Container( + // width: double.infinity, + // height: 0.5, + // color: Color(0xffececec), + // ), + // Container( + // height: 44, + // child: Row( + // children: [ + // Expanded( + // child: GestureDetector( + // child: Container( + // color: Colors.transparent, + // child: GoodsShareCheckButton( + // '编辑模版', + // isSelected: true, + // ), + // ), + // onTap: onEditorClick, + // ), + // ), + // Container( + // width: 0.5, + // height: 20, + // color: Color(0xffececec), + // ), + // Expanded( + // child: GestureDetector( + // child: Container( + // color: Colors.transparent, + // child: GoodsShareCheckButton( + // '复制文案', + // isSelected: false, + // ), + // ), + // onTap: onCopyClick, + // ), + // ), + // ], + // ), + // ) ], ), ); @@ -109,8 +127,14 @@ class GoodsShareEdit extends StatelessWidget { class GoodsShareCheckButton extends StatelessWidget { final String title; final bool isSelected; + final String imgIcon; + final String imgIconSelected; - const GoodsShareCheckButton(this.title, {Key key, this.isSelected = true}) + const GoodsShareCheckButton(this.title, + {Key key, + this.isSelected = true, + this.imgIcon = '', + this.imgIconSelected = ''}) : super(key: key); @override @@ -118,20 +142,21 @@ class GoodsShareCheckButton extends StatelessWidget { return UnconstrainedBox( child: Row( children: [ - Container( - width: 16, - height: 16, - margin: EdgeInsets.only(right: 6), - decoration: BoxDecoration( - color: isSelected ? Colors.redAccent : Colors.black12, - borderRadius: BorderRadius.circular(8), - ), - ), + imgIcon == null || imgIcon == '' + ? Container() + : Container( + width: 16, + height: 16, + margin: EdgeInsets.only(right: 6), + child: CachedNetworkImage( + imageUrl: isSelected ? imgIconSelected : imgIcon, + ), + ), Text( title, style: TextStyle( fontSize: 11, - color: isSelected ? Colors.redAccent : Color(0xff333333)), + color: isSelected ? Color(0xffff4242) : Color(0xff333333)), ), ], ), diff --git a/lib/widgets/public/custom_button/custom_bottom.dart b/lib/widgets/public/custom_button/custom_bottom.dart index d20146c..eace6b0 100644 --- a/lib/widgets/public/custom_button/custom_bottom.dart +++ b/lib/widgets/public/custom_button/custom_bottom.dart @@ -31,6 +31,17 @@ class CustomButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ + style.smallIcon == null || style.smallIcon == '' + ? Container() + : Container( + width: 14, + height: 14, + margin: EdgeInsets.only(right: 4), + child: CachedNetworkImage( + imageUrl: style.smallIcon, + fit: BoxFit.cover, + ), + ), Text( style.name, style: TextStyle(