You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
444 B
14 lines
444 B
4 years ago
|
import 'package:shared_preferences/shared_preferences.dart';
|
||
|
|
||
|
extension SharedPreferencesExtenstion on SharedPreferences {
|
||
|
Future<bool> updateInt(String key, int value) {
|
||
|
if (this.getInt(key) == value) return Future.value(false);
|
||
|
return this.setInt(key, value);
|
||
|
}
|
||
|
|
||
|
Future<bool> updateString(String key, String value) {
|
||
|
if (this.getString(key) == value) return Future.value(false);
|
||
|
return this.setString(key, value);
|
||
|
}
|
||
|
}
|