chen56 / you Goto Github PK
View Code? Open in Web Editor NEWflutter note
Home Page: https://chen56.github.io/you/flutter_web/
License: MIT License
flutter note
Home Page: https://chen56.github.io/you/flutter_web/
License: MIT License
dart/flutter的热重载技术非常妙,但之前没有关注过此方面,导致页面复杂后,每次dev模式改代码hot reload时,页面都会重新加载到首页,然后手工切换到修改位置,这是对hot reload的浪费啊。
The hot reload technology of Dart/Flutter is very impressive, but I haven't paid attention to this aspect before, which leads to the complexity of dev . Every time I change the code to hot reload in dev mode, the page will be reloaded to the homepage and manually switched to the modified position, which is a waste of hot reload.
Closure: (bool?) => void
Closure: (OtherType) => void
有没有个好招,可以方便通吃的,函数参数的类型变化太大了,如何正确处理?
need notebook develoment mode to read block code in page
比如:
因为note的目录结构和title都可能变化,用其做url,不利于收藏,应为每页生成数字id,保存在其目录中,拖动目录时,id也会被拖走,这样就可以保证page<-->id的稳定关系
可参考https://flutter.cn/docs/development/ui/navigation/url-strategies 去掉#
需要优化一下:
范例:
GestureDetector$Mate(
// todo default value:这种变量型的是不是可以弄一下 kDefaultTrackpadScrollToScaleFactor
trackpadScrollToScaleFactor: kDefaultTrackpadScrollToScaleFactor,
child: const Text("文本变按钮"),
)
用url直接打开收藏夹,或指定初始页面这两个场景,都不是通过点击左边导航树到达页面的,这时需要展开相应的导航树
Notebook 开发模型原型,类似于jupyter/observablehq,但不是web编辑,而是ide+纯代码。
Notebook development model prototype, similar to jupyter/observablehq, but not web editing: idea/code + pure code.
需要从页面中提取源代码信息,并分割为一段的注释片段,形成代码 - 展示 - 代码- 展示这样的形式。
It is necessary to extract the source code information from the page and divide it into a note segment to format:
code
->display
code
->display
pen.cell((context, print) {
print("hello flutter-note , i am a cell");
});
能否这样:
print("hello flutter-note , i am a cell 0 ");
print = print.nextCell_______________();
print("hello flutter-note , i am a cell 1");
支持Set 应不难,是不是可以和ListParam合并为IterableParam?
参数化Sample,按参数生成相应代码(代码模版功能可考虑配合注释或元数据?)
主要探索navigator v2的用法
得看下如何正确显示类名:比如编辑器 ,本应显示:child: Text,结果显示为:minified:ye
模仿web html的默认行为,比如mark down生成的文本,可以在界面上选择复制和搜索
当前未处理,导致很多有缺省值的参数必须填
范例代码:
pen.sampleMate(GestureDetector$Mate(
child: const Text("文本变按钮"),
onTap: () {
/todo UI log,显示到控制台便于一般性的事件展示/
xxxLog.info("被点中");
},
));
每个Sample附带一个参数编辑器(若有参数),可调节Sample内定义的参数化变量,Sample随变量一起变化
current naming : Container --> Container$Mate
which makes it more complicated to use.
Can you just use the original name? if we do,There is a problem :
Page will depend on Mate package and original package:
import 'package:flutter/material.dart' as flutter;
import 'package:note_mate_flutter/material.dart';
How to avoid name conflicts?
Can we only reference one mate package to use all related classes?
1.当前:不识别的Value会被生成为字符串:code.literalString("${param.value}"); 比如set: xxxSet: '{1,2,3}'
2.是不是应该直接生成:code.refer("${param.value}"); 比如set: xxxSet: {1,2,3}
如果是2, 会不会更好些,如果代码生成有问题,提前可以把错误报出来,而不是隐藏在无法copy run的字符串里
note基础架构原型基本就绪,走一波note 试试,先button
参数化Sample,每个Sample配一个编辑器边栏,展示代码
比如,笔记文本中这样的场景:
您把下面范例中父容器Container.width调小些看看:
< 输入框>
参数编辑器的参数树
当前希望简单点:
main分支->直接部署
以后代码稳定了,可以复杂点,main分支和生产分支分开部署
main分支->/main main分支内部review使用
prod分支->/prod 正式生产发布
备注:github pages不支持增量发布,所以每次构建需要一次性弄好一起发pages
Rule -> Navigable?
N -> Page?
因为Page这个单词被flutter占用了,且无法汇入本项目的NavigatorV2实现里,造成命名的混乱,需要重新想一下
markdown outline的设计也够糟糕的,得简化下
note 项目第一次加载快2M了,这玩意太慢了,需要用惰性import试试 效果
比如
Container
how to split page.dart code to notes snippet?
和Editor前一阵设计的范型是不是都是假象,可以去除?鉴于范型的复杂性,无必要就去掉。
顺便重构清理下fixme
cell应该使用分割线的模式将api 收缩为一种,而不是现在的多种
现象:比如写几行notebook后,界面上展示的code就会和实际code错位。
原因:目前基于代码生成的notebook cell 源代码展示,在开发时无法热更新
解决方案:提供动态分析功能,在文件变化后实时更新,只需要存在于dev模式即可
目前已测试过analyzer包可以在flutter macos环境下运转。可以试试
Editor的存在貌似就是为了UI算法的扩展,那如果当需要扩展时提供Editor算法替换接口,是不是就ok了,并不需要现在就分离,搞成两颗类似的继承树:
ObjectParam -> ObjectEditor
ListParam -> ListEditor
Pen.widget()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.