12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/res/resources.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- class OptionsItem extends StatelessWidget {
- const OptionsItem({
- Key key,
- this.onTap,
- @required this.title,
- this.content: "",
- this.isEdit: false,
- this.value: -1,
- }) : super(key: key);
- final Function onTap;
- final String title;
- final String content;
- final bool isEdit;
- final int value; //-1未选 0 不需要 1勾 2叉
- @override
- Widget build(BuildContext context) {
- return InkWell(
- child: Container(
- padding: const EdgeInsets.fromLTRB(15, 15.0, 15.0, 15.0),
- constraints:
- BoxConstraints(maxHeight: double.infinity, minHeight: 50.0),
- width: double.infinity,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(6),
- ),
- child: Row(
- //为了数字类文字居中
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Expanded(
- flex: 1,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- Text(
- "${title}",
- style: TextStyle(fontSize: 15, color: Color(0xFF333333)),
- ),
- Text(content,
- maxLines: 5,
- textAlign: TextAlign.left,
- overflow: TextOverflow.visible,
- style: TextStyle(
- fontSize: 13, color: Colours.dark_text_gray))
- ],
- )),
- Row(
- children: <Widget>[
- GestureDetector(
- onTap: () {
- onTap(1);
- },
- child: LoadAssetImage("icon_gou_${value==1?"s":"n"}"),
- ),
- SizedBox(width: 10),
- GestureDetector(
- onTap: () {
- onTap(2);
- },
- child: LoadAssetImage("icon_cha_${value==2?"s":"n"}"),
- ),
- SizedBox(width: 10),
- GestureDetector(
- onTap: () {
- onTap(3);
- },
- child: LoadAssetImage("icon_no_${value==3?"s":"n"}"),
- ),
- ],
- )
- ],
- ),
- ),
- );
- }
- }
|