Issue Let’s say I have a TestObject object that I am using for a JSON response from my API. I also have an A Object and a B object. Within my TestObject response, I am getting a List of Object
Continue readingTag: json
Should (or shouldn't) the values in Flutter JSON files be quoted?
Issue Let’s first establish a detail. In the following code import ‘dart:convert’ as JSON; void main() { var jsonStr = """{"count": 3}"""; final json = JSON.jsonDecode(jsonStr); print(json[‘count’]); // 3 } the string to be parsed is {"count": 3} and not
Continue readinghow to get data from API into listview using model class in Flutter
Issue I am trying to get data from the TMDB API using the model class. I can retrieve the data but I can not show it on listview. model classes; top_rated_movies.dart import ‘package:movipedia/model/top_rated_movies/results.dart’; class TopRatedMovies { int? page; List<Results>? results;
Continue readingDart Flutter Generic Api Response Class Dynamic Class Data Type
Issue My app currently is working with a custom classes for each api responses as models. But I’m trying to change it, to optimize some little things, so I’m trying to implement a Class wrapper, called ApiResponse for example. But
Continue readingLoad JSON from php into strings in a fragment?
Issue Object: Get 1 set of Longitude and Lattitude coordinates from url JSON results. Load maps and add a marker and camera zoom to those coordinates. Problem: Everything works, only on 1st load of the app and the fragment that
Continue readingMap list of JSON to Tabbar flutter
Issue I’m trying to map list of json to tab bar, and want tab bar title as "JSON1" API response :"data": [{"JSON1": {"key1": "val1","key2": "val2"}}], My code : List dataResponse = [{JSON1: {key1: val1, key2: val2}}]; TabBar( tabAlignment: TabAlignment.start, indicatorSize:
Continue readingHow to deserialize multiple json fields into single object with kotlinx serialization
Issue Consider the following json structure representing a basic check-in information { "id": "53481198005", "date": "1995-01-01 00:00:00", "latitude": "50.765391", "longitude": "60.765391" } During deserialization, I want to consume latitude and longitude and create a single object called Location. In other
Continue readingandroid – format json string in adb logcat output
Issue For logging purpose, I print out json response string and can see them in android “adb logcat” command. Is there a way to nicely format the json string in adb logcat output so that it looks like this? {
Continue readinghow to parse multiple json objects with no name
Issue im having some trouble parsing json. I have json in the format of: {“blah”:”blah”,”blah”:”blah”} {“blah”:”blah”,”blah”:”blah”} {“blah”:”blah”,”blah”:”blah”} Here is the link to the JSON: http://gerrit.aokp.co/query?format=JSON&q=status:merged&age:1d I cant make this a jsonobject and iterate over it. I currently have it as
Continue readingexecuting http POST returns HTML instead of JSON
Issue EDIT completely re-working the question for better understanding I have to query the given url http://api.bf3stats.com/pc/player/ with 2 POST parameters: ‘player’ (for player name) and ‘opt’ (for options). I’ve tested it on http://www.requestmaker.com/ with following data: player=Zer0conf&opt=all. I’m getting
Continue reading