analyzer error of dynamic variable to Map

This commit is contained in:
Jonathan Rezende 2019-10-09 16:00:39 -03:00 committed by GitHub
parent 3434b4cf59
commit d31a6242c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ buildMapFromUri(Map map, String body) {
// i.e. map.foo.bar => [map, foo, bar] // i.e. map.foo.bar => [map, foo, bar]
List<String> keys = key.split('.'); List<String> keys = key.split('.');
Map targetMap = map[keys[0]] ?? {}; Map targetMap = map[keys[0]] != null ? map[keys[0]] as Map : {};
map[keys[0]] = targetMap; map[keys[0]] = targetMap;
for (int i = 1; i < keys.length; i++) { for (int i = 1; i < keys.length; i++) {
if (i < keys.length - 1) { if (i < keys.length - 1) {