Skip to content

Accept nested Map in Uri constructorΒ #28073

Open
@FranklinYu

Description

@FranklinYu

In current Uri constructor, parameter queryParameters accepts a Map with value type String or Iterable<String>. It targets two scenario:

foo=1&bar=true
foo=1&foo=2

However, many backends also support nested structures like

name[first]=Tom&name[last]=Hanks&gender=male

which will be translated (in backend) to

{
  "name": {
    "first": "Tom",
    "last": "Hanks"
  },
  "gender": "male"
}

It would be really handy if we can just pass in

Uri(queryParameters: { 'name': {'first': 'Tom', 'last': 'Hanks'}, 'gender': 'male'})

especially when the Map<String, dynamic> is constructed from somewhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.core-nlibrary-coretype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions