yet_another_state_holder 0.3.1 copy "yet_another_state_holder: ^0.3.1" to clipboard
yet_another_state_holder: ^0.3.1 copied to clipboard

retractedunlisted

Yet another state holder.

example/lib/example.dart

import 'package:yet_another_state_holder/yet_another_state_holder.dart';

class UiState {
  final bool isLoaded;

  UiState({required this.isLoaded});

  UiState copyWith({bool? isLoaded}) =>
      UiState(isLoaded: isLoaded ?? this.isLoaded);
}

class Bloc extends StateHolder<UiState> {
  Bloc() : super(UiState(isLoaded: false)) {
    _init();
  }

  void _init() async {
    await Future.delayed(const Duration(seconds: 1));
    setState((state) => state.copyWith(isLoaded: true));
  }
}
1
likes
0
points
9
downloads

Publisher

unverified uploader

Weekly Downloads

Yet another state holder.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta, rxdart, shared_preferences, state_notifier

More

Packages that depend on yet_another_state_holder