Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加个flutter pub run build_runner build快捷指令咋样 #21

Open
RelicOfTesla opened this issue Dec 19, 2024 · 1 comment
Open

加个flutter pub run build_runner build快捷指令咋样 #21

RelicOfTesla opened this issue Dec 19, 2024 · 1 comment

Comments

@RelicOfTesla
Copy link

RelicOfTesla commented Dec 19, 2024

如题。用json_serializable每次更新下结构都得手工打一次指令,挺繁琐的。
快捷指令终端入口,flutter pub run build_runner build / dart pub run build_runner build / dart run build_runner build 都行

如果可以,顺便加一个生成 json_serializable fromJson/ToJson的对应两方法名好了,省得每次还得复制一下

factory xxxxxxx.fromJson(Map<String, dynamic> json) => _$xxxxxxxFromJson(json);
Map<String, dynamic> toJson() => _$xxxxxxxToJson(this);
@YangLang116
Copy link
Owner

使用 idea 自带的 LiveTemplate ,能生成模板代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants