hide blodeuwedd in settings if not supported
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is pending Details

This commit is contained in:
Dan Ballard 2024-02-10 09:40:35 -08:00
parent 68c83f2c9a
commit e0546eb502
1 changed files with 22 additions and 20 deletions

View File

@ -162,27 +162,29 @@ class _GlobalSettingsExperimentsViewState extends State<GlobalSettingsExperiment
), ),
]), ]),
), ),
SwitchListTile( Visibility(
title: Text(AppLocalizations.of(context)!.blodeuweddExperimentEnable), visible: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported(),
subtitle: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() child: SwitchListTile(
? Text(AppLocalizations.of(context)!.blodeuweddDescription) title: Text(AppLocalizations.of(context)!.blodeuweddExperimentEnable),
: Text(AppLocalizations.of(context)!.blodeuweddNotSupported), subtitle: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported()
value: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() && settings.isExperimentEnabled(BlodeuweddExperiment), ? Text(AppLocalizations.of(context)!.blodeuweddDescription)
onChanged: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() : Text(AppLocalizations.of(context)!.blodeuweddNotSupported),
? (bool value) { value: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() && settings.isExperimentEnabled(BlodeuweddExperiment),
if (value) { onChanged: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported()
settings.enableExperiment(BlodeuweddExperiment); ? (bool value) {
} else { if (value) {
settings.disableExperiment(BlodeuweddExperiment); settings.enableExperiment(BlodeuweddExperiment);
} else {
settings.disableExperiment(BlodeuweddExperiment);
}
saveSettings(context);
} }
saveSettings(context); : null,
} activeTrackColor: settings.theme.defaultButtonColor,
: null, inactiveTrackColor: settings.theme.defaultButtonDisabledColor,
activeTrackColor: settings.theme.defaultButtonColor, inactiveThumbColor: settings.theme.defaultButtonDisabledColor,
inactiveTrackColor: settings.theme.defaultButtonDisabledColor, secondary: Icon(Icons.assistant, color: settings.current().mainTextColor),
inactiveThumbColor: settings.theme.defaultButtonDisabledColor, )),
secondary: Icon(Icons.assistant, color: settings.current().mainTextColor),
),
Visibility( Visibility(
visible: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() && settings.isExperimentEnabled(BlodeuweddExperiment), visible: Provider.of<FlwtchState>(context, listen: false).cwtch.IsBlodeuweddSupported() && settings.isExperimentEnabled(BlodeuweddExperiment),
child: CwtchFolderPicker( child: CwtchFolderPicker(