diverpro 1.0.2 copy "diverpro: ^1.0.2" to clipboard
diverpro: ^1.0.2 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
0
points
41
downloads

Publisher

verified publisher3p-cups.com

Weekly Downloads

2024.10.07 - 2025.04.21

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