Gökhan Belli
Gökhan Belli

Reputation: 31

Flutter webview I want to remove the white background when pulling the app up or down

I want to inactivate the white background when I pull the screen up or down. Thank you.

https://user-images.githubusercontent.com/57063848/112276391-bd5bf900-8c91-11eb-9cec-9933e4ee41df.mp4

import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(MyApp());


class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Welcome to Flutter',
      home: Scaffold(
        body: WebView(
          initialUrl: "https://www.medivizyon.com.tr/in5",
          javascriptMode: JavascriptMode.unrestricted,
          initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow,
          allowsInlineMediaPlayback: true,
          ),
      ),
    );
  }
}

Upvotes: 3

Views: 2667

Answers (1)

Lorenzo Pichilli
Lorenzo Pichilli

Reputation: 3429

The webview_flutter plugin doesn't have an option to disable iOS bounce effect.

You can use my flutter_inappwebview plugin and set the iOS-specific WebView option disallowOverScroll: true. This way it will disable the bouncing of the WebView when the scrolling has reached an edge of the content.

Code example:

child: InAppWebView(
  initialUrlRequest: URLRequest(url: Uri.parse("https://yourwebsite.com")),
  initialOptions: InAppWebViewGroupOptions(
    ios: IOSInAppWebViewOptions(
      disallowOverScroll: true
    )
  ),
)

Upvotes: 2

Related Questions