Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Future<String> load(SharedPreferences prefs, String fileName) async {
- prefs = await SharedPreferences.getInstance();
- String jsonString = prefs.getString(fileName) ?? "";
- if (jsonString.isNotEmpty) {
- return jsonString;
- }else{
- return ...
- }
- }
- return Future.value('');
Add Comment
Please, Sign In to add comment