solace_flowz 0.0.1 copy "solace_flowz: ^0.0.1" to clipboard
solace_flowz: ^0.0.1 copied to clipboard

state management package built on top of InheritedWidget.

SolaceFlowz #

SolaceFlowz is a simple state management package for Flutter based on the InheritedWidget and StatefulWidget classes.

Installation #

Add the following line to your pubspec.yaml file:

dependencies: solace_flowz: ^1.0.0

Usage #

1-Wrap your widget tree with a SolaceFlowz widget:

SolaceFlowz( value: myValue, builder: (BuildContext context, int value, Widget child) { // Return a widget that depends on the value. }, child: MyChildWidget(), )

2-Use the SolaceFlowz.of static method to access the value from any child widget:

int myValue = SolaceFlowz.of<int>(context);

3-Update the value by calling the setState method on the SolaceFlowz widget:

SolaceFlowz.of<int>(context).setState(() { SolaceFlowz.of<int>(context).value = 42; });

Example #

Here's a simple example that shows how to use SolaceFlowz to manage the state of a counter:

import 'package:flutter/material.dart'; import 'package:solace_flowz/solace_flowz.dart';

void main() { runApp(MyApp()); }

class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: SolaceFlowz

License #

This package is released under the MIT License. See LICENSE for details.

20
likes
0
pub points
0%
popularity

Publisher

unverified uploader

state management package built on top of InheritedWidget.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on solace_flowz