Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView is not fullscreen #356

Open
azkdev opened this issue Mar 21, 2019 · 14 comments
Open

WebView is not fullscreen #356

azkdev opened this issue Mar 21, 2019 · 14 comments

Comments

@azkdev
Copy link

azkdev commented Mar 21, 2019

Hi there, i want just confirm is this a bug or not?
Maybe I'm doing something wrong? Or maybe this is a Xiaomi specific bug when renders webview widget.

red offset on the right and bottom.

Screenschot

in the UI is nothing special:

return MaterialApp(
  home: Scaffold(
    body: SafeArea(
      child: WebviewScaffold(
         url: initialUrl,
         initialChild: Container(
           color: Colors.red,
             child: Center(
               child: Text("Loading..."),
              ),
            ),
          ),
        bottom: true,
        left: true,
        right: true,
        top: true,
      ),
    ),
 );

Thank you for help in advance =)

@littlesalt
Copy link

littlesalt commented Mar 26, 2019

@azkdev I have encountered the same problem.Have you solved it?
@sethladd @ypelud @pedia

@azkdev
Copy link
Author

azkdev commented Mar 26, 2019

@littlesalt hi there, i have no idea yet how can i solve this.
but if i put a bottom navigation bar, the webview will cover all the screen without issues.
maybe this is only a problem with Xiaomi? =)
tested with iphone, samsung, meizu and it works perfectly =)

@littlesalt
Copy link

@azkdev not only xiaomi, huawei has same problem!

@littlesalt
Copy link

@azkdev What is the code to solve issues?

@AlexV525
Copy link

AlexV525 commented Mar 26, 2019

Hi, I found the same problem yesterday on OnePlus 3/6T with the 1px empty, but some of my friends using Xiaomi has no empty space.
右侧和底部有1px的空白,跟随背景色变化。有些设备有,有些设备没有。

@littlesalt
Copy link

@AlexVincent525 是的,看了一下源码,没太搞明白。

@charafau
Copy link
Collaborator

charafau commented Apr 3, 2019

I'm happy to merge some fixes, but it works on my device so I cannot reproduce it.

@AlexV525
Copy link

AlexV525 commented Apr 3, 2019

@charafau Thanks for your reply, i might try update package to see if this solved.

@AlexV525
Copy link

AlexV525 commented Apr 4, 2019

@charafau Sorry this problem still exist. Perhaps it will happened when display size was changed?

@charafau
Copy link
Collaborator

@AlexVincent525 How can display size change dynamically ?

@AlexV525
Copy link

@charafau This issue isn't shown in latest version, so idk if there's still some of the users experiencing this or not.

@vlowe85
Copy link

vlowe85 commented Aug 1, 2019

I get the same on Android emulator on latest version.

I added this to make it fullscreen.

    flutterWebviewPlugin.onStateChanged.listen((state) {
      if(state.type == WebViewState.finishLoad) {
        flutterWebviewPlugin.resize(Rect.fromLTRB(
          MediaQuery.of(context).padding.left, /// for safe area
          MediaQuery.of(context).padding.top, /// for safe area
          MediaQuery.of(context).size.width + 1, /// add one to make it fullscreen
          MediaQuery.of(context).size.height,
        ));
      }
    });

@JarvanMo
Copy link

JarvanMo commented Nov 2, 2019

I get the same on Android emulator on latest version.

I added this to make it fullscreen.

    flutterWebviewPlugin.onStateChanged.listen((state) {
      if(state.type == WebViewState.finishLoad) {
        flutterWebviewPlugin.resize(Rect.fromLTRB(
          MediaQuery.of(context).padding.left, /// for safe area
          MediaQuery.of(context).padding.top, /// for safe area
          MediaQuery.of(context).size.width + 1, /// add one to make it fullscreen
          MediaQuery.of(context).size.height,
        ));
      }
    });

got the same problem on Android emulator.

@Rafi404
Copy link

Rafi404 commented Sep 3, 2021

If you are using app bar for that page, remove the appbar to stretch the WebviewScaffold into full screen .

And also wrap the widget using a container and set the width and height related to the device using MediaQuery.

Eg:

body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: YouVimPlayer('vimeo', '588216519')),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants