add shipments
This commit is contained in:
@@ -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(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user