|
...
|
...
|
@@ -5,15 +5,15 @@ import 'package:one_key/res/colors.dart'; |
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
class NeedItem extends StatefulWidget{
|
|
|
|
|
|
|
|
class NeedItem extends StatefulWidget {
|
|
|
|
final t.Table table;
|
|
|
|
final bool canSelected;//是否能选中
|
|
|
|
final bool canSelected; //是否能选中
|
|
|
|
final ValueChanged onSelected;
|
|
|
|
|
|
|
|
final int height;//高度
|
|
|
|
final int height; //高度
|
|
|
|
|
|
|
|
NeedItem(this.table,{this.onSelected,this.canSelected=false,this.height=183});
|
|
|
|
NeedItem(this.table,
|
|
|
|
{this.onSelected, this.canSelected = false, this.height = 183});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
...
|
...
|
@@ -22,19 +22,18 @@ class NeedItem extends StatefulWidget{ |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class NeedItemState extends State<NeedItem>{
|
|
|
|
|
|
|
|
class NeedItemState extends State<NeedItem> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// TODO: implement build
|
|
|
|
|
|
|
|
t.Table table=widget.table;
|
|
|
|
t.Table table = widget.table;
|
|
|
|
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: (){
|
|
|
|
if(widget.canSelected&&table.signStr.isEmpty){
|
|
|
|
onTap: () {
|
|
|
|
if (widget.canSelected && table.signStr.isEmpty) {
|
|
|
|
setState(() {
|
|
|
|
table.selected=!(table.selected??false);
|
|
|
|
table.selected = !(table.selected ?? false);
|
|
|
|
});
|
|
|
|
widget.onSelected(table);
|
|
|
|
}
|
|
...
|
...
|
@@ -42,44 +41,68 @@ class NeedItemState extends State<NeedItem>{ |
|
|
|
child: Stack(
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(190),
|
|
|
|
height: ScreenUtil().setWidth(widget.height),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin:EdgeInsets.all( ScreenUtil().setWidth(9)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_a8e2e4,
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(8)))
|
|
|
|
),
|
|
|
|
child:Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Text(table.name,style: TextStyle(color: MyColours.color_131313,fontSize: ScreenUtil().setSp(30),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,),
|
|
|
|
Offstage(
|
|
|
|
offstage: table.maxText.isEmpty?true:false,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
VEmptyView(5),
|
|
|
|
Text(table.maxText,style: TextStyle(color: MyColours.color_777777,fontSize: ScreenUtil().setSp(26),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,),
|
|
|
|
],
|
|
|
|
width: ScreenUtil().setWidth(190),
|
|
|
|
height: ScreenUtil().setWidth(widget.height),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
margin: EdgeInsets.all(ScreenUtil().setWidth(9)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_a8e2e4,
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(8)))),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Text(
|
|
|
|
table.name,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_131313,
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
fontWeight: FontWeight.normal),
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: table.lowStr.isEmpty?true:false,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
VEmptyView(5),
|
|
|
|
Text(table.lowStr,style: TextStyle(color: MyColours.color_2bb5b7,fontSize: ScreenUtil().setSp(24),decoration: TextDecoration.none,fontWeight: FontWeight.normal),overflow: TextOverflow.ellipsis,)
|
|
|
|
],
|
|
|
|
Offstage(
|
|
|
|
offstage: table.maxText.isEmpty ? true : false,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
VEmptyView(5),
|
|
|
|
Text(
|
|
|
|
table.maxText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_777777,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
fontWeight: FontWeight.normal),
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: table.lowStr.isEmpty ? true : false,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
VEmptyView(5),
|
|
|
|
Text(
|
|
|
|
table.lowStr,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_2bb5b7,
|
|
|
|
fontSize: ScreenUtil().setSp(24),
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
fontWeight: FontWeight.normal),
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
|
|
\ No newline at end of file |
|
|
|
} |
...
|
...
|
|