itisnajim / yaml_magic

A Dart+Flutter package for manipulating YAML files.
MIT License
2 stars 0 forks source link

When saving yaml file, some structure error #2

Open laterdayi opened 6 months ago

laterdayi commented 6 months ago
# This YAML file has been written using YamlMagic.
name: mobile
description: A new Flutter project.
publish_to: none

version: 1.0.2+3

environment:
  sdk: ">=3.2.3 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flex_color_scheme: ^7.3.1
  bot_toast: ^4.1.3
  get: ^4.6.6
  shared_preferences: ^2.2.2
  dio: ^5.4.0
  path_provider: ^2.1.1
  easy_refresh: ^3.3.3+1
  package_info_plus: ^5.0.1
  url_launcher: ^6.2.2
  flutter_native_splash: ^2.3.8
  logger: ^2.0.2+1
  open_filex: ^4.3.4
  android_id: ^0.3.6

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.3
  flutter_launcher_icons: ^0.13.1
  yaml_magic: ^1.0.5

flutter:
  uses-material-design: true

  assets:
    - assets/images/logo.png
# flutter pub run flutter_launcher_icons
flutter_launcher_icons:
  android: true
  ios: true
  image_path: assets/images/launcher_icon.png

# dart run flutter_native_splash:create
flutter_native_splash:
  color: 
  image: assets/images/splash.png
  branding: assets/images/splash_branding.png
  android_12:
    image: assets/images/splash.png
    branding: assets/images/splash_branding.png
  web: false
  1. If there are quotes, they are removed
  2. If the value is a color value, it is removed, possibly because the quotes surrounding the color value are removed
  3. Line feed is not saved
laterdayi commented 6 months ago

Color values may be removed because of '#ffffff'

laterdayi commented 6 months ago

@itisnajim please help

itisnajim commented 6 months ago

try the new version 1.0.6

laterdayi commented 6 months ago
  1. Whether it can be configured with parameters. If the value is in quotation marks, keep the quotation marks.
  2. Is it possible to configure parameters? If there is no newline character at the end of the file, no newline character will be added.