import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:teso/util/SizeConfig.dart'; import 'package:teso/util/consts.dart'; import 'package:webview_flutter/webview_flutter.dart'; class TermsUse extends StatefulWidget { @override _TermsUseState createState() => _TermsUseState(); } class _TermsUseState extends State { bool loading = true; @override void initState() { super.initState(); if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView(); } loaded() { setState(() { loading = false; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( centerTitle: true, title: Text( "End User Agreement", style: TextStyle( fontSize: SizeConfig.blockSizeHorizontal * 3.5, ), ), ), body: Stack( children: [ WebView( // javascriptMode: JavascriptMode.unrestricted, initialUrl: serverwebTerms, onPageFinished: (url) => loaded(), ), loading ? Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height, child: Center( child: CupertinoActivityIndicator( animating: true, radius: 20, ), ), ) : Container(), ], ), ); } }