2025-01-22 20:10:11 +08:00
2025-01-21 23:56:47 +08:00
2025-01-21 22:35:49 +08:00
2025-01-22 20:10:11 +08:00
2025-01-21 22:35:49 +08:00
2025-01-21 22:35:49 +08:00
2025-01-21 22:35:49 +08:00
2025-01-21 22:35:49 +08:00
2025-01-21 22:35:49 +08:00
2025-01-21 23:19:20 +08:00

flutter_qucikstart

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

开发细节注意

布局

  • scaffold home 主视图拆成函数
  • 颜色放在common里统一管理使用class静态属性调用
  • 不同结构使用注释标识使用end结尾结构更清楚

导入资源和图片

  • 固定写法 assets/images/3.0x flutter自动适配几倍图
  • 在pubspec中导入资源在commont新建assets类管理资源
  • 使用stack进行叠加使用aligment进行对齐管理

字体和文本设置

  • 导入字体设置family和路径以及不同字体对应的字重
  • text使用style配置样式fontsize是字体大小height是行高是个比值使用具体的行高值/字体大小

增加倒计时

  • 将无状态组件转成有状态组件,信息变化
  • 使用future.delayed实现倒计时注意使用async
  • 使用三目运算符控制显示
  • 将相同组件抽出

图片自适应

  • 在main中使用theme设置全局样式
  • 在padding中使用edgeinsets.symmetric设置水平间距
  • image中使用fit Boxfit来设置宽高适配

导航,布局

  • 从上到下,从左到右分析布局
  • 写布局前先把结构列好用函数拆分用_bulid开头表示私有布局函数
  • 在使用elevatedbutton时使用style将样式还原在外面套一层Container作为装饰更方便配置
  • 使用Navigator.pushReplacement 替换路由
Description
No description provided
Readme 2 MiB
Languages
C++ 37.8%
Dart 32.5%
CMake 17.9%
HTML 8.9%
C 1.6%
Other 1.2%