Home > Mobile >  how to parse JSON value store in variable, using flutter dart
how to parse JSON value store in variable, using flutter dart

Time:01-30

how to API response data store in the variable.

             var result = await http.get(apiUr); 
             dynamic responseJson = json.decode(result.body)['Data'];
             dynamic  resultResponse = responseJson['Result'];
             dynamic responseMsg = responseJson['Msg'];

CodePudding user response:

Please use this : https://javiercbk.github.io/json_to_dart/ for convert json response to dart and then

var res = <classname>.fromjson(jsonDecode(result));

CodePudding user response:

code correct, json not receive to api

  •  Tags:  
  • Related