173 lines
7.2 KiB
Dart
173 lines
7.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:glassmorphism/glassmorphism.dart';
|
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
|
import 'package:regroup/Utils/dialogs.dart';
|
|
import 'package:regroup/Utils/texts.dart';
|
|
import 'package:regroup/resources/routes/route_name.dart';
|
|
|
|
class VerifyuserScreenState extends StatefulWidget {
|
|
const VerifyuserScreenState({super.key});
|
|
|
|
@override
|
|
State<VerifyuserScreenState> createState() => _VerifyuserScreenStateState();
|
|
}
|
|
|
|
class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|
String accounttype = Get.arguments;
|
|
TextEditingController? pincode = TextEditingController();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
|
appBar: CommonAppbar(
|
|
titleTxt: '',
|
|
),
|
|
body: Stack(
|
|
children: [
|
|
// CommonBlurLeftSecond(),
|
|
Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
|
|
Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()),
|
|
GlassmorphicContainer(
|
|
width: MediaQuery.of(context).size.width,
|
|
height:
|
|
// 500.h,
|
|
MediaQuery.of(context).size.height,
|
|
borderRadius: 2,
|
|
blur: 6,
|
|
alignment: Alignment.bottomLeft,
|
|
border: 2,
|
|
linearGradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
],
|
|
),
|
|
borderGradient: LinearGradient(
|
|
begin: Alignment.topCenter,
|
|
end: Alignment.bottomCenter,
|
|
colors: [
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
|
|
Color(0XFF222935).withOpacity(0.60),
|
|
],
|
|
),
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
sizedBoxHeight(20.h),
|
|
text22400white('Check your email'),
|
|
sizedBoxHeight(10.h),
|
|
text14400white(
|
|
'Enter the verification code that we sent to loremipsum@gmail.com'),
|
|
sizedBoxHeight(40.h),
|
|
text16400white('Enter code'),
|
|
sizedBoxHeight(20.h),
|
|
PinCodeTextField(
|
|
validator: (value) {
|
|
if (value != null && value.isEmpty) {
|
|
return "Please Enter verification code";
|
|
} else if (value != null && value.length < 4) {
|
|
return "OTP length should be at least 4";
|
|
}
|
|
return null;
|
|
},
|
|
keyboardType: TextInputType.number,
|
|
inputFormatters: [
|
|
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
|
],
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
length: 4,
|
|
obscureText: false,
|
|
animationType: AnimationType.fade,
|
|
pinTheme: PinTheme(
|
|
selectedFillColor: Color(0xFF434A53),
|
|
inactiveFillColor: Color(0xFF434A53),
|
|
inactiveColor: Color(0xFF434A53),
|
|
activeColor: Color(0xFF434A53),
|
|
selectedColor: Color(0xFF434A53),
|
|
shape: PinCodeFieldShape.underline,
|
|
borderRadius: BorderRadius.circular(5),
|
|
fieldHeight: 70,
|
|
fieldWidth: 70,
|
|
activeFillColor:
|
|
// Colors.white
|
|
Color(0xFF303030).withOpacity(0.4),
|
|
// textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size
|
|
),
|
|
animationDuration: Duration(milliseconds: 300),
|
|
enableActiveFill: true,
|
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
|
controller: pincode,
|
|
onCompleted: (v) {
|
|
print("Completed");
|
|
},
|
|
onChanged: (value) {
|
|
print(value);
|
|
setState(() {
|
|
// currentText = value;
|
|
});
|
|
},
|
|
cursorColor: Colors.white,
|
|
textStyle: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 20.sp,
|
|
fontFamily: 'Helvetica',
|
|
),
|
|
beforeTextPaste: (text) {
|
|
print("Allowing to paste $text");
|
|
return true;
|
|
},
|
|
appContext: context,
|
|
),
|
|
const Spacer(
|
|
flex: 3,
|
|
),
|
|
CustomButton(
|
|
text: 'Continue',
|
|
onPressed: () {
|
|
if (pincode!.text.isEmpty) {
|
|
utils.showToast('Pin field is empty');
|
|
} else {
|
|
if (accounttype == 'Individual') {
|
|
print('individual selected');
|
|
Get.toNamed(RouteName.tellusindividualscreen);
|
|
} else if (accounttype == 'Business') {
|
|
print('business selected');
|
|
Get.toNamed(RouteName.tellusbusinessscreen);
|
|
}
|
|
}
|
|
}),
|
|
const Spacer(
|
|
// flex: 2,
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|