As the question is self-explaining, assume in the folder I have multiple Dart file. Instead of importing file by file (for example import 'screens/screen_1.dart'; import 'screens/screen_2.dart';...
), I want to batch import (such as import 'screens/*.dart'
) but it doesn't work.
Do you know Dart allows us to do such batch import?
Dart imports don't support importing multiple files at once.
What you can do is creating a library that exports other libraries
screens.dart
export 'screens/screen_1.dart';
export 'screens/screen_2.dart';
export 'screens/screen_3.dart';
foo.dart
import 'screens.dart';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With