Skip to content

Commit

Permalink
clear custom api keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gmonso committed Jul 3, 2024
1 parent 022a89e commit 4aa1b76
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lib/screens/lg_settings_sreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class _SettingsPageState extends State<SettingsPage> with TickerProviderStateMix
_nasaApiController.text.toString());
_nasaService.nasaApiCountryLiveFire.apiKey =
_nasaApiController.text.toString();

_localStorageService.setItem(StorageKeys.preciselyApiKey, _preciselyApiKeyController.text.toString());
_localStorageService.setItem(StorageKeys.preciselyApiSecret, _preciselyApiSecretController.text.toString());
_preciselyService.preciselyApiServiceSettings.apiKey = _preciselyApiKeyController.text.toString();
Expand All @@ -355,6 +355,28 @@ class _SettingsPageState extends State<SettingsPage> with TickerProviderStateMix
},
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Button(
label: 'Clear custom API keys',
width: 280,
height: 48,
icon: Icon(
Icons.clear_all,
color: ThemeColors.backgroundColor,
),
onPressed: () {
FocusManager.instance.primaryFocus?.unfocus();
_localStorageService.setItem(StorageKeys.nasaApiKey,
NASAServiceSettings.nasaApiKey);
_localStorageService.setItem(StorageKeys.preciselyApiKey,
PreciselyServiceSettings.defaultApiKey);
_localStorageService.setItem(StorageKeys.preciselyApiSecret,
PreciselyServiceSettings.defaultApiSecret);
showSnackbar(context, 'Clear custom API keys');
},
),
),
],
),
),
Expand Down

0 comments on commit 4aa1b76

Please sign in to comment.