showDevelopBottomSheet static method

Future<void> showDevelopBottomSheet(
  1. BuildContext context
)

Implementation

static Future<void> showDevelopBottomSheet(BuildContext context) async {
  return showSmoothModalSheet<void>(
    context: context,
    builder: (BuildContext context) {
      final AppLocalizations appLocalizations = AppLocalizations.of(context);
      final UserPreferences userPreferences = context
          .watch<UserPreferences>();
      return SmoothModalSheet(
        title: appLocalizations.contribute_sw_development,
        prefixIndicator: true,
        body: Column(
          children: <Widget>[
            Text(appLocalizations.contribute_develop_text),
            const SizedBox(height: VERY_LARGE_SPACE),
            Text(appLocalizations.contribute_develop_text_2),
            const SizedBox(height: BALANCED_SPACE),
            SmoothAlertContentButton(
              label: 'Slack',
              icon: Icons.open_in_new,
              onPressed: () async => LaunchUrlHelper.launchURL(
                'https://slack.openfoodfacts.org/',
              ),
            ),
            const SizedBox(height: SMALL_SPACE),
            SmoothAlertContentButton(
              label: 'GitHub',
              icon: Icons.open_in_new,
              onPressed: () async => LaunchUrlHelper.launchURL(
                'https://github.com/openfoodfacts',
              ),
            ),
            const SizedBox(height: BALANCED_SPACE),
            SwitchListTile.adaptive(
              title: Text(appLocalizations.contribute_develop_dev_mode_title),
              subtitle: Text(
                appLocalizations.contribute_develop_dev_mode_subtitle,
              ),
              value: userPreferences.devMode != 0,
              onChanged: (bool devMode) async =>
                  userPreferences.setDevMode(devMode ? 1 : 0),
            ),
          ],
        ),
      );
    },
  );
}