FLUTTER ECOSYSTEM

get_it

Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"

Latest version
9.2.1
30-day downloads
1.7M
Likes
4.7K
Pub points
150

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

GetIt is a lightweight, simple service locator for Dart and Flutter that enables dependency injection by decoupling interfaces from their concrete implementations. It allows developers to register and retrieve services globally throughout the app with minimal boilerplate. GetIt supports lazy instantiation, factory registration, and easy testing through mocking. It's ideal for managing shared dependencies like repositories, APIs, or state managers across different parts of an application.

Use cases
  • Managing shared services across multiple widgets
  • Testing with mocked dependencies
  • Injecting repositories and API clients
  • Simplifying state management setup
  • Decoupling UI from business logic
Key features
  • Simple API with minimal setup
  • Supports lazy and eager instantiation
  • Factory and singleton registration
  • Easy to mock for unit testing
  • Lightweight and fast
Suitable for
  • Small to medium-sized Flutter apps
  • Developers new to dependency injection
  • Projects needing quick DI integration
  • Teams prioritizing simplicity over complexity
  • Apps requiring testable service layers
Considerations
  • Not suitable for large-scale enterprise apps with complex DI needs
  • Manual registration can lead to runtime errors if not managed carefully
  • Limited built-in lifecycle management compared to advanced DI frameworks
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add get_it

Categories

Source repository

Related projects

Rankings