Skip to content

A collection of dart independent packages that offer extensions for various Dart classes

License

Notifications You must be signed in to change notification settings

LaMobilery/oss_dart_extensions

Repository files navigation

lamob_dart_extensions

Description

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.

Installation

Contribute

To contribute to lamob_dart_extensions into your project using Melos, follow these steps:

  1. Ensure you have Melos installed. If not, you can install it by running:
dart pub global activate melos
  1. Fork the project in your workspace and clone the fork on your machine
  2. In the project, bootstrap it
melos bs

See more on melos website

  1. Each independent package is provided in packages

Create a package

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

Add an extension

  1. In your package, in src, create a file with the name of your extension, for example first_capital_letter.dart
  2. 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 !

  1. Create a test file in test folder with the name of your extension then _test.dart
  2. Add your method in the extension's README.md file with a short description

For example see the extensions_string package

  1. Once you're good, open a pull request

About

A collection of dart independent packages that offer extensions for various Dart classes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages