Skip to content

Commit a70425c

Browse files
committed
add AutomaticKeepAliveClientMixin
1 parent 190563e commit a70425c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/gocoder/src/wowz_camera_view.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class WOWZCameraView extends StatefulWidget {
8282
final String iosLicenseKey;
8383
}
8484

85-
class _WOWZCameraViewState extends State<WOWZCameraView> {
85+
class _WOWZCameraViewState extends State<WOWZCameraView> with AutomaticKeepAliveClientMixin{
8686
var _viewId = 0;
8787
MethodChannel _channel;
8888

@@ -136,6 +136,7 @@ class _WOWZCameraViewState extends State<WOWZCameraView> {
136136

137137
@override
138138
Widget build(BuildContext context) {
139+
super.build(context);
139140
return (defaultTargetPlatform == TargetPlatform.android)
140141
? AndroidView(
141142
viewType: _camera_view_channel,
@@ -202,6 +203,9 @@ class _WOWZCameraViewState extends State<WOWZCameraView> {
202203
}
203204
}
204205
}
206+
207+
@override
208+
bool get wantKeepAlive => true;
205209
}
206210

207211
@immutable

0 commit comments

Comments
 (0)