utopia_di 0.3.0 copy "utopia_di: ^0.3.0" to clipboard
utopia_di: ^0.3.0 copied to clipboard

Light & Fast Dart Dependency Injection library. Easy to use and powerful for all kinds of needs, with no external dependencies.

example/utopia_di_example.dart

import 'package:utopia_di/utopia_di.dart';

void main() {
  final di = DI.i;
  di.set(Dependency('resource1', () => 'this is resource 1'));
  di.set(D('number1', () => 10));
  di.set(
    D(
      'dependentResource',
      (String resource1, int number1) => '$resource1 and $number1',
      dependencies: ['resource1', 'number1'],
    ),
  );

  print(di.get('resource1'));
  print(di.get('number1'));
  print(di.get('dependentResource'));
}
2
likes
160
pub points
2%
popularity

Publisher

verified publisherappwriters.dev

Light & Fast Dart Dependency Injection library. Easy to use and powerful for all kinds of needs, with no external dependencies.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on utopia_di