simple_state_manager 1.0.0+1 copy "simple_state_manager: ^1.0.0+1" to clipboard
simple_state_manager: ^1.0.0+1 copied to clipboard

A package providing state management utilities for Flutter applications. It includes a `Manager` class for managing state changes and a `StateBuilder` widget for efficiently rebuilding parts of the UI [...]

Flutter State Management Package #

This package offers efficient state management utilities for Flutter applications, providing developers with tools to manage and update application states with ease.

Features #

  • Manager Class: A flexible state management class utilizing ValueNotifier for managing and updating application states.
  • StateBuilder Widget: A customizable widget that efficiently rebuilds parts of the UI based on state changes.

Installation #

To use this package in your Flutter project, follow these steps:

  1. Add this package to your pubspec.yaml file:

    dependencies:
      flutter_state_management: ^1.0.0 
    

Usage #

Manager Class #

The Manager class allows you to manage and manipulate the application state. Example usage:

// Create a Manager instance with an initial state
final PaymentManager manager = PaymentManager();

// Update the state
manager.setLoadingTrue();

StateBuilder Widget #

The StateBuilder widget efficiently rebuilds parts of the UI based on state changes. Example usage:

StateBuilder(
  manager: manager,
  builder: (context, state) {
    return Visibility(
      visible: state.isLoading,
      child: CircularProgressIndicator(),
    );
  },
),

Example #

An example implementation of state management using the PaymentManager class is included, demonstrating state updates and UI changes in a PaymentScreen.

License #

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

3
likes
130
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A package providing state management utilities for Flutter applications. It includes a `Manager` class for managing state changes and a `StateBuilder` widget for efficiently rebuilding parts of the UI based on state changes. The `Manager` class allows for the management and manipulation of application state through a `ValueNotifier`, providing methods to emit and update states. The `StateBuilder` widget is a customizable widget that efficiently updates its children based on changes in the managed state.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on simple_state_manager