File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
sample_app/lib/screens/user_feed/polls/show_poll Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,14 @@ class ShowPollWidget extends StatefulWidget {
2020 State <ShowPollWidget > createState () => _ShowPollWidgetState ();
2121}
2222
23- class _ShowPollWidgetState extends State <ShowPollWidget > {
23+ class _ShowPollWidgetState extends State <ShowPollWidget >
24+ with AutomaticKeepAliveClientMixin {
2425 StreamFeedsClient get client => locator <StreamFeedsClient >();
2526 late Activity activity;
2627
28+ @override
29+ bool get wantKeepAlive => true ;
30+
2731 @override
2832 void initState () {
2933 super .initState ();
@@ -55,12 +59,12 @@ class _ShowPollWidgetState extends State<ShowPollWidget> {
5559
5660 @override
5761 Widget build (BuildContext context) {
62+ super .build (context);
63+
5864 return StateNotifierBuilder (
5965 stateNotifier: activity.notifier,
6066 builder: (context, state, child) {
61- final poll = state.poll;
62- if (poll == null ) return const SizedBox .shrink ();
63-
67+ final poll = state.poll ?? widget.poll;
6468 return PollMessage (
6569 poll: poll,
6670 activity: activity,
You can’t perform that action at this time.
0 commit comments