项目作者: 7449

项目描述 :
flutter code,flutter-banner,flutter-codekk,flutter-panda,flutter_tab
高级语言: Dart
项目地址: git://github.com/7449/flutter_example.git
创建时间: 2018-04-20T08:54:11Z
项目社区:https://github.com/7449/flutter_example

开源协议:Apache License 2.0

下载


flutter_example

flutter code

update log

运行项目

请使用最新版本的flutter运行demo

18.6.3

新增Tab

18.5.19

新增BannerWidget轮播图

18.5.14

去掉new以及const关键字

项目地址

Flutter示例集合

项目blog

初始化项目和闪屏页

添加Tab和Drawer

列表页完善,网络请求

列表详情页

flutter

github地址

官方地址

官方文档地址

Flutter中文开发者论坛

中文文档

blog

Flutter番外篇:Dart

第一章:什么是Flutter

第二章:安装Flutter

第三章:编写一个FlutterApp

第四章:框架预览

第五章:Widget目录

第六章:面对Android开发的Flutter说明

第七章:面对ReactNative开发的Flutter说明

第八章:手势

第九章:动画

第十章:布局约束

第十一章:处理 assets 和 图像

json序列化

flutter_tab_widget

使用方法

适用于嵌套Tab.

  1. final List<TabEntity> entity = [
  2. new TabEntity(title: '直播'),
  3. new TabEntity(title: '视频'),
  4. new TabEntity(title: '播报'),
  5. ];
  6. @override
  7. Widget build(BuildContext context) {
  8. return Scaffold(
  9. appBar: AppBar(
  10. title: Text('Flutter TabWidget'),
  11. elevation: 0.0,
  12. ),
  13. body: TabWidget(
  14. onPageChanged: (position) {
  15. print(position);
  16. },
  17. children: <Widget>[
  18. Container(color: Colors.white, child: Center(child: Text('直播'))),
  19. Container(color: Colors.pink, child: Center(child: Text('视频'))),
  20. Container(color: Colors.blue, child: Center(child: Text('播报'))),
  21. ],
  22. entity: entity,
  23. ),
  24. );
  25. }

flutter_banner_widget

使用方法

继承BannerEntity,实现两个方法

示例:

  1. class SimpleEntity extends BannerEntity {
  2. final String obj;
  3. final String url;
  4. final String title;
  5. SimpleEntity({this.obj, this.url, this.title});
  6. @override
  7. get bannerUrl => url;
  8. @override
  9. get bannerTitle => title;
  10. }

或者:

  1. class SimpleEntity extends Object with BannerEntity {
  2. final String obj;
  3. final String url;
  4. final String title;
  5. SimpleEntity({this.obj, this.url, this.title});
  6. @override
  7. get bannerUrl => url;
  8. @override
  9. get bannerTitle => title;
  10. }

widget:

  1. BannerWidget(entity: entity)
加载本地图片

实现build方法,返回对应的widget

  1. BannerWidget(
  2. build: (position, entity) {
  3. return Image.asset(entity.bannerUrl, fit: BoxFit.cover);
  4. },
  5. entity: localEntity,
  6. )
点击事件
  1. BannerWidget(
  2. entity: entity,
  3. bannerPress: (position, entity) {
  4. SimpleEntity bannerEntity = entity;
  5. print('position:${position},entity:${bannerEntity.obj}');
  6. },
  7. )

flutter_zhihu_zhuanlan

目前没有比较好的办法加载一段html代码,只能以text的形式直接显示

flutter_codekk

目前codeKK-Android的功能已经使用flutter全部实现

项目因为使用了json_serializable,但是没有提交自动生成的文件,需要在运行之前执行flutter packages pub run build_runner build
否则entity目录会报错

因为flutter处于急速更迭中,有时候会和插件有冲突,为了防止这种事情发生,提交.g文件

布局的几种模式可以查看StatusWidget,截图只展示ERROR