![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Dart
BlueSky_x
我一直觉得学习可以使人快乐,所以我才会去坚守吧
展开
-
Dart factory 快速理解
Factory constructors(工厂方法构造函数)如果一个构造函数并不总是返回一个新的对象,则使用 factory 来定义 这个构造函数。例如,一个工厂构造函数 可能从缓存中获取一个实例并返回,或者 返回一个子类型的实例。注意: 工厂构造函数无法访问 this。 使用 new 关键字来调用工厂构造函数。下面代码演示工厂构造函数 如何从缓存中返回对象:(解释在代码中)cl...原创 2019-10-17 10:51:10 · 10280 阅读 · 1 评论 -
Dart--学习
// 导入模块import 'dart:math' show Random;// We changed 5 lines of code to make this sample nicer on// the web (so that the execution waits for animation frame,// the number gets updated in the DOM,...原创 2019-05-04 13:10:24 · 237 阅读 · 0 评论 -
Flutter组件传值
上一篇中讲了如何通过父组件给子组件传值: 传送门这一篇的内容会讲述如何实现:1. 父子组件之间的传值方法2. 兄弟组件之间的传值方法 —— eventbus实现后的效果如下图,实现效果.png有一些朋友在使用的过程中,可能没有找到比较好的方法,那么我们就一起来撸一个demo吧。这个demo我们重头开始,先flutter create demo (你的项目名称), 我们...转载 2019-05-05 11:16:43 · 3201 阅读 · 0 评论