diverpro 1.0.1 copy "diverpro: ^1.0.1" to clipboard
diverpro: ^1.0.1 copied to clipboard

DiverPro is a State Management Library and Dependency Injection package for Flutter. It's my take on Riverpod and Provider.

DiverPro #

DiverPro is a State Management Library and Dependency Injection package for Flutter. It's my take on Riverpod and Provider.

Features #

  • State management
  • Dependency injection
  • Singleton, factory, and lazy singleton support

Getting started #

To use this package, add diverpro as a dependency in your pubspec.yaml file.

dependencies:
  diverpro:
    git:
      url: https://github.com/unix14/diverpro.git
      ref: main
copied to clipboard

Usage #

Registering Instances #

You can register instances, factories, singletons, and lazy singletons using the DiverPro class.

import 'package:diverpro/diverpro.dart';

void main() {
final diverPro = DiverPro();

// Register an instance
diverPro.register<MyClass>(MyClass());

// Register a factory
diverPro.factory<MyClass>(() => MyClass());

// Register a singleton
diverPro.singleton<MyClass>(() => MyClass());

// Register a lazy singleton
diverPro.lazySingleton<MyClass>(() => MyClass());
}

### Retrieving Instances

You can retrieve instances using the get method.

```dart
final myClassInstance = diverPro.get<MyClass>();
copied to clipboard

Clearing Instances #

You can clear all registered instances using the clear method.

DiverPro.clear();
copied to clipboard

Additional information #

Contributions are welcome! Please file issues and submit pull requests on the GitHub repository.

1
likes
0
points
46
downloads

Publisher

verified publisher3p-cups.com

Weekly Downloads

2024.09.26 - 2025.04.10

DiverPro is a State Management Library and Dependency Injection package for Flutter. It's my take on Riverpod and Provider.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, livedatax

More

Packages that depend on diverpro