build method
- @override
- BuildContext context,
- RockModel model
override
Builds the UI according to the state in model
.
Implementation
@override
Widget build(BuildContext context, RockModel model) => ListView(
shrinkWrap: true,
children: [
Row(
children: [
Text(
"Rocks & Minerals",
style: context.textTheme.headlineMedium,
),
const Spacer(),
ViewsSelector(index: index),
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: SearchBar(
hintText: "Search for a rock or characteristic",
hintStyle: WidgetStatePropertyAll(context.textTheme.bodyMedium),
controller: model.controller,
onChanged: model.search,
),
),
for (final rock in model.filteredRocks)
RockWidget(rock),
],
);