build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Build the widget.

Implementation

@override
Widget build(final BuildContext context) => GameShortcuts(
      shortcuts: areaShortcuts.entries.map((final entry) {
        final shortcut = entry.key;
        final point = entry.value;
        return GameShortcut(
          title: areaDescriptions[point] ?? '${point.x}, ${point.y}',
          shortcut: shortcut,
          onStart: (final innerContext) =>
              onTouch(point, TouchAreaEvent.touch),
          onStop: (final innerContext) =>
              onTouch(point, TouchAreaEvent.release),
        );
      }).toList(),
      child: PopScope(
        canPop: canPop,
        child: Material(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              for (var y = 0; y < rows; y++)
                Expanded(
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      for (var x = 0; x < columns; x++)
                        TouchArea(
                          description:
                              areaDescriptions[Point(x, y)] ?? '$x, $y',
                          onTouch: (final event) {
                            final point = Point(x, y);
                            onTouch(point, event);
                          },
                          child: childBuilder?.call(context, Point(x, y)),
                        ),
                    ],
                  ),
                ),
            ],
          ),
        ),
      ),
    );