buildIcon method

Widget buildIcon(
  1. BuildContext context,
  2. ThemeMode themeMode
)

Builds the icon that will be used to change the theme of the application. The icon will be either the light or dark icon depending on the themeMode parameter.

Implementation

Widget buildIcon(BuildContext context, ThemeMode themeMode) {
  final icon = themeMode == ThemeMode.light ? lightIconPath : darkIconPath;

  return GestureDetector(
    onTap: () => handleThemeSelectionChanged(context, themeMode),
    child: FastShadowLayout(
      child: FastImageAsset(
        height: iconHeight,
        path: icon,
      ),
    ),
  );
}