123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/widgets/load_image.dart';
- class RadioItem extends StatelessWidget {
- const RadioItem({
- Key key,
- this.onTap,
- @required this.title,
- @required this.value,
- @required this.groupValue,
- }): super(key: key);
- final GestureTapCallback onTap;
- final String title;
- final String value;
- final String groupValue;
- @override
- Widget build(BuildContext context) {
- return InkWell(
- onTap: onTap,
- child: Container(
- padding: const EdgeInsets.only(left: 15),
- constraints: BoxConstraints(
- maxHeight: double.infinity,
- minHeight: 50.0
- ),
- width: double.infinity,
- decoration: BoxDecoration(
- color: Colors.white,
- border: Border(
- bottom: Divider.createBorderSide(context, width: 0.6),
- )
- ),
- child: Row(
- children: <Widget>[
- Expanded(
- flex: 1,
- child: Padding(
- padding: const EdgeInsets.only(right: 5.0),
- child: Text(title),
- ),
- ),
- value == groupValue
- ? LoadAssetImage(
- "icon_check_selected",
- width: 17,
- height: 17,
- )
- : LoadAssetImage(
- "icon_check_defult",
- width: 17,
- height: 17,
- ),
-
- SizedBox(width: 10,)
- // value == groupValue
- // ? Image.asset("(点击后的图片)", width: 15, height: 15)
- // : Image.asset("(未点击的图片)",width: 15, height: 15)
- // Radio(
- // value: value,
- // groupValue: groupValue,
- // activeColor: Colors.red,
- // focusColor:Colors.red,
- // // onChanged: (res){
- // // print("3333${res}");
- // // },
- // )
- ],
- ),
- ),
- );
- }
- }
|