Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- //ignore: unused_import
- import 'dart:convert';
- import 'package:shared_preferences/shared_preferences.dart';
-
- class PrefUtils {
- static SharedPreferences? _sharedPreferences;
-
- PrefUtils() {
- SharedPreferences.getInstance().then((value) {
- _sharedPreferences = value;
- });
- }
-
- Future<void> init() async {
- _sharedPreferences ??= await SharedPreferences.getInstance();
- print('SharedPreference Initialized');
- }
-
- ///will clear all the data stored in preference
- void clearPreferencesData() async {
- _sharedPreferences!.clear();
- }
- }
|