I am using Mason Bricks
.
I know, you can also have loop in files. But is there also a way to use loops to create files from given args
?
This is the structure I would like to accomplish:
my_example_flow/
├── view.dart # Contains the MyExampleFlow class
└── views/
├── view_1/
│ └── view.dart # Contains class MyExampleFlowView1
├── view_2/
│ └── view.dart # Contains class MyExampleFlowView2
└── view_3/
└── view.dart # Contains class MyExampleFlowView3
But the number of views should be dynamic.
My yaml
currently looks like this:
name: view_brick
description: Generates views and a flow structure
version: 0.1.0+1
environment:
mason: ">=0.1.0-dev.41 <0.1.0"
vars:
flow_name:
type: string
description: "The name of the general flow"
views:
type: list
description: "Comma-separated list of views (PascalCase, e.g. View1,View2)"
But I am stuck now. How do I get the above structure? Let me know if you need any more information! Is something like this even possible with mason
?
Update:
I also tried adding instead of / as per @Randals’s suggestion. This is what it looks like:
But still, no error, but it’s only generating:
my_example_flow/
├── view.dart
4