bargain_di 1.0.3

  • Readme
  • Changelog
  • Installing
  • 65

bargain_di #

A poor man's dependency injector. This package will allow you to register classes once and have the ability to quickly initialize them. Main goals are to reduce parameter passing and to allow mocking during testing.

Getting Started #

Register a type and it's initialization function. #

Request for the registered type. #

[0.0.1] - Initial publish. #

  • initial publish.

[1.0.1]. #

  • Added example project

[1.0.2] #

  • Added method to allow fetching of instance by providing type as parameter

[1.0.3] #

  • Simple refactor

Use this package as a library

1. Depend on it

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

  bargain_di: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support 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:bargain_di/bargain_di.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 Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart


  • bargain_di that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

9 out of 9 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/bargain_di.dart. (-0.50 points)

Analysis of lib/bargain_di.dart reported 1 hint:

line 1 col 7: Name types using UpperCamelCase.

Format lib/ObjectFactory.dart.

Run flutter format to format lib/ObjectFactory.dart.

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and bargain_di.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies