Skip to content

Instantly share code, notes, and snippets.

@xrigau
Created April 16, 2018 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xrigau/202630bd1a996a330c281f76ce9406ab to your computer and use it in GitHub Desktop.
Save xrigau/202630bd1a996a330c281f76ce9406ab to your computer and use it in GitHub Desktop.
Introduction to Redux in Flutter (state.dart)
class AppState {
final List<ToDoItem> toDos;
final ListState listState;
AppState(this.toDos, this.listState);
factory AppState.initial() => AppState(List.unmodifiable([]), ListState.listOnly);
}
enum ListState {
listOnly, listWithNewItem
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment