File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
packages/firebase_remote_config/firebase_remote_config Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -134,14 +134,15 @@ class RemoteConfig extends FirebasePluginPlatform with ChangeNotifier {
134134 /// Sets the default parameter values for the current instance.
135135 /// Only booleans, strings and numbers are supported as values of the map
136136 Future <void > setDefaults (Map <String , dynamic > defaultParameters) {
137- defaultParameters.values. forEach (_checkIsSupportedType);
137+ defaultParameters.forEach (_checkIsSupportedType);
138138 return _delegate.setDefaults (defaultParameters);
139139 }
140140
141- void _checkIsSupportedType (dynamic value) {
141+ void _checkIsSupportedType (String key, dynamic value) {
142142 if (value is ! bool && value is ! num && value is ! String ) {
143- throw Exception (
144- 'Non-primitive types are not supported as config values. '
143+ throw ArgumentError (
144+ 'Invalid value type "${value .runtimeType }" for key "$key ". '
145+ 'Only booleans, numbers and strings are supported as config values. '
145146 "If you're trying to pass a json object – convert it to string beforehand" ,
146147 );
147148 }
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ void main() {
219219 () => remoteConfig.setDefaults ({
220220 'key' : {'nested' : 'object' }
221221 }),
222- throwsException ,
222+ throwsArgumentError ,
223223 );
224224 });
225225 });
You can’t perform that action at this time.
0 commit comments