saveProgressToFile method

void saveProgressToFile(
  1. String filePath
)

保存进度到文件

Implementation

void saveProgressToFile(String filePath) {
  final progress = getSaveProgressMap();
  final text = json.encode(progress);
  final bytes = utf8.encode(text);
  final file = File(filePath);
  if (!file.existsSync()) {
    file.createSync();
  }
  file.writeAsBytesSync(bytes);
}