toWidget method

  1. @override
Widget toWidget(
  1. BuildContext context
)
override

Return the associated Widget

Implementation

@override
Widget toWidget(BuildContext context) => DropdownMenuItem<String>(
    enabled: enabled,
    value: value,
    alignment: Alignment.centerLeft,
    child: icon == null
        ? Text(caption)
        : Row(children: [
            SizedBox(
                width: 24,
                height: 24,
                child: FittedBox(child: toIcon(icon!, size: 24)!)),
            Container(
              padding: const EdgeInsets.fromLTRB(10, 0, 0, 0),
              child: Text(caption),
            )
          ]));