singlet 1.0.0-dev
singlet: ^1.0.0-dev copied to clipboard
For when you need just one. This package provides Dart macros to easily create singleton classes, ensuring you're not caught wearing the same instance twice.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add singletThis will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
singlet: ^1.0.0-devAlternatively, your editor might support dart pub get. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:singlet/singlet.dart';