Files
Neo_wallet/neowallet_mobile/lib/Register/policy.dart
Manasit.K 43c32ef6cf init
2024-10-31 15:57:57 +07:00

135 lines
4.0 KiB
Dart

import 'package:cathaypay_mobile/PinCode.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:webview_flutter/webview_flutter.dart';
TextEditingController FullName = TextEditingController();
class PolicyPage extends StatefulWidget {
const PolicyPage({Key? key}) : super(key: key);
@override
State<PolicyPage> createState() => _PolicyPageState();
}
class _PolicyPageState extends State<PolicyPage> {
var controller;
@override
void initState() {
initWebview();
super.initState();
}
initWebview() {
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..loadRequest(Uri.parse('https://www.cathayinter.com/neo-travel-privacy-policy'));
}
bool ok = false;
@override
Widget build(BuildContext context) {
return Scaffold(
// extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.transparent,
leading: CupertinoButton(
onPressed: () {
Navigator.pop(context);
},
child: const Icon(
Icons.arrow_back,
color: Colors.black54,
),
),
elevation: 0,
centerTitle: true,
title: Text(
"Privacy Policy",
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.black,
fontSize: 20,
),
),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
Expanded(child: WebViewWidget(controller: controller)),
Row(
children: [
Padding(
padding: const EdgeInsets.only(top: 20, bottom: 20, right: 10),
child: SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
checkColor: Colors.white,
activeColor: Color(0xff9d001b),
value: ok,
onChanged: (value) {
setState(() {
ok = value!;
});
},
)),
),
Text(
"Accept the Privacy Policy".tr(),
style: GoogleFonts.kanit(
color: Color(0xff65676b),
fontSize: 16,
fontWeight: FontWeight.w300,
),
),
],
),
InkWell(
onTap: ok
? () {
print(ok);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PinCodePage(
login: false,
),
),
);
}
: null,
child: Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: ok ? Color(0xff9d001b) : Colors.grey,
),
child: Text(
"accept".tr(),
textAlign: TextAlign.center,
style: GoogleFonts.kanit(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
),
)
],
),
),
),
);
}
}