You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
62 lines
1.5 KiB
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<TermsUse> {
|
|
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(),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|