lamob_dart_extensions
is an open-source project aimed at providing Dart developers with a comprehensive list of independent packages that offer extensions for various Dart classes.
These extensions are designed to enhance the functionality and usability of the Dart programming language, making it easier for developers to implement common tasks, improve code readability, and increase development efficiency.
By leveraging these extensions, developers can write more concise and expressive code, tapping into a rich ecosystem of reusable components.
To contribute to lamob_dart_extensions
into your project using Melos, follow these steps:
- Ensure you have Melos installed. If not, you can install it by running:
dart pub global activate melos
- Fork the project in your workspace and clone the fork on your machine
- In the project, bootstrap it
melos bs
See more on melos website
- Each independent package is provided in packages
In packages run
dart create -t package extensions_<CLASSNAME>
For example:
- dart create -t package extensions_string
- dart create -t package extensions_widget
- dart create -t package extensions_iterable
- ...
More in dart package
In the newly created package, in the pubspec.yaml, update the
- In your package, in src, create a file with the name of your extension, for example
first_capital_letter.dart
- Create your extension
extension FirstCapitalLetter on String {
String firstCapitalLetter({
bool lowerCaseAfter = false,
}) {
if (isEmpty) return '';
return this[0].toUpperCase() +
(lowerCaseAfter ? substring(1).toLowerCase() : substring(1));
}
}
Make sure you add documentation on your extension !
- Create a test file in test folder with the name of your extension then
_test.dart
- Add your method in the extension's README.md file with a short description
For example see the extensions_string package
- Once you're good, open a pull request