Skip to content

Instantly share code, notes, and snippets.

@nguyenchilong
Last active July 5, 2020 09:09
Show Gist options
  • Save nguyenchilong/84a7380db74a14de9ea060851c70f5c4 to your computer and use it in GitHub Desktop.
Save nguyenchilong/84a7380db74a14de9ea060851c70f5c4 to your computer and use it in GitHub Desktop.
class AppState {
final IndexState indexState;
final OfferState offerState;
final NotificationState notificationState;
final OrderState orderState;
final AddressState addressState;
final NewsState newsState;
final AuthState auhtState;
final ProductState productState;
final QuestionState questionState;
final PhotoState photoState;
final CategoryState categoryState;
final CartState cartState;
final ChatState chatState;
AppState({
@required this.productState,
});
factory AppState.initial() {
return AppState(
productState: ProductState(
allProducts: Map(),
myProducts: Map(),
product: null,
searchProducts: Map(),
products: Map(),
status: Map(),
page: Page(),
),
);
}
// Make sure that method have data you want to show in debug
toJson() {
return {
'productState': this.productState,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment