felangel / felangel/mason

Question: Is it possible to include a line of code in a file that already exists?

未关闭
#574 8 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
Dart
星标
1.1k
派生
113
PR 合并指标
30 天内没有已合并 PR

描述

Can someone help me with this please?
I need to be able to put a line of code inside a class of a file that already exists.

Example:

I have the file Routes.dart
```
class Routes {
static const INITIAL = '/';
static const INTRO = '/intro';
}
```

And I need to put this line inside the Routes class in Routes.dart
```
static const {{name.constantCase()}} = '/{{name.paramCase()}}';
```

Let's say the name of the route is "generic route"

So the complete file would be
```
class Routes {
static const INITIAL = '/';
static const INTRO = '/intro';
static const GENERIC_ROUTE = '/generic-route';
}
```

I appreciate who can help me.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。