custom_state 0.0.3 copy "custom_state: ^0.0.3" to clipboard
custom_state: ^0.0.3 copied to clipboard

discontinued

Custom state is a flutter widget can access ui with custom state

Getting started #

Add dependency to your pubspec.yaml:

custom_state: 'any'

Usage #

Import packages:

import 'package:custom_state/custom_state.dart';

CustomView: #

enum YourState{ initial, loading, done }
CustomStateView<YourState>(
    key: stateKey,
    stateBuilder: (context, states, customState) {
        if (states.contains(YourState.initial)) {
            return Text(
                'initial'
                );
        } else if (states.contains(YourState.loading)){
            return Text(
                'Loading'
                );
        } else {
            return Text(
            'Done'
            );
        } 
    },
),
  • Change state
final GlobalKey<CustomState<YourState>> stateKey = GlobalKey();
...
stateKey.currentState?.replaceCustomState({YourState.loading});

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
90
pub points
68%
popularity

Publisher

unverified uploader

Custom state is a flutter widget can access ui with custom state

Repository (GitHub)
View/report issues

Documentation

API reference

License

AGPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on custom_state