yaml 지원
This commit is contained in:
parent
1620ff9f7d
commit
49c66d8c9d
2 changed files with 15 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
Map<String, List<String>?> envArguments(List<String> arguments) {
|
||||
var dic = <String, List<String>?>{};
|
||||
var list = <String>[];
|
||||
|
|
@ -51,6 +53,18 @@ Map<String, dynamic>? getMapFromJson(String jsonStr) {
|
|||
return map;
|
||||
}
|
||||
|
||||
Map<String, dynamic>? getMapFromYaml(String yamlStr) {
|
||||
Map<String, dynamic>? map;
|
||||
if (yamlStr.length > 5) {
|
||||
try {
|
||||
map = jsonDecode(jsonEncode(loadYaml(yamlStr)));
|
||||
} catch (e) {
|
||||
print("Error: $e");
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
Future<String> getIPAddress(String domain) async {
|
||||
var c = Completer<String>();
|
||||
var ipAddress;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ dependencies:
|
|||
json_annotation: ^4.8.0
|
||||
archive: ^3.3.5
|
||||
ftpconnect: ^2.0.5
|
||||
yaml: ^3.1.1
|
||||
|
||||
dev_dependencies:
|
||||
lints: ^2.0.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue