yk_flutter_core 0.0.6
yk_flutter_core: ^0.0.6 copied to clipboard
YKFlutterCore
Features #
YkFileManager #
获取存储路径
YkFileManager.getDocumentPath();
保存内容,但需要把保存的内容先进行转化成二进制data, 保存成功将返回bool
final data = Int8List.fromList(utf8.encode("fawoeigjaowiegjoiawjegoiawjegoiawejgo"));
final documentPath = await YkFileManager.getDocumentPath();
String newFilePath = "$documentPath/text.txt";
final result = await YkFileManager.save(bytes: data, filePath:newFilePath);
获取内容, 根据路径返回内容
final documentPath = await YkFileManager.getDocumentPath();
String newFilePath = "$documentPath/text.txt";
final detail = await YkFileManager.getData(path: newFilePath);
final andoder = utf8.decode(detail ?? []);