flutter_catalyst 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

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:

  flutter_catalyst: ^1.0.0

Then run pub get

💡 Usage #

Importing #

import 'package:flutter_catalyst/flutter_catalyst.dart';

Check out the examples

Supported functions:

get registeredTypesReturn 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 🤓

1.0.2 #

  • Fixed missing usage of ServiceFactory

1.0.1 #

  • pub.dev suggestions implemented

1.0.0 #

  • Initial release


flutter_catalyst examples #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_catalyst: ^1.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_catalyst/flutter_catalyst.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jun 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
Dev dependencies
test 1.3.0