;
四、使用 http 插件进行 Post 请求
----
引入 http 插件后 ,
import 'package:http/http.dart' as http;
调用 http.get 方法...Future 类型返回值
/// 调用 Future 的 then 方法 , 就会在网络请求成功后 , 执行该方法
/// 也就是网络请求成功后...Future 对象 ;
调用 Future 的 then 方法 , 就会在网络请求成功后 , 执行该方法 , 也就是网络请求成功后 , 会自动调用该 then 方法 , 传入 Future 的泛型 CommonModel...对象作为参数 ;
最后获取到返回值后 , 将返回值设置到 httpGetResult 成员中 ;
调用 setState 方法 , 更新 UI ;
七、完整代码
----
import 'package...Future 类型返回值
/// 调用 Future 的 then 方法 , 就会在网络请求成功后 , 执行该方法
/// 也就是网络请求成功后