You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
407 B
Dart
14 lines
407 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
class Logs{
|
|
static save(String log){
|
|
SharedPreferences.getInstance().then((_prefs) async{
|
|
var jsonString = _prefs.getString("LOG") ?? "[]";
|
|
var list = json.decode(jsonString) as List;
|
|
list.add("Running... ${DateTime.now()}");
|
|
_prefs.setString("LOG", json.encode(list));
|
|
});
|
|
}
|
|
} |