import 'package:fcs/helpers/theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class LocalRadioButtons extends StatelessWidget { final Function(T) callback; final IconData iconData; final T selectedValue; final List values; const LocalRadioButtons( {Key key, this.callback, this.iconData, this.selectedValue, this.values}) : super(key: key); @override Widget build(BuildContext context) { return Column(children: getChildren()); } List getChildren() { return values .toList() .map((e) => SizedBox( height: 30, child: InkWell( onTap: () => callback(e), child: Row(children: [ Radio( activeColor: primaryColor, groupValue: selectedValue, value: e, onChanged: (T value) { callback(value); }, ), Text(e.toString()), ]), ))) .toList(); } }