add shipments

This commit is contained in:
Sai Naw Wun
2020-10-19 05:13:49 +06:30
parent 4f8bde40b0
commit c619ae3f22
57 changed files with 1886 additions and 724 deletions

View File

@@ -9,9 +9,17 @@ class LocalDropdown<T> extends StatelessWidget {
final IconData iconData;
final T selectedValue;
final List<T> values;
final Function(T) display;
final String labelKey;
const LocalDropdown(
{Key key, this.callback, this.iconData, this.selectedValue, this.values})
{Key key,
this.callback,
this.iconData,
this.selectedValue,
this.values,
this.labelKey,
this.display})
: super(key: key);
@override
@@ -32,7 +40,7 @@ class LocalDropdown<T> extends StatelessWidget {
padding: const EdgeInsets.only(right: 18.0),
child: LocalText(
context,
"shipment.type",
labelKey,
color: Colors.black54,
fontSize: 16,
),
@@ -49,14 +57,21 @@ class LocalDropdown<T> extends StatelessWidget {
callback(newValue);
},
isExpanded: true,
items: values.map<DropdownMenuItem<T>>((T value) {
return DropdownMenuItem<T>(
value: value,
child: Text(value==null? "":value.toString(),
overflow: TextOverflow.ellipsis,
style: TextStyle(color: primaryColor)),
);
}).toList(),
items: values == null
? []
: values.map<DropdownMenuItem<T>>((T value) {
return DropdownMenuItem<T>(
value: value,
child: Text(
value == null
? ""
: display != null
? display(value)
: value.toString(),
overflow: TextOverflow.ellipsis,
style: TextStyle(color: primaryColor)),
);
}).toList(),
),
],
),