build method

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

Builds the UI according to the state in model.

Implementation

@override
Widget build(BuildContext context, MobileControlsModel model) => Row(
  children: [
    const SizedBox(width: 24),
    RotatedBox(
      quarterTurns: 3,
      child: SliderTheme(
        data: const SliderThemeData(
          trackHeight: 48,
          thumbShape: RoundSliderThumbShape(enabledThumbRadius: 36),
        ),
        child: Slider(
          onChanged: model.updateLeft,
          onChangeEnd: (_) => model.updateLeft(0),
          value: model.left,
          min: -1,
          label: model.left.toString(),
        ),
      ),
    ),
    const Spacer(),
    RotatedBox(
      quarterTurns: 3,
      child: SliderTheme(
        data: const SliderThemeData(
          trackHeight: 48,
          thumbShape: RoundSliderThumbShape(enabledThumbRadius: 36),
        ),
        child: Slider(
          onChanged: model.updateRight,
          onChangeEnd: (_) => model.updateRight(0),
          value: model.right,
          min: -1,
          label: model.right.toString(),
        ),
      ),
    ),
    const SizedBox(width: 24),
  ],
);