AkariNote
  • 主页 / Home
  • 开发 / Development
  • UI / UX
  • 关于 / About
AkariNote

试了一下Dart的试验性功能Macros

2024年Google IO上Flutter开发团队演示了一个新功能,用于快速生成代码的需求,比如JSON序列化。他们说这是对开发者提出的要添加data class这一新特性的回应。确实在之前的开发过程中遇到很多处理数据模型时遇到很多问题,比如在特定环境下需要写深拷贝代码,还有同事有时候改了数据类型结构也不跑一遍build runner代码,然后自己写了一些乱七八糟的实现。build runner的运行效率也不尽如人意,所以我来试试看这个Macros。 怎么配置我就不说了,在官网可以找到。我读了一圈发现几个比较感兴趣的地方,比如他们称这种实现方式为“静态元编程”: Metaprogramming refers to code that can do this—code that operates on other code as if it were data. It can take code in as parameters, reflect over it, inspect it,
13 10月 2024 4 min read
开发 / Development

[Flutter] Difference between globalPosition and localPosition in DragUpdateDetails

Search results from flutter.dev and Stackoverflow only have words talking about that "The global position at which the pointer contacted the screen.", and "The local position in the coordinate system of the event receiver at which the pointer contacted the screen.". It's not
25 9月 2023 1 min read
Page 1 of 1
AkariNote © 2026
Powered by Ghost