get_it_di_global_variable 0.0.6 copy "get_it_di_global_variable: ^0.0.6" to clipboard
get_it_di_global_variable: ^0.0.6 copied to clipboard

A tiny Dart package that exposes a global instance of GetIt (sl) for easy and consistent dependency injection across your Flutter or Dart project.

example/main.dart

// Example Service
import 'package:get_it_di_global_variable/get_it_di.dart';

class MyService {
  void performAction() {
    print("Action performed by MyService!");
  }
}

void setup() {
  // Registering the service using GetIt
  sl.registerLazySingleton<MyService>(() => MyService());
}

void main() {
  setup(); // Register the services

  // Accessing the registered service
  final myService = sl<MyService>();

  // Using the service
  myService.performAction();
}
1
likes
150
points
630
downloads

Publisher

unverified uploader

Weekly Downloads

A tiny Dart package that exposes a global instance of GetIt (sl) for easy and consistent dependency injection across your Flutter or Dart project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, get_it

More

Packages that depend on get_it_di_global_variable