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

loadData causes a crash #48

Closed
dianqiugg opened this issue Feb 25, 2019 · 6 comments
Closed

loadData causes a crash #48

dianqiugg opened this issue Feb 25, 2019 · 6 comments
Labels

Comments

@dianqiugg
Copy link

Loading a Web page with loadData causes a crash when you exit the current page while playing the video in the Web page.

@Toolenaar
Copy link

Dont know if this is the same issue. But my app crashes aswell on some pages after navigating back. This is using the default implementation of a 'InAppWebView'

@pichillilorenzo
Copy link
Owner

Can you give me the error logs?? Thanks

@Toolenaar
Copy link

for what its worth the log is found here https://gist.github.com/Toolenaar/72eeef6f6c2483ef3455949f8a8beb09.

This happens when I navigate to a page that hosts the InAppWebView, and then navigate back. Debugger is disconnected, and the app just stops without any exceptions. When I comment out the InAppWebView. The app works fine. (only tested on the ios Simulator)

class FiperWebView extends StatefulWidget {
  final String url;
  FiperWebView({Key key, this.url}) : super(key: key);
  _FiperWebViewState createState() => _FiperWebViewState();
}

class _FiperWebViewState extends State<FiperWebView> {
  InAppWebViewController webView;
  String url = "";
  double progress = 0;

  @override
  dispose(){
    webView.stopLoading();
    super.dispose();
  }
  Widget _buildProgressBar(){
    if(progress != 1.0){
       return LinearProgressIndicator(
                value: progress,
                valueColor: new AlwaysStoppedAnimation<Color>(CustomColors.accent),
                backgroundColor: CustomColors.mainText10,
              );
    }
    return SizedBox(height: 6,); //_kLinearProgressIndicatorHeight
  }
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        _buildProgressBar(),
        Expanded(
          child: InAppWebView(
            initialUrl: widget.url,
            initialHeaders: {},
            initialOptions: {},
            onWebViewCreated: (InAppWebViewController controller) {
              webView = controller;
            },
            onLoadStart: (InAppWebViewController controller, String url) {
              print("started $url");
              setState(() {
                this.url = url;
              });
            },
            onProgressChanged: (InAppWebViewController controller, int progress) {
              setState(() {
                this.progress = progress / 100;
              });
            },
          ),
        )
      ],
    );
  }
}

@ashbressler
Copy link

Copy link

github-actions bot commented Oct 8, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants