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

A simple and lightweight service locator reference library with overrides support for Dart.

example/ref_core_example.dart

import 'dart:developer';

import 'package:ref_core/ref_core.dart';

void main() {
  // Create a reference of [Something]
  final refSomething = Ref(Something.new);

  // Get a instance of [Something] reference
  final something = refSomething();

  // Show a log debug mode of instance of [Something]
  log('$something');
}

// Something class wrapped with [Ref] in main
class Something {
  @override
  String toString() {
    return 'Instance of Something';
  }
}
1
likes
160
pub points
18%
popularity

Publisher

verified publishereronsoft.com

A simple and lightweight service locator reference library with overrides support for Dart.

Homepage
Repository (GitHub)
View/report issues

Topics

#service-locator #dependency-injection #reference #ref #testable

Documentation

API reference

License

MIT (license)

More

Packages that depend on ref_core