dependon 0.0.2 copy "dependon: ^0.0.2" to clipboard
dependon: ^0.0.2 copied to clipboard

outdated

Dependency injection management.

A simple light-weight dependency injection manager for Flutter.

Features #

  • Global dependency injection accross the application.
  • Lazy initialization.
  • Simple and light-weight.
  • Ready-to-go.

Getting started #

  1. Add the dependency to your pubspec.yaml.
  2. Setup your components at the start of your application:
import 'package:dependon/dependon.dart';

factory(() => UserProvider());
singleton<UserRepository>(() => UserRepositoryImpl(get()));
  1. Use it wherever you want.
import 'package:dependon/dependon.dart';

final UserRepository userRepository = get();
// or
final userRepository = get<UserRepository>();

Usage #

import 'package:dependon/dependon.dart';

void main() async {
  factory(() => UserProvider());
  singleton<UserRepository>(() => UserRepositoryImpl(get()));

  // retrieve instance
  final UserRepository userRepository = get();
}

Additional information #

This is an alpha release and this package is still in development. Not recommended for production.

2
likes
0
points
27
downloads

Publisher

verified publisherniun.dev

Weekly Downloads

Dependency injection management.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on dependon