支付宝赞助帐号:service@kuitao8.com 

flutter post删除方法

Created2020-03-19   Views 261    Author 懒人程序
   Map<String, String> get headers => {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "dfgfdgsfd",
      };
      void _showSnackBar(String acid,int index) async {
      Map data = {
       'id': acid,
    };

     String body = json.encode(data);
     var response = await http.post(
      'http://www.kuitao8.com/api/v1/del_ist',
      body:body,
      headers: headers,
    );
     print(response.body);
     print("index $index");
    if(response.statusCode==200){
       setState(() {
         _getNews();
         hotList.removeAt(index); 
       });
         Toast.show("删除成功",
                              context,
                              duration: Toast.LENGTH_SHORT,
                              gravity: Toast.CENTER,
                              backgroundRadius: 26.0);
    }

  }
上一篇: flutter下拉展开
下一篇:没有了
支持键盘 ← →

邮件订阅

订阅我们的精彩内容