build method

  1. @override
Widget build(
  1. BuildContext context,
  2. SocketBuilder model
)
override

Builds the UI according to the state in model.

Implementation

@override
Widget build(BuildContext context, SocketBuilder model) => Row(
    children: [
      const SizedBox(width: 16),
      Expanded(flex: 5, child: Text(name)),
      const Spacer(),
      Expanded(child: TextField(
        onChanged: model.address.update,
        controller: model.address.controller,
        decoration: InputDecoration(errorText: model.address.error),
        inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r"\d|\."))],
      ),),
      const SizedBox(width: 12),
      if (editPort) ...[
        Expanded(child: TextField(
          onChanged: model.port.update,
          controller: model.port.controller,
          decoration: InputDecoration(errorText: model.port.error),
          inputFormatters: [FilteringTextInputFormatter.allow(RegExp(r"\d"))],
        ),),
      ] else const Spacer(),
    ],
);