当前位置:网站首页>Flutter development: a way to solve the problem of blank space on the top of listview

Flutter development: a way to solve the problem of blank space on the top of listview

2022-07-05 09:47:00 Third shopkeeper 666

Preface

stay Flutter In development , Developers are interested in ListView The use of components is no stranger , Because regular business requirements will basically involve lists or slides , It is necessary to use ListView. About ListView Regular use of , Generally, you can find the corresponding API, There is not much here . But for some uncommon uses, we still need to know , Then this blog post will share about solving ListView One of the common problems in the use of :ListView Top blank question , Easy to read and use .

describe

stay Flutter in ListView There will be blank problem at the top by default , Will see ListView There is a little blank area on the head , That's because of dang ListView No peace AppBar When used together , The head will have a padding, Then I want to get rid of this padding, Then use MediaQuery.removePadding hold ListView Wrap it , So you're going to have to take ListView As MediaQuery.removePadding Sub components of .

Figure displaying the blank question

原网站

版权声明
本文为[Third shopkeeper 666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140536247801.html