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

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

example/diverpro_example.dart

import 'dart:math';

import 'package:diverpro/abs/di_container.dart';

void main() {

  // DiContainer.register<Example>(DiverproExample());
  // DiContainer.registerFactory<Example>(() => DiverproExample());
  // DiContainer.registerSingleton<Example>(() => DiverproExample());
  DiContainer.registerLazySingleton<Example>(() => DiverproExample());

  (DiContainer.get<Example>())?.run();
  Future.delayed(Duration(seconds: 1), () =>
    (DiContainer.get<Example>())?.run()
  );


}


abstract class Example {
  void run();
}

class DiverproExample implements Example {

  late final int randIndex = Random().nextInt(30);

  @override
  void run() {
    print('awesome $randIndex');
  }
}
copied to clipboard
1
likes
150
points
46
downloads

Publisher

verified publisher3p-cups.com

Weekly Downloads

2024.09.25 - 2025.04.09

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, livedatax

More

Packages that depend on diverpro