Skip to content

mintware-de/flutter_catalyst

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Flutter Catalyst is retro πŸ₯± Head over to Catalyst Builder, the more powerful and cross platform supported successor of this package. https://github.com/mintware-de/catalyst_builder













































GitHub license Travis Pub Coverage Status

flutter_catalyst

Catalyst is a dependency injection container for the dart language.

The flutter_catalyst project is a port of the catalyst project to provide dependency injection in Flutter projects.

πŸ“¦ Installation

Add the following to your pubspec.yaml:

dependencies:
  flutter_catalyst: ^2.0.0

Then run pub get

πŸ’‘ Usage

Importing

import 'package:flutter_catalyst/flutter_catalyst.dart';

Check out the examples

Supported functions:

Function Description
get registeredTypes Return all registered types
register<T>(T service) Register a service for a specific interface
registerInterface<TB, T extends TB>(T service) Register a service
registerWithDependencies<T>(serviceFactory, dependencies) Register a serviceFactory with dependencies
registerInterfaceWithDependencies<TB, T extends TB>(serviceFactory, dependencies) Register a serviceFactory with dependencies for a specific interface
unregister<T>() Unregister a service
get<T>() Get a service by passing its type as
has<T>() Check if a specific service is registered
wire() Wire the services with dependencies (register*WithDependencies())
destroy() Destroy the service container instance
getFromToken<T>() Get a service which was wrapped inside a InjectionToken

πŸ”¬ Testing

$ pub run test

🀝 Contribute

Feel free to fork and add pull-requests πŸ€“