update code

This commit is contained in:
leedongmyung[desktop] 2023-11-19 21:01:40 +09:00
parent 000b2e1f10
commit 427a6255f5

View file

@ -68,7 +68,11 @@ Map<String, dynamic>? getMapFromJson(String jsonStr) {
Map<String, dynamic>? getMapFromYaml(String yamlStr) {
Map<String, dynamic>? map;
if (yamlStr.length > 5) {
map = jsonDecode(jsonEncode(loadYaml(yamlStr)));
try {
map = jsonDecode(jsonEncode(loadYaml(yamlStr)));
} on Exception catch (e, stacktace) {
throw Exception('Yaml Pasing error.');
}
}
return map;
}
@ -96,6 +100,12 @@ Future get simpleFuture {
return c.future;
}
Future<T> dataFutrue<T>(T data) {
var c = Completer<T>();
c.complete(data);
return c.future;
}
Future<Uint8List?> readFileByte(String filePath) async {
var c = Completer<Uint8List>();
Uri myUri = Uri.parse(filePath);