A brief introduction to the complete network request, return a successful json string into a Model object, with GridView to display.

1. Add the HTTP plug-in to dependencies in the pubspec.yaml configuration file

2. Define a Photo class. Define a factory constructor that converts the map object passed to it into a Photo object

Dart ‘as HTTP’; dart’ as HTTP ‘; dart’ as HTTP ‘; Compute is implemented using the Isolate encapsulation method.

4, convert the returned data into a list of photo objects, call the photo factory constructor, and return the photo object

5. Use the FutureBuilder component to process the results converted to the List. The advantage of using it is that there is no need to call the setState function to notify the Dart engine to refresh the page. The Builder has a parameter AsyncSnapshot that contains the results of the processing, including errors, and correct cases. If the error, return a Text, shows that there is an error, success has data, using a custom PhotoListContent components, no content use CircularProgressIndicator components, is in the process of loading, display a loading first view, And then display the content

6. The Gridview that displays the results, using the passed List.

7. The display effect is as follows