resolve 0.1.1

  • README.md
  • Example
  • Installing
  • Versions
  • new42

Resolve

Managing dependencies with simple Widgets.

Features:

  • Inversion of control, you define how to instantiate objects from outside
  • Really integrated with the Flutter widget composability approach
  • Scoped resolution since Resolvers and Configurators can be overriden wherever in the tree
  • Generic widgets so you can use the configuration and instances you want

Examples

Quickstart

enum Configuration {
  development,
  production,
}

class Bootstrapper extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        return Configurator<Configuration>(
            configuration: Configuration.production,
            child: Resolver<String, Configuration>(
            creator: ((context,config) => config == Configuration.development ? "Debug now" : "Online"),
            child: );
    }
}

class HomePage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
        final label = Resolver.of<String>(context);
        return Text(label);
    }
}

FAQ

Can I use it with the BLoC pattern ?

Absolutely, I created it first for it, but wanted a more generic approach combined with dependency configuration. The solution is just an extended part of a typical bloc provider.

Don't forget to add a disposer for your blocs when registering them into the Resolver to close all exposed streams!

What if I have a pure Dart project ?

You can still use dioc which is a more traditionnal approach to inversion of control.

example/README.md

resolver_example

A new Flutter project.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  resolve: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:resolve/resolve.dart';
  
Version Uploaded Documentation Archive
0.1.1 Dec 6, 2018 Go to the documentation of resolve 0.1.1 Download resolve 0.1.1 archive
0.1.0 Dec 6, 2018 Go to the documentation of resolve 0.1.0 Download resolve 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
42
Learn more about scoring.

We analyzed this package on Dec 6, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance issues and suggestions

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test ^1.3.3