If you are used to watching cowboy movies 🤠, then barrels shouldn't be new to you first off you see the men with nice-looking hats then ranches with beautiful horses and most importantly barrels filled with liquors. But am not talking movies, today am talking barrels as it relates to software development.
Dev Vs Import Statements
How often do you write ☝🏿 while coding 🤔? you probably have lost count, I mean there is always something to import from somewhere. but sometimes these Import statements can be so much that it gets confusing.
Barrel File to the rescue
In the case of dart/flutter one can create a dart file say widgets.dart, export all classes and resources to that file and all you need to do is import that single dart file and you have access to whatever you need, like in the code snippet below.
export 'user_profile_image.dart'; export 'upcoming_rooms.dart'; export 'rooms_card.dart'; export 'room_user_profile.dart'; export 'package:flutter_clubhouse_ui/config/palette.dart';
I find this very resourceful as it keeps my code-space clean and organised.
Adios for now 😊...