505 lines
18 KiB
Dart
505 lines
18 KiB
Dart
import 'package:cathaypay_mobile/Register/camera_card_id.dart';
|
|
import 'package:cathaypay_mobile/Register/register_data.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class RegisterPage extends StatefulWidget {
|
|
RegisterPage({Key? key, required this.isPassport}) : super(key: key);
|
|
final bool isPassport;
|
|
|
|
@override
|
|
State<RegisterPage> createState() => _RegisterPageState();
|
|
}
|
|
|
|
class _RegisterPageState extends State<RegisterPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
// extendBodyBehindAppBar: true,
|
|
|
|
appBar: AppBar(
|
|
backgroundColor: Colors.transparent,
|
|
actions: [
|
|
IconButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
icon: const Icon(
|
|
Icons.clear,
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
],
|
|
elevation: 0,
|
|
centerTitle: true,
|
|
title: Text(
|
|
"Verify your identity".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Colors.black,
|
|
fontSize: 20,
|
|
),
|
|
),
|
|
),
|
|
body: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
register_step(index: 1),
|
|
Padding(
|
|
padding: const EdgeInsets.all(20.0),
|
|
child: Text(
|
|
widget.isPassport?"Scan Passport".tr(): "Scan ID card".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff65676b),
|
|
fontSize: 16,
|
|
),
|
|
),
|
|
),
|
|
widget.isPassport?Container(
|
|
width: MediaQuery.of(context).size.width * 0.6,
|
|
child: Image(
|
|
image: AssetImage('images/register/passport.png'),
|
|
fit: BoxFit.cover,
|
|
),
|
|
): Container(
|
|
width: MediaQuery.of(context).size.width * 0.8,
|
|
child: Image(
|
|
image: AssetImage('images/register/idcard.png'),
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
widget.isPassport?Container(): Container(
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(
|
|
width: 156,
|
|
child: Text(
|
|
"Card front".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff65676b),
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
),
|
|
SizedBox(width: 22),
|
|
SizedBox(
|
|
width: 156,
|
|
child: Text(
|
|
"Back of card".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff65676b),
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: 50,
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(left: 20, right: 20),
|
|
width: double.infinity,
|
|
child: InkWell(
|
|
onTap: () async {
|
|
// Navigator.pushNamed(context, '/RegisterData');
|
|
final result = await Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => CameraCardID(isPassport: widget.isPassport,),
|
|
),
|
|
);
|
|
if (result != null) {
|
|
// Navigator.pushNamed(context, '/RegisterData');
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => RegisterData(),
|
|
),
|
|
);
|
|
}
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.all(5),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(100),
|
|
color: Color(0xff9d001b),
|
|
),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Text(
|
|
"Start scanning".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Colors.white,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class register_step extends StatelessWidget {
|
|
final int index;
|
|
|
|
const register_step({Key? key, required this.index}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: Center(
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Stack(
|
|
children: [
|
|
Positioned.fill(
|
|
child: Align(
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: 10,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: index == 1
|
|
? Color(0xff700013)
|
|
: Color(0xffd0315a),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Color(0xffd0315a),
|
|
width: 1,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Stack(
|
|
children: [
|
|
Positioned.fill(
|
|
child: Align(
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: 10,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: index == 2
|
|
? Color(0xff700013)
|
|
: Color(0xffd0315a),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Color(0xffd0315a),
|
|
width: 1,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Stack(
|
|
children: [
|
|
Positioned.fill(
|
|
child: Align(
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: 10,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: index == 3
|
|
? Color(0xff700013)
|
|
: Color(0xffd0315a),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Color(0xffd0315a),
|
|
width: 1,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
child: Stack(
|
|
children: [
|
|
Positioned.fill(
|
|
child: Align(
|
|
alignment: Alignment.center,
|
|
child: Container(
|
|
width: 10,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: index == 4
|
|
? Color(0xff700013)
|
|
: Color(0xffd0315a),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 16,
|
|
height: 16,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Color(0xffd0315a),
|
|
width: 1,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: Center(
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Expanded(
|
|
child: Container(
|
|
width: 81,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(height: 1),
|
|
Text(
|
|
"Scan ID card/Passport".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff0e0e0e),
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w300,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
color: Color(0xffd0315a),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 66,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(height: 1),
|
|
SizedBox(
|
|
width: 85,
|
|
child: Text(
|
|
"personal information".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff565656),
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w300,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
color: Color(0xffd0315a),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 65,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(height: 1),
|
|
SizedBox(
|
|
width: 93,
|
|
child: Text(
|
|
"Face Scan".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff65676b),
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w300,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 20,
|
|
height: 1,
|
|
color: Color(0xffd0315a),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
width: 81,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(height: 1),
|
|
SizedBox(
|
|
width: 93,
|
|
child: Text(
|
|
"Take your photo with your ID card/passport".tr(),
|
|
textAlign: TextAlign.center,
|
|
style: GoogleFonts.kanit(
|
|
color: Color(0xff65676b),
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w300,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
))
|
|
],
|
|
);
|
|
}
|
|
}
|