build method
- @override
- BuildContext context,
- ViewsModel model
override
Builds the UI according to the state in model
.
Implementation
@override
Widget build(BuildContext context, ViewsModel model) => Row(
mainAxisSize: MainAxisSize.min,
children: [
const Text("Views:"),
const SizedBox(width: 4),
DropdownButton<int>(
value: model.views.length,
onChanged: model.setNumViews,
items: [
for (final option in [1, 2, 3, 4, 8]) DropdownMenuItem(
value: option,
child: Center(child: Text(option.toString())),
),
],
),
],
);