Skip to content

Commit

Permalink
Fix: Android Flickering Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RGLie committed Nov 27, 2024
1 parent f33baed commit 9fd2ce0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/widgets/in_article_web_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,17 @@ class _InArticleWebViewState extends State<InArticleWebView> {
_webViewController = controller;
}

@override
void dispose() {
_webViewController.removeJavaScriptChannel('Toaster');
_webViewController.clearCache();
super.dispose();
}


@override
Widget build(BuildContext context) {
late WebViewWidget webViewWidget;
final themeProvider = Provider.of<ThemeProvider>(context);

// 안드로이드 플랫폼의 경우 displayHybridComposition: true로 설정한다
// 안드로이드의 경우 이렇게 하지않으면 웹뷰 crash 문제가 발생
Expand All @@ -214,7 +221,6 @@ class _InArticleWebViewState extends State<InArticleWebView> {
webViewWidget = WebViewWidget.fromPlatformCreationParams(
params: AndroidWebViewWidgetCreationParams(
controller: _webViewController.platform,
displayWithHybridComposition: true,
gestureRecognizers: {
Factory<OneSequenceGestureRecognizer>(() {
TapGestureRecognizer tabGestureRecognizer = TapGestureRecognizer();
Expand Down

0 comments on commit 9fd2ce0

Please sign in to comment.