Search
 
SCRIPT & CODE EXAMPLE
 

DART

save shared preferences flutter map

prefs = await SharedPreferences.getInstance();
Map<String, dynamic> selectedTimes = {
        "Pomodoro Setting": 15,
        "Rest Time Setting": 5,
        "Long Rest Time Setting": 15,
        "Term of Resting Time Setting": 5
      };
String encodedMap = json.encode(selectedTimes);
print(encodedMap);

prefs.setString('timeData', encodedMap);
Comment

store shared preferences flutter map

String encodedMap = prefs.getString('timeData');
Map<String,dynamic> decodedMap = json.decode(encodedMap);
print(decodedMap);
Comment

PREVIOUS NEXT
Code Example
Dart :: dart empty check 
Dart :: StateError (Bad state: No element) 
Dart :: getting pi in flutter 
Dart :: dart date add month 
Dart :: flutter alertdialog actionsoverflowdirecation 
Dart :: flutter get argument values data 
Dart :: listview inside column flutter 
Dart :: remove status bar in flutter 
Dart :: how to convert int/int to float dart 
Dart :: flutter close bottomsheet programmatically 
Dart :: dart for each indexed 
Dart :: children vs child dart 
Dart :: dart count words in string 
Dart :: dart extension 
Dart :: listview space between items flutter 
Dart :: fix portrait oreintation flutter 
Dart :: flutter disable container 
Dart :: dart input int 
Dart :: message yes or not in dart 
Dart :: flutter extend two classes 
Dart :: spacer in singlechildscrollview 
Dart :: Add Underline Text in Flutter 
Dart :: loop map flutter 
Dart :: list dart 
Dart :: provider flutter docs 
Dart :: Find string index inside a list flutter 
Dart :: @override dart 
Dart :: How to i convert this python code to dart? 
Dart :: app bar color flutter 
Dart :: flutter sqflite foreign keyy 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =