Closed maxzod closed 1 year ago
@maxzod, you should be able to insert a new key in a YamlMap
using YamlEditor
.
Can you make provide a complete minimal example of this issue?
I have no issues doing:
import 'package:yaml_edit/yaml_edit.dart';
void main() {
final yamlEditor = YamlEditor('''
flutter:
uses-material-design: true
''');
yamlEditor.update([
'flutter',
'assets'
], {
'foo': 'foo.jpg',
'bar': 'bar.png',
});
print(yamlEditor.toString());
}
that prints:
flutter:
assets:
foo: foo.jpg
bar: bar.png
uses-material-design: true
iam working on
CLI
features that see the content of theassets
directory and add pathes topubspec.yaml
based on that it works with update if there is already a list in pubspec assetsBUT if there is no assets key n the pubspec under flutter
it throws exception
i think this is the expected behavior to throw when updating a null but how could i
set
value to a key that does not exist+