GradleProperties class
Entry point of this library. It allows to read/write properties files, access properties, and modify properties.
Constructors
-
GradleProperties.fromMap(Map<
String, String> _props) - loads properties from given map
- GradleProperties.parse(String content)
-
Creates a new instance of GradleProperties by parsing given content.
Throws ArgumentError if content is empty.
Throws FormatException if content is not in valid format.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ Iterable<
String> -
returns an iterable of keys present in properties
no setter
-
properties
→ Map<
String, String> -
returns a map of properties.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
→ Iterable<
String> -
returns an iterable of values present in properties
no setter
Methods
-
addAll(
Map< String, String> map) → void -
adds all the entries from
map
to properties -
contains(
String key) → bool - checks whether given key is in properties or not
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
putIfAbsent(
String key, String value) → void - only puts a key if it is absent. This will not change the value of key if already exists in properties
-
save(
[File? file]) → Future< void> - allows to save properties to a file. If a file is provided at the time of initialization that is if GradleProperties.fromFile or GradleProperties.fromPath is used to create instance, then that file will be used by default to write back on it.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String key) → String? - allows to access properties like a map
-
operator []=(
String key, String value) → void - allows to set properties like a map do
Static Methods
-
fromFile(
File file) → Future< GradleProperties?> - loads given properties from given file and returns a future that can be awaited.
-
fromPath(
String path) → Future< GradleProperties?> - loads given properties from given file path and returns a future that can be awaited
-
tryParse(
String content) → GradleProperties? - Parses given content and returns GradleProperties instance if content is valid. Returns null otherwise.