A builder package for automatically exporting Dart files in a project based on globs.
The builder looks for files with the
.glex extension and processes them similarly to gitignore files, except backwards:
Make sure you have this package and
build_runner as dev dependencies, then run
pub run build_runner buildor
pub run build_runner watchfor a standalone package or command-line application
flutter packages pub run build_runner buildor
flutter packages pub run build_runner watchfor a Flutter project
webdev servefor a web project
The output file has the extension
.g.dart and simply exports all included files.
A common use case would be an
everything.glex file in the
lib folder of an application package:
And if you want to exclude generated files:
Then, from a Dart file in
import 'everything.g.dart'; // Some code that uses other code from elsewhere in your package
part ofdirectives, which is not allowed because they aren't standalone libraries. Unfortunately, the method on
BuildStepfor determining whether or not a file is a library is broken and always returns false. Or more technically a
Futurethat completes with false. Whatever. The point is, it doesn't work and it's dumb.
CHANGELOGto indicate that they do not, in fact, work
Add this to your package's pubspec.yaml file:
dependencies: glob_export: ^0.1.3
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Aug 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
Platform components identified in package:
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
glob_export.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.2.0 <3.0.0|