add update shipments

This commit is contained in:
Sai Naw Wun
2020-10-18 02:38:46 +06:30
parent fa9738f307
commit 4f8bde40b0
37 changed files with 596 additions and 455 deletions

View File

@@ -7,14 +7,22 @@ class LocalRadioButtons<T> extends StatelessWidget {
final IconData iconData;
final T selectedValue;
final List<T> values;
final bool readOnly;
final bool hideUnselected;
const LocalRadioButtons(
{Key key, this.callback, this.iconData, this.selectedValue, this.values})
{Key key,
this.callback,
this.iconData,
this.selectedValue,
this.values,
this.readOnly = false,
this.hideUnselected = true})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(children: getChildren());
return Column(children: readOnly ? getReadonlyChildren() : getChildren());
}
List<Widget> getChildren() {
@@ -38,4 +46,28 @@ class LocalRadioButtons<T> extends StatelessWidget {
)))
.toList();
}
List<Widget> getReadonlyChildren() {
return values
.toList()
.map((e) => hideUnselected && e == selectedValue
? SizedBox(
height: 30,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
e == selectedValue ? Icons.check : Icons.remove,
color:
e == selectedValue ? primaryColor : Colors.grey,
),
),
Text(e.toString()),
]),
)
: Container())
.toList();
}
}