Skip to content

Instantly share code, notes, and snippets.

View HenriqueNas's full-sized avatar
:shipit:
damn.. Dart is really cool

Henrique Nascimento HenriqueNas

:shipit:
damn.. Dart is really cool
View GitHub Profile
@HenriqueNas
HenriqueNas / page_state_notifier.dart
Last active July 4, 2024 16:53
Easiest way to manager your Flutter page/widget state without any package.
import 'package:flutter/material.dart';
/// Function that receives a [BuildContext] and a [PageState] and returns a [Widget]. </br>
typedef WidgetBuilder = Widget Function(BuildContext context, PageState state);
/// Helper class to manage the state of a page/widget. </br>
class PageStateNotifier<Error> extends ChangeNotifier {
PageState _state = PageState.idle;
/// The current [PageState].