会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Zy
迁移新博客:https://leonzy.wang/
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
35
下一页
2020年10月13日
Dart-单例模式
摘要: dart有一个factory关键字,factory修饰的默认构造函数要返回类型实例,如: factory MyClass => getInstance(); 其它构造函数不能返回实例。 注意,dart中类的默认构造函数只能有一个!factory修饰的默认构造函数也算默认构造函数!所以实际的构造要么不
阅读全文
posted @ 2020-10-13 20:36 NeoZy
阅读(3102)
评论(0)
推荐(0)
2020年10月12日
Flutter-使用Custompaint绘制一个圆圈进度条
摘要: 今天正好需求做完了没啥事,学习了一下CustomPaint,做了一个圆圈式的进度条,代码如下: import 'dart:async'; import 'dart:math'; import 'package:flutter/material.dart'; void main() => runApp
阅读全文
posted @ 2020-10-12 18:23 NeoZy
阅读(983)
评论(0)
推荐(0)
Flutter-自绘组件CustomPaint
摘要: Flutter中自绘组件是CustomPaint,它是一个widget。配合CustomPainter(画笔),可以画出任意想要的图形。 CustomPaint构造函数如下: const CustomPaint({ Key key, this.painter, ///背景画笔,会展示在child后面
阅读全文
posted @ 2020-10-12 15:59 NeoZy
阅读(907)
评论(0)
推荐(0)
2020年9月25日
AnimatedSwitcher
摘要: 好久没写博客了,今天写一个新学的Widget:AnimatedSwitcher 其构造函数如下: const AnimatedSwitcher({ Key key, this.child, @required this.duration, this.reverseDuration, this.swi
阅读全文
posted @ 2020-09-25 19:12 NeoZy
阅读(396)
评论(0)
推荐(0)
2020年9月5日
入职一个月
摘要: 渐渐熟悉了公司的节奏,flutter写界面已经比较熟练了,但还是有很多名词/黑话不明白,要学的很多。。。
阅读全文
posted @ 2020-09-05 21:26 NeoZy
阅读(152)
评论(0)
推荐(0)
flutter--static关键字
摘要: class Page { int currentPage = 1; static void scorllDown() { ///错误:static方法不能访问普通成员变量 currentPage = 1; print("ScrollDown..."); } void scorllUp() { cur
阅读全文
posted @ 2020-09-05 21:19 NeoZy
阅读(1530)
评论(0)
推荐(0)
Flutter-变量初始化问题
摘要: 没事写代码写到标注释这一句报错: class TestPage extends StatefulWidget { @override TestPageState createState() { return TestPageState(); } } class TestPageState exten
阅读全文
posted @ 2020-09-05 21:02 NeoZy
阅读(2029)
评论(0)
推荐(0)
2020年9月3日
Flutter-RotatedBox
摘要: quarterTurns表示几个1/4,只能是int child内部组件。
阅读全文
posted @ 2020-09-03 17:25 NeoZy
阅读(249)
评论(0)
推荐(0)
Flutter-WillPopScope
摘要: 可以拦截内部child的返回事件,其中onWillPop返回Future<bool>,如果是false,就不会出栈,如果true就会出栈。 例子: import 'dart:core'; import 'package:flutter/cupertino.dart'; import 'package
阅读全文
posted @ 2020-09-03 17:22 NeoZy
阅读(642)
评论(0)
推荐(0)
2020年8月23日
Flutter--EventBus
摘要: 首先要引用event_bus.dart文件 初始化EventBus全局对象 生成一个event类,也可以用父类event来传递 在需要监听总线的页面添加监视器,类型是StreamSubscription,可以指定监听的event类型,不符合的event不会被监听到 发送事件可以用EventBus.f
阅读全文
posted @ 2020-08-23 00:39 NeoZy
阅读(717)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
35
下一页
公告