You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tool to generate index/exports files also known as barrel files for all Dart files in a directory.
19
17
20
-
## Usage Instructions
18
+
## How to Use
19
+
20
+
### With Visual Studio Code
21
+
22
+
1. Install the extension here: https://marketplace.visualstudio.com/items?itemName=Dev-Cetera.dev-cetera-df-support-commands
23
+
2. Right-click on any folder in your project and select `🔹 Generate Dart Barrel File`.
24
+
3. Alternatively, right-click a folder and select `"Open in Integrated Terminal"` then run `--barrel` in the terminal.
25
+
4. This will generate a barrel file matching the folder’s base name, e.g. `_src.g.dart`.
21
26
22
-
1. No need to add this package to your `pubspec.yaml`.
23
-
2. Activate it by running: `dart pub global activate df_generate_dart_indexes`.
24
-
3. In your project, open a terminal in the desired folder (Tip: In VS Code, right-click a folder and select `"Open in Integrated Terminal"`).
25
-
4. Run `--barrel` to generate a barrel file matching the folder’s base name, e.g. `_src.g.dart` or `_widgets.g.dart`.
27
+
### Without Visual Studio Code
26
28
27
-
### Note:
29
+
1. Install this tool by running: `dart pub global activate df_generate_dart_indexes`.
30
+
2. In your project, open a terminal at the desired folder, e.g. `cd src`.
31
+
3. Run `--barrel` to generate a barrel file matching the folder’s base name, e.g. `_src.g.dart`.
32
+
33
+
### Note
28
34
29
35
Files that start with an underscore, files in folders that start with an underscore, and generated files (those with the `.g.dart` extension) will be omitted from the generated barrel file.
30
36
31
-
### Generated File Example:
37
+
### Generated File Example
32
38
33
39
The file barrel file will look something like this, and is generated from [this default template file](https://github.com/dev-cetera/df_generate_dart_indexes/blob/main/templates/template.dart.md):
Copy file name to clipboardExpand all lines: _README_CONTENT.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,25 @@
1
-
## Summary
2
-
3
1
A tool to generate index/exports files also known as barrel files for all Dart files in a directory.
4
2
5
-
## Usage Instructions
3
+
## How to Use
4
+
5
+
### With Visual Studio Code
6
+
7
+
1. Install the extension here: https://marketplace.visualstudio.com/items?itemName=Dev-Cetera.dev-cetera-df-support-commands
8
+
2. Right-click on any folder in your project and select `🔹 Generate Dart Barrel File`.
9
+
3. Alternatively, right-click a folder and select `"Open in Integrated Terminal"` then run `--barrel` in the terminal.
10
+
4. This will generate a barrel file matching the folder’s base name, e.g. `_src.g.dart`.
11
+
12
+
### Without Visual Studio Code
6
13
7
-
1. No need to add this package to your `pubspec.yaml`.
8
-
2. Activate it by running: `dart pub global activate df_generate_dart_indexes`.
9
-
3. In your project, open a terminal in the desired folder (Tip: In VS Code, right-click a folder and select `"Open in Integrated Terminal"`).
10
-
4. Run `--barrel` to generate a barrel file matching the folder’s base name, e.g. `_src.g.dart` or `_widgets.g.dart`.
14
+
1. Install this tool by running: `dart pub global activate df_generate_dart_indexes`.
15
+
2. In your project, open a terminal at the desired folder, e.g. `cd src`.
16
+
3. Run `--barrel` to generate a barrel file matching the folder’s base name, e.g. `_src.g.dart`.
11
17
12
-
### Note:
18
+
### Note
13
19
14
20
Files that start with an underscore, files in folders that start with an underscore, and generated files (those with the `.g.dart` extension) will be omitted from the generated barrel file.
15
21
16
-
### Generated File Example:
22
+
### Generated File Example
17
23
18
24
The file barrel file will look something like this, and is generated from [this default template file](https://github.com/dev-cetera/df_generate_dart_indexes/blob/main/templates/template.dart.md):
0 commit comments