上一页 1 2 3 4 5 6 7 ··· 35 下一页
摘要: dart有一个factory关键字,factory修饰的默认构造函数要返回类型实例,如: factory MyClass => getInstance(); 其它构造函数不能返回实例。 注意,dart中类的默认构造函数只能有一个!factory修饰的默认构造函数也算默认构造函数!所以实际的构造要么不 阅读全文
posted @ 2020-10-13 20:36 NeoZy 阅读(2851) 评论(0) 推荐(0) 编辑
摘要: 今天正好需求做完了没啥事,学习了一下CustomPaint,做了一个圆圈式的进度条,代码如下: import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; void main() => runApp 阅读全文
posted @ 2020-10-12 18:23 NeoZy 阅读(910) 评论(0) 推荐(0) 编辑
摘要: Flutter中自绘组件是CustomPaint,它是一个widget。配合CustomPainter(画笔),可以画出任意想要的图形。 CustomPaint构造函数如下: const CustomPaint({ Key key, this.painter, ///背景画笔,会展示在child后面 阅读全文
posted @ 2020-10-12 15:59 NeoZy 阅读(814) 评论(0) 推荐(0) 编辑
摘要: 好久没写博客了,今天写一个新学的Widget:AnimatedSwitcher 其构造函数如下: const AnimatedSwitcher({ Key key, this.child, @required this.duration, this.reverseDuration, this.swi 阅读全文
posted @ 2020-09-25 19:12 NeoZy 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 渐渐熟悉了公司的节奏,flutter写界面已经比较熟练了,但还是有很多名词/黑话不明白,要学的很多。。。 阅读全文
posted @ 2020-09-05 21:26 NeoZy 阅读(146) 评论(0) 推荐(0) 编辑
摘要: class Page { int currentPage = 1; static void scorllDown() { ///错误:static方法不能访问普通成员变量 currentPage = 1; print("ScrollDown..."); } void scorllUp() { cur 阅读全文
posted @ 2020-09-05 21:19 NeoZy 阅读(1459) 评论(0) 推荐(0) 编辑
摘要: 没事写代码写到标注释这一句报错: class TestPage extends StatefulWidget { @override TestPageState createState() { return TestPageState(); } } class TestPageState exten 阅读全文
posted @ 2020-09-05 21:02 NeoZy 阅读(1953) 评论(0) 推荐(0) 编辑
摘要: quarterTurns表示几个1/4,只能是int child内部组件。 阅读全文
posted @ 2020-09-03 17:25 NeoZy 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 可以拦截内部child的返回事件,其中onWillPop返回Future<bool>,如果是false,就不会出栈,如果true就会出栈。 例子: import 'dart:core'; import 'package:flutter/cupertino.dart'; import 'package 阅读全文
posted @ 2020-09-03 17:22 NeoZy 阅读(627) 评论(0) 推荐(0) 编辑
摘要: 首先要引用event_bus.dart文件 初始化EventBus全局对象 生成一个event类,也可以用父类event来传递 在需要监听总线的页面添加监视器,类型是StreamSubscription,可以指定监听的event类型,不符合的event不会被监听到 发送事件可以用EventBus.f 阅读全文
posted @ 2020-08-23 00:39 NeoZy 阅读(625) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 35 下一页