diff --git a/lib/utils/system_util.dart b/lib/utils/system_util.dart index f5237fc..f68c7d2 100644 --- a/lib/utils/system_util.dart +++ b/lib/utils/system_util.dart @@ -68,7 +68,11 @@ Map? getMapFromJson(String jsonStr) { Map? getMapFromYaml(String yamlStr) { Map? 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 dataFutrue(T data) { + var c = Completer(); + c.complete(data); + return c.future; +} + Future readFileByte(String filePath) async { var c = Completer(); Uri myUri = Uri.parse(filePath);