Flutter开发学习过程

Flutter开发成长过程记录

目录

这是一篇记录flutter开发成长过程的博文。主要记录学习过程中看到的容易坑的点

2020年7月4日

阅读了flutter官方开发文档。
最近开始重视软件等学习过程中阅读开发文档了,因为开发文档是最规范、最权威的参考文件,读好开发文档才能对原理和整体框架更加熟悉,开发起来才会得心应手。
今日排雷:

  1. 使用key来解决ststeful widget位置交换等情形时的问题
  2. 设置Expanded的参数fit: BoxFit.contain来解决Expanded所包含内容(图片或图标)过小的问题
  3. 如果在使用row时出现overflow,用Expanded()来包装过于长的内容。
  4. 如果在使用column时出现overflow,应该改用ListView
  5. 在使用column时提示“unbounded vertical constraints.”的运行时错误,有两种原因:第一种是列嵌套列,此时应给内部列加上Sxpanded或Flexible;第二种是ListView等嵌套列,此时应删去内部列的Expanded或Flexble(因为ListView等是提供了无限空间给item的)。

2020年7月5日

  1. 为text设置overflow: TextOverflow.ellipsis,参数,让过长的text省略显示
  2. Use raised buttons to add dimension to otherwise mostly flat layouts, e.g. in long busy lists of content, or in wide spaces. Avoid using raised buttons on already-raised content such as dialogs or cards.If onPressed and onLongPress callbacks are null, then the button will be disabled and by default will resemble a flat button in the disabledColor. If you are trying to change the button’s color and it is not having any effect, check that you are passing a non-null onPressed or onLongPress callbacks.

猜你喜欢

转载自blog.csdn.net/LINKUN787624675/article/details/107128049