resource_provider 1.0.0 copy "resource_provider: ^1.0.0" to clipboard
resource_provider: ^1.0.0 copied to clipboard

A simple container for getting resources and creating them if required.

Resource Provider #

A simple resource provider to get objects by type (or by both name and type). Right now it eagerly creates an object on get.

Features #

Resource providers maintains collection of resources in its instance and all of them can be disposed after usage.

Getting started #

  1. Add dependency with dart pub add resource_provider or flutter pub add resource_provider.

  2. Import the package

import 'package:resource_provider/resource_provider.dart';
  1. Create an instance of ResourceProvider.
final resource = ResourceProvider();
  1. Get a resource (Will always return same instance).
resource(ResourceData(onCreate: someValueCallback))}
  1. You can update the returning resource's value by providing a value.
resource(ResourceData(onCreate: someValueCallback), value: someUpdatedValue)}
  1. clear resources after usage to dispose.
resource.clear(); // or resource.dispose();
1
likes
150
pub points
0%
popularity

Publisher

verified publishermagnificsoftware.com

A simple container for getting resources and creating them if required.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

meta, quiver

More

Packages that depend on resource_provider