Flutter 中需要注意的一些问题

Flutter项目中,目录名应仅包含小写字母、数字和下划线。Expanded组件用作Row、Column或Flex的子组件以扩展空间。TextField必须在具有Material主题的Widget,如Card、Dialog、Drawer或Scaffold内使用,以避免缺少Material祖先的错误。
摘要由CSDN通过智能技术生成

1、Flutter的项目目录只能由小写字母数字和’_'组成
2、Flutter中的Expanded组件只能作为Row、Column、Flex等组件的child进行空间扩展
3、TextField外部必须包裹一个Card、Dialog、Drawer或者Scaffold等支持Material的主题的Widget,否则会报如下错误:

TextField widgets require a Material widget ancestor.
In material design, most widgets are conceptually “printed” on a sheet of material. In Flutter’s material library, that material is represented by the Material widget. It is the Material widget that renders ink splashes, for instance. Because of this, many material library widgets require that there be a Material widget in the tree above them.
To introduce a Material widget, you can either directly include one, or use a widget that contains Material itself, such as a Card, Dialog, Drawer, or Scaffold.`

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值