PngHelperConfig class

PngHelper configuration

Recommended configuration: add png_helper.yaml file in the directory where flutter pub global run png_helper is executed, and add the corresponding configuration in it. Example:

png_helper:
  # Compress quality
  # 0 default/auto
  # 1-10 customize
  quality: 0

  # Image path to compress
  # Relative path to project root(actually this configuration file).
  # Directory must end with '/'.
  # Support any path outside the project root, for example:
  # ../my_android_project/app/src/main/res/drawable/
  # ../my_ios_project/Runner/Assets.xcassets/
  path:
    - asset/image/abc.png
    - asset/image/
    - path_relative_to_this_yaml_file/

  # Image path to ignore
  # Relative path to project root(actually this configuration file).
  # Directory must end with '/'.
  ignore:
    - '.9.png'
    - path_relative_to_this_yaml_file/

Constructors

PngHelperConfig({int? quality, required List<String> resPaths, List<String>? ignore})
PngHelperConfig.fromYaml(String yamlStr)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
ignore List<String>
Image path to ignore Relative path to project root(actually this configuration file). Directory must end with '/'.
final
quality int
Compress quality 0 default/auto 1-10 customize
final
resPaths List<String>
Image path to compress Relative path to project root(actually this configuration file). Directory must end with '/'.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getConfigFilePath(String directory) String
readConfig(String directory) PngHelperConfig