123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/utils/theme_utils.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) {
- bool isDark = ThemeUtils.isDark(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: isDark?Colors.black: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),
- ),
- ),
- Radio(
- value: value,
- groupValue: groupValue,
- activeColor: Colors.red,
- // onChanged: (res){
- // print("3333${res}");
- // },
- )
- ],
- ),
- ),
- );
- }
- }
|