Flutter實戰視頻-移動電商-07.Dio基礎_POST請求的使用

07.Dio基礎_POST請求的使用

 越界問題解決

容器越界的問題,越界是由於鍵盤彈起的問題。若是鍵盤不彈起是不會越界async

咱們加一個滾動組件就能夠解決。post

這是技術胖視頻中出現的越界的截圖效果spa

 

這是我本身電腦上開發的效果,沒有出現越界的問題:code

 

咱們在這裏外層套一個組件:SingleChildScrollView視頻

 

把原來咱們的container組件放在SingleChildScrollView裏面blog

 

視頻中的問題就解決了。開發

 

 

easy-mock

 

 

https://easy-mock.com/loginget

 

post請求的方式

 

效果展現:

 

 

 

Future getHttp(String typeText) async{
   try {
     Response response;
     var data={'name':typeText};
     response= await Dio().post("https://www.easy-mock.com/mock/5c60131a4bed3a6342711498/baixing/post_dabaojian",
      queryParameters:data
     );
     return response.data;
   } catch (e) {
     return print(e);
   }
 }
相關文章
相關標籤/搜索