# HelloFlutter **Repository Path**: banyingli/HelloFlutter ## Basic Information - **Project Name**: HelloFlutter - **Description**: No description available - **Primary Language**: Dart - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-12-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HelloFlutter 一个Flutter学习项目 ``` HelloFlutter ├── android ├── fonts ├── i10n-arb ├── imgs ├── ios ├── jsons Json文件 ├── lib | ├── common 一些工具类,如通用方法类、网络接口类、保存全局变量的静态类等 | ├── i10n 国际化相关的类都在此目录下 | ├── models Json文件对应的Dart Model类会在此目录下 | ├── states 保存APP中需要跨组件共享的状态类 | ├── routes 存放所有路由页面类 | └── widgets APP内封装的一些Widget组件都在该目录下 └── test ``` ## 内容 ### 常用组件 ### 常用功能 ### 其他 #### Json 转 Dart Model ``` dependencies: json_annotation: ^2.0.0 dev_dependencies: json_model: ^0.0.2 build_runner: ^1.0.0 json_serializable: ^2.0.0 ``` 1、在根目录创建jsons目录,并在其中创建json文件,其中不能用有注释 2、运行`flutter packages pub run json_model` #### 在web环境运行 [Flutter Web环境搭建](https://www.jianshu.com/p/d872181a7395) #### 常用代码片段 * 延迟执行 ``` // 延时1s执行返回 Future.delayed(Duration(seconds: 1), (){ Navigator.of(context).pop(); print('延时1s执行'); }); ```