From 61c6e637ec94841e7e6322973cb22c010824a9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malo=20L=C3=A9on?= Date: Thu, 14 Jul 2022 11:55:49 +0100 Subject: [PATCH] doc(bloc_helper): update readme --- packages/wyatt_bloc_helper/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/wyatt_bloc_helper/README.md b/packages/wyatt_bloc_helper/README.md index f854493e..9e18fc59 100644 --- a/packages/wyatt_bloc_helper/README.md +++ b/packages/wyatt_bloc_helper/README.md @@ -116,6 +116,19 @@ Widget onBuild(BuildContext context, CounterState state) { } ``` +If needed, you can wrap what depends on the state with the function `onWrap`. + +```dart +@override +Widget onWrap(BuildContext context, Widget child) { + return Scaffold( + appBar: AppBar( + title: const Text('Title'), + ), + body: child, + ); +``` + > Note: you can override `onBuild`, but also `onListen`, `shouldBuildWhen` and `shouldListenWhen` methods. ### Both BlocProvider and BlocConsumer