“Store Shared Presidentces Flatter Map” Code-Antworten

Store Shared Presidentces Flatter 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);
Carlos García Moncada

Store Shared Presidentces Flatter Map

String encodedMap = prefs.getString('timeData');
Map<String,dynamic> decodedMap = json.decode(encodedMap);
print(decodedMap);
Carlos García Moncada

Ähnliche Antworten wie “Store Shared Presidentces Flatter Map”

Fragen ähnlich wie “Store Shared Presidentces Flatter Map”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen