mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
style: use Object instead of dynamic
This commit is contained in:
parent
1972c6d1ab
commit
beed516c89
13 changed files with 84 additions and 56 deletions
|
@ -99,7 +99,9 @@ class Config with IterableMixin<ConfigEntry> {
|
|||
}
|
||||
|
||||
/// Sets the [value] of config [variable].
|
||||
void operator []=(String variable, dynamic value) {
|
||||
///
|
||||
/// Throws [ArgumentError] if provided [value] is not bool, int or String.
|
||||
void operator []=(String variable, Object value) {
|
||||
if (value is bool) {
|
||||
bindings.setBool(
|
||||
configPointer: _configPointer,
|
||||
|
@ -112,12 +114,14 @@ class Config with IterableMixin<ConfigEntry> {
|
|||
variable: variable,
|
||||
value: value,
|
||||
);
|
||||
} else {
|
||||
} else if (value is String) {
|
||||
bindings.setString(
|
||||
configPointer: _configPointer,
|
||||
variable: variable,
|
||||
value: value,
|
||||
);
|
||||
} else {
|
||||
throw ArgumentError.value('$value must be either bool, int or String');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue