build method
- @override
- BuildContext context,
- NumberBuilder<
num> model
override
Builds the UI according to the state in model
.
Implementation
@override
Widget build(BuildContext context, NumberBuilder model) => Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
flex: titleFlex,
child: subtitle == null ? ListTile(title: Text(name)) : ListTile(
title: Text(name),
subtitle: Text(subtitle!),
),
),
if (width == null) const Spacer()
else SizedBox(width: width),
Expanded(child: TextField(
onChanged: model.update,
decoration: InputDecoration(errorText: model.error),
controller: model.controller,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r"\d|\.|-"))],
),),
],
);