|
|
|
|
@ -7,8 +7,9 @@ class SingleStatusMenu extends StatefulWidget {
|
|
|
|
|
final List<Lookup> statuses;
|
|
|
|
|
final Lookup initialStatus;
|
|
|
|
|
final Function(Lookup) onSelect;
|
|
|
|
|
final bool enabled;
|
|
|
|
|
|
|
|
|
|
const SingleStatusMenu({Key key, this.statuses, this.onSelect, this.initialStatus}) : super(key: key);
|
|
|
|
|
const SingleStatusMenu({Key key, this.enabled = true, this.statuses, this.onSelect, this.initialStatus}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_SingleStatusMenuState createState() => _SingleStatusMenuState();
|
|
|
|
|
@ -82,20 +83,22 @@ class _SingleStatusMenuState extends State<SingleStatusMenu> {
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
),
|
|
|
|
|
style: TextStyle(color: Theme.of(context).primaryColor),
|
|
|
|
|
underline: SizedBox.shrink(),
|
|
|
|
|
onChanged: (Lookup newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedStatus = newValue;
|
|
|
|
|
});
|
|
|
|
|
widget.onSelect(newValue);
|
|
|
|
|
},
|
|
|
|
|
underline: const SizedBox.shrink(),
|
|
|
|
|
onChanged: widget.enabled == false
|
|
|
|
|
? null
|
|
|
|
|
: (Lookup newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedStatus = newValue;
|
|
|
|
|
});
|
|
|
|
|
widget.onSelect(newValue);
|
|
|
|
|
},
|
|
|
|
|
items: widget.statuses.map<DropdownMenuItem<Lookup>>((Lookup value) {
|
|
|
|
|
return DropdownMenuItem<Lookup>(
|
|
|
|
|
value: value,
|
|
|
|
|
child: Text(
|
|
|
|
|
value.name,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
color: widget.enabled ? Theme.of(context).primaryColor : Colors.grey,
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
//fontWeight: FontWeight.bold
|
|
|
|
|
),
|
|
|
|
|
|