Search packages, repositories and app categories

Package detailsv2.4.1

disposable_provider

DisposableProvider is thin wrapper of Provider and it calls dispose automatically.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
11.1K
Likes
5
Pub points
160

Install package

flutter pub add disposable_provider

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

DisposableProvider is a lightweight wrapper around the Provider package in Flutter, designed to automatically call the dispose method on provided objects. It simplifies state management by ensuring resources are properly cleaned up when no longer needed, reducing boilerplate and preventing memory leaks. Ideal for managing disposable dependencies like streams, controllers, or subscriptions. Built with simplicity and integration in mind, it works seamlessly within existing Provider-based architectures.

Use cases

  • Managing stream controllers
  • Auto-cleanup of subscriptions
  • Handling disposables in widgets
  • Simplifying state management cleanup
  • Reducing boilerplate in providers

Key features

  • Automatic dispose calls
  • Minimal overhead
  • Seamless Provider integration
  • Supports all platforms
  • Lightweight wrapper

Suitable for

  • Developers using Provider
  • Projects with frequent disposables
  • Apps needing clean resource management
  • Teams prioritizing code simplicity
  • State management with lifecycle awareness

Considerations

  • Requires Provider dependency
  • Limited to disposable objects
  • Not suitable for non-disposable values
  • Best used with stateful widgets
  • Depends on proper usage patterns

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

disposable_provider

DisposableProvider is thin wrapper of Provider and it calls dispose automatically.

Example

  • https://github.com/mono0926/disposable_provider/tree/master/example

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package