SHARE
TWEET

Untitled

a guest Dec 8th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import 'package:flutter/material.dart';
  2. import 'package:webview_flutter/webview_flutter.dart';
  3.  
  4. class BantuanScreen extends StatefulWidget {
  5.   static const id = 'BantuanScreen';
  6.   @override
  7.   _BantuanScreenState createState() => _BantuanScreenState();
  8. }
  9.  
  10. class _BantuanScreenState extends State<BantuanScreen> {
  11.   bool isCalled = false;
  12.   @override
  13.   void initState() {
  14.     super.initState();
  15.   }
  16.  
  17.   @override
  18.   Widget build(BuildContext context) {
  19.     return Scaffold(
  20.       body: FutureBuilder(
  21.         future: Future.delayed(Duration(seconds: 1)).then(
  22.           (r) => Future.value('data'),
  23.         ),
  24.         builder: (context, snapshot) {
  25.           if (snapshot.hasData) {
  26.             if (snapshot.connectionState == ConnectionState.done) {
  27.               if (!isCalled) {
  28.                 isCalled = true;
  29.                 return WebView(
  30.                   initialUrl: 'https://www.example-code.com',
  31.                   javascriptMode: JavascriptMode.unrestricted,
  32.                   onWebViewCreated: (controller) => LoadingDialog.show(context),
  33.                   onPageFinished: (value) => LoadingDialog.hide(context),
  34.                 );
  35.               }
  36.             }
  37.           }
  38.           return Container();
  39.         },
  40.       ),
  41.     );
  42.   }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top