flutter-woocommerce-app/LabelStoreMax/lib/helpers/shared_pref.dart
2021-02-24 19:11:47 +00:00

29 lines
770 B
Dart

// Label StoreMAX
//
// Created by Anthony Gordon.
// 2021, WooSignal Ltd. All rights reserved.
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import 'package:shared_preferences/shared_preferences.dart';
class SharedPref {
read(String key) async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString(key);
}
save(String key, value) async {
final prefs = await SharedPreferences.getInstance();
prefs.setString(key, value);
}
remove(String key) async {
final prefs = await SharedPreferences.getInstance();
prefs.remove(key);
}
}