getBody method Null safety

  1. @override
List getBody()

Implementation

@override
List<Widget> getBody() => <Widget>[
      Padding(
        padding: const EdgeInsets.symmetric(
          horizontal: LARGE_SPACE,
          vertical: MEDIUM_SPACE,
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text(
              appLocalizations.darkmode,
              style: themeData.textTheme.headline4,
            ),
            DropdownButton<String>(
              value: themeProvider.currentTheme,
              elevation: 16,
              onChanged: (String? newValue) {
                themeProvider.setTheme(newValue!);
              },
              items: <DropdownMenuItem<String>>[
                DropdownMenuItem<String>(
                  value: THEME_SYSTEM_DEFAULT,
                  child: Text(appLocalizations.darkmode_system_default),
                ),
                DropdownMenuItem<String>(
                  value: THEME_LIGHT,
                  child: Text(appLocalizations.darkmode_light),
                ),
                DropdownMenuItem<String>(
                  value: THEME_DARK,
                  child: Text(appLocalizations.darkmode_dark),
                )
              ],
            ),
          ],
        ),
      ),
      Padding(
        padding: const EdgeInsets.symmetric(horizontal: LARGE_SPACE),
        child: Text(
          appLocalizations.main_app_color,
          style: themeData.textTheme.headline4,
        ),
      ),
      Padding(
        padding: const EdgeInsets.symmetric(
          horizontal: LARGE_SPACE,
          vertical: VERY_SMALL_SPACE,
        ),
        child: Wrap(
          spacing: 8.0,
          children: List<Widget>.generate(
            _ORDERED_COLOR_TAGS.length,
            (final int index) => _getColorButton(
              themeData.colorScheme,
              _ORDERED_COLOR_TAGS[index],
              themeProvider,
            ),
          ),
        ),
      ),
    ];