|
|
@@ -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: <Widget>[ |
|
|
|
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: <Widget>[ |
|
|
|
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: <Widget>[ |
|
|
|
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: <Widget>[ |
|
|
|
// 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: <Widget>[ |
|
|
|
// 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: <Widget>[ |
|
|
|
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)), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|