buildSelectorWidgets method

Widget buildSelectorWidgets(
  1. BuildContext context,
  2. ThemeCollection themeCollection
)

Implementation

Widget buildSelectorWidgets(
    BuildContext context, ThemeCollection themeCollection) {
  final themeInfo = Theme.of(context);

  return Row(
    key: const Key('ThemeColorSelectorWidget'),
    mainAxisAlignment: MainAxisAlignment.spaceEvenly,
    children: themeCollection.themes.entries.map<Widget>((theme) {
      return RawMaterialButton(
        onPressed: () {
          onThemeColorChanged(context, theme.key);
        },
        constraints: BoxConstraints.tightFor(
          width: selectorSize,
          height: selectorSize,
        ),
        fillColor: theme.value.colorScheme.primary,
        shape: CircleBorder(
          side: BorderSide(
            color: theme.key == selectedTheme
                ? (themeInfo.brightness == Brightness.light
                    ? Colors.black
                    : Colors.white)
                : Colors.grey,
            width: 3.0,
          ),
        ),
        child: Semantics(
          selected: theme.key == selectedTheme,
        ),
      );
    }).toList(),
  );
}