Is there anyway to make webview load while splash screen is active?

Viewed 476

I want webview widget load the url while the splash screen is active how can I make it

Splash screen code:

class _SplashScreenState extends State<SplashScreen> {
final int splashDuration = 4;
startTime() async {
return Timer(
    Duration(seconds: splashDuration),
        () {

      Navigator.of(context).pushReplacementNamed('/webviewUi');
    }
);
}


@override
Widget build(BuildContext context) {

return  Scaffold(
    appBar: PreferredSize(
        child: AppBar()
    ),

    body: Image.asset('assets/splash-c2.jpg')
);
}
}

//webview code:
@override
Widget build(BuildContext context) {
return new MaterialApp(

body:   WebView(
                initialUrl: url,
                javascriptMode: JavascriptMode.unrestricted,

              )
);

now how can I make webview load url when spalsh screen is active or start duration time and how can I optmaize preformance of webview like making load taim less than before

0 Answers
Related