flutter(rider): rebuild lib on Cubit/Bloc + Tripz backend (core + auth slice)
- keep store identity (com.mobileapp.store.ride, shorebird, firebase, fonts); old lib -> lib_old_getx - core: config/di/router(go_router)/theme/api_client(dio+tenant+bearer)/token_store(secure) - auth: repo + AuthCubit + OTP phone/otp screens; home: flutter_map (OSM placeholder, انطلق TODO) - android usesCleartextTraffic=true for http API; maps=flutter_map (no Google), state=Cubit Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,353 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:Tripz/controller/functions/crud.dart';
|
||||
import 'package:Tripz/controller/functions/encrypt_decrypt.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:Tripz/constant/box_name.dart';
|
||||
import 'package:Tripz/constant/colors.dart';
|
||||
import 'package:Tripz/constant/style.dart';
|
||||
import 'package:Tripz/main.dart';
|
||||
import 'package:Tripz/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../constant/info.dart';
|
||||
import '../../controller/auth/apple_signin_controller.dart';
|
||||
import '../../controller/auth/google_sign.dart';
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import '../home/HomePage/contact_us.dart';
|
||||
import '../home/profile/passenger_profile_page.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
final controller = Get.put(LoginController());
|
||||
final AuthController authController = Get.put(AuthController());
|
||||
|
||||
LoginPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(LoginController());
|
||||
Get.put(CRUD());
|
||||
return GetBuilder<LoginController>(
|
||||
builder: (controller) => MyScafolld(
|
||||
title: 'Login'.tr,
|
||||
isleading: false,
|
||||
body: [
|
||||
if (box.read(BoxName.agreeTerms) != 'agreed')
|
||||
_buildAgreementPage(controller)
|
||||
// else if (box.read(BoxName.countryCode) == null)
|
||||
// _buildCountryPicker()
|
||||
else if (box.read(BoxName.locationPermission) != 'true')
|
||||
_buildLocationPermissionDialog(controller)
|
||||
else
|
||||
_buildLoginContent(controller, authController),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLoginContent(
|
||||
LoginController controller, AuthController authController) {
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/logo.gif',
|
||||
height: Get.width * 0.4,
|
||||
width: Get.width * 0.4,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
if (Platform.isIOS && controller.isTest == 0)
|
||||
_buildEmailPasswordForm(controller)
|
||||
else
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24.0),
|
||||
child: Text(
|
||||
'Sign in for a seamless experience'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
final user =
|
||||
await GoogleSignInHelper.signInFromLogin(); // 👈 استخدم هذا
|
||||
if (user != null) {
|
||||
print("Login success: ${user.email}");
|
||||
// روح على الصفحة الرئيسية بعد تسجيل الدخول
|
||||
// Get.offAll(() => HomePage());
|
||||
}
|
||||
},
|
||||
child: _buildSocialButton(
|
||||
icon: FontAwesome.google,
|
||||
text: 'Sign In with Google'.tr,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (!Platform.isAndroid)
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
User? user = await authController.signInWithApple();
|
||||
if (user != null) {
|
||||
box.write(BoxName.passengerID, user.uid);
|
||||
box.write(BoxName.email, (user.email.toString()));
|
||||
await controller.loginUsingCredentials(
|
||||
box.read(BoxName.passengerID).toString(),
|
||||
box.read(BoxName.email).toString(),
|
||||
);
|
||||
} else {
|
||||
Get.snackbar('User not found'.tr, '',
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child: _buildSocialButton(
|
||||
icon: Icons.apple,
|
||||
text: 'Sign in with Apple'.tr,
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
GestureDetector(
|
||||
onTap: () => Get.to(() => ContactUsPage()),
|
||||
child: Text(
|
||||
'Need assistance? Contact us'.tr,
|
||||
style: AppStyle.subtitle.copyWith(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// var encrypt = EncryptionHelper.instance.encryptData('');
|
||||
// Log.print('encrypt: ${encrypt}');
|
||||
// Log.print(
|
||||
// 'encrypt: ${EncryptionHelper.instance.decryptData(encrypt)}');
|
||||
// },
|
||||
// child: Text(
|
||||
// "Text Button",
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSocialButton({
|
||||
required IconData icon,
|
||||
required String text,
|
||||
required Color color,
|
||||
}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(icon, color: Colors.white),
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildEmailPasswordForm(LoginController controller) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.2),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 5,
|
||||
offset: const Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.emailController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Email'.tr,
|
||||
hintText: 'Your email address'.tr,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
validator: (value) => value == null ||
|
||||
value.isEmpty ||
|
||||
!value.contains('@') ||
|
||||
!value.contains('.')
|
||||
? 'Enter a valid email'.tr
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
controller: controller.passwordController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password'.tr,
|
||||
hintText: 'Your password'.tr,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
validator: (value) => value == null || value.isEmpty
|
||||
? 'Enter your password'.tr
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
GetBuilder<LoginController>(
|
||||
builder: (controller) => controller.isloading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: ElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
child: Text('Submit'.tr),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAgreementPage(LoginController controller) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ListTile(
|
||||
leading: Image.asset('assets/images/notepad.png', width: 40),
|
||||
title: Text('Terms of Use & Privacy Notice'.tr,
|
||||
style: AppStyle.headTitle2),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RichText(
|
||||
textAlign: TextAlign.left,
|
||||
text: TextSpan(
|
||||
style: AppStyle.title,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text:
|
||||
'By selecting "I Agree" below, I confirm that I have read and agree to the '
|
||||
.tr),
|
||||
TextSpan(
|
||||
text: 'Terms of Use'.tr,
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: AppColor.blueColor),
|
||||
),
|
||||
const TextSpan(text: ' and acknowledge the '),
|
||||
TextSpan(
|
||||
text: 'Privacy Notice'.tr,
|
||||
style: const TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
color: AppColor.blueColor),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Get.defaultDialog(
|
||||
title: 'Privacy Notice'.tr,
|
||||
content: const SizedBox(
|
||||
height: 400,
|
||||
width: 400,
|
||||
child: SingleChildScrollView(
|
||||
child: HtmlWidget(AppInformation.privacyPolicy),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
TextSpan(text: '. I am at least 18 years old.'.tr),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: controller.isAgreeTerms,
|
||||
onChanged: (newValue) => controller.changeAgreeTerm(),
|
||||
activeColor: AppColor.primaryColor,
|
||||
),
|
||||
Text('I Agree'.tr, style: AppStyle.title),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: controller.isAgreeTerms
|
||||
? () => controller.saveAgreementTerms()
|
||||
: null,
|
||||
child: Text('Continue'.tr),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLocationPermissionDialog(LoginController controller) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.location_on, size: 60, color: AppColor.primaryColor),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Enable Location Access'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'We need your location to find nearby drivers for pickups and drop-offs.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton(
|
||||
onPressed: () async => await controller.getLocationPermission(),
|
||||
child: Text('Next'.tr),
|
||||
// child: Text('Allow Location Access'.tr),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () => openAppSettings(),
|
||||
// child: Text('Open Settings'.tr),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Widget _buildCountryPicker() {
|
||||
// return CountryPicker();
|
||||
// }
|
||||
}
|
||||
@@ -1,724 +0,0 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
// --- placeholder imports ---
|
||||
// These are assumed to exist from your original code.
|
||||
// Make sure to have these files and controllers properly set up in your project.
|
||||
import 'package:Tripz/controller/auth/login_controller.dart';
|
||||
import '../../controller/auth/otp_controller.dart'; // Assumed to be PhoneAuthHelper
|
||||
import '../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
// --- end of placeholder imports ---
|
||||
|
||||
/// A visually revamped authentication screen with a glassmorphism effect.
|
||||
/// It provides a consistent and beautiful UI for all authentication steps.
|
||||
///
|
||||
/// A hidden feature for testers is included: a long-press on the logo
|
||||
/// will open a dialog for email/password login, suitable for app reviews.
|
||||
class AuthScreen extends StatelessWidget {
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final Widget form;
|
||||
|
||||
const AuthScreen({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.form,
|
||||
});
|
||||
|
||||
/// Shows a dialog for testers to log in using email and password.
|
||||
/// This is triggered by a long-press on the logo or the explicit tester button.
|
||||
void _showTesterLoginDialog(
|
||||
BuildContext context, LoginController controller) {
|
||||
final testerEmailController = TextEditingController();
|
||||
final testerPasswordController = TextEditingController();
|
||||
final testerFormKey = GlobalKey<FormState>();
|
||||
|
||||
// Brand Color for Logic (Cyan/Teal from the Arrow in the logo)
|
||||
const Color brandColor = Color(0xFF00E5FF);
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext dialogContext) {
|
||||
return BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
||||
child: AlertDialog(
|
||||
// Updated background to match new theme (Dark Purple/Indigo)
|
||||
backgroundColor: const Color(0xFF1A1A2E).withOpacity(0.90),
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
title: const Text(
|
||||
'App Tester Login',
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
TextStyle(fontWeight: FontWeight.bold, color: Colors.white),
|
||||
),
|
||||
content: Form(
|
||||
key: testerFormKey,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: testerEmailController,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Email',
|
||||
labelStyle:
|
||||
TextStyle(color: Colors.white.withOpacity(0.7)),
|
||||
prefixIcon: Icon(Icons.email_outlined,
|
||||
color: Colors.white.withOpacity(0.7)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide:
|
||||
BorderSide(color: Colors.white.withOpacity(0.3)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
// Changed to Brand Cyan
|
||||
borderSide: const BorderSide(color: brandColor),
|
||||
),
|
||||
),
|
||||
validator: (value) => value == null || !value.contains('@')
|
||||
? 'Enter a valid email'
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: testerPasswordController,
|
||||
obscureText: true,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Password',
|
||||
labelStyle:
|
||||
TextStyle(color: Colors.white.withOpacity(0.7)),
|
||||
prefixIcon: Icon(Icons.lock_outline,
|
||||
color: Colors.white.withOpacity(0.7)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide:
|
||||
BorderSide(color: Colors.white.withOpacity(0.3)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
// Changed to Brand Cyan
|
||||
borderSide: const BorderSide(color: brandColor),
|
||||
),
|
||||
),
|
||||
validator: (value) => value == null || value.isEmpty
|
||||
? 'Enter a password'
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: const Text('Cancel',
|
||||
style: TextStyle(color: Colors.white70)),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: brandColor, // Updated Button Color
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: const Text('Login',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF1A1A2E), fontWeight: FontWeight.bold)),
|
||||
onPressed: () {
|
||||
if (testerFormKey.currentState!.validate()) {
|
||||
// Use the main controller to perform login
|
||||
controller.emailController.text =
|
||||
testerEmailController.text;
|
||||
controller.passwordController.text =
|
||||
testerPasswordController.text;
|
||||
controller.login();
|
||||
Navigator.of(dialogContext).pop();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// We still need the controller for the hidden tester login
|
||||
final loginController = Get.find<LoginController>();
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
// NEW DESIGN: Deep Purple/Indigo Gradient to match the "N" body
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
// Dark Indigo -> Deep Purple -> Dark Blue
|
||||
colors: [Color(0xFF2E1C59), Color(0xFF1A237E), Color(0xFF0D1117)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
// Background shapes updated to match the Logo accents
|
||||
|
||||
// Shape 1: The Orange/Red Swoosh color
|
||||
Positioned(
|
||||
top: -80,
|
||||
left: -80,
|
||||
child: Container(
|
||||
width: 250,
|
||||
height: 250,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// Orange/Red from the swoosh lines
|
||||
color: const Color(0xFFFF5722).withOpacity(0.12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFFFF5722).withOpacity(0.2),
|
||||
blurRadius: 50,
|
||||
spreadRadius: 10,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
||||
// Shape 2: The Cyan/Teal Arrow color
|
||||
Positioned(
|
||||
bottom: -100,
|
||||
right: -80,
|
||||
child: Container(
|
||||
width: 350,
|
||||
height: 350,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
// Cyan/Teal from the arrow tip
|
||||
color: const Color(0xFF00E5FF).withOpacity(0.08),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFF00E5FF).withOpacity(0.15),
|
||||
blurRadius: 60,
|
||||
spreadRadius: 5,
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// GestureDetector to handle long-press for tester login
|
||||
GestureDetector(
|
||||
onLongPress: () {
|
||||
_showTesterLoginDialog(context, loginController);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white.withOpacity(0.05),
|
||||
border: Border.all(
|
||||
// Gradient border for the logo container
|
||||
color: Colors.white.withOpacity(0.1),
|
||||
width: 1)),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
child: Image.asset('assets/images/logo.gif',
|
||||
height: 100)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
shadows: [
|
||||
Shadow(
|
||||
blurRadius: 15.0,
|
||||
color: Color(0xFF000000), // Darker shadow
|
||||
offset: Offset(0, 4)),
|
||||
]),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
subtitle,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.white.withOpacity(0.75),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
|
||||
// Glassmorphism Container for the form
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(
|
||||
sigmaX: 20, sigmaY: 20), // Increased blur
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
// Slightly darker tint for better contrast with Cyan inputs
|
||||
color: const Color(0xFF1A237E).withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
border: Border.all(
|
||||
color: Colors.white.withOpacity(0.1),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child:
|
||||
form, // The form from the specific screen is placed here
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
// A more distinct button for app testers
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () =>
|
||||
_showTesterLoginDialog(context, loginController),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 16),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.admin_panel_settings_outlined,
|
||||
color: Colors.white.withOpacity(0.5)),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'For App Reviewers / Testers',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.5),
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// --- UI Screens ---
|
||||
// Note: These screens now use the new AuthScreen wrapper and have updated styling
|
||||
// for their form elements to match the new design.
|
||||
|
||||
class PhoneNumberScreen extends StatefulWidget {
|
||||
const PhoneNumberScreen({super.key});
|
||||
@override
|
||||
State<PhoneNumberScreen> createState() => _PhoneNumberScreenState();
|
||||
}
|
||||
|
||||
class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
|
||||
final _phoneController = TextEditingController();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
bool _isLoading = false;
|
||||
|
||||
// Brand Color for Focus (Cyan/Teal)
|
||||
final Color _focusColor = const Color(0xFF00E5FF);
|
||||
|
||||
static String formatSyrianPhone(String phone) {
|
||||
// Remove spaces, symbols, +, -, ()
|
||||
phone = phone.replaceAll(RegExp(r'[ \-\(\)\+]'), '').trim();
|
||||
|
||||
// Normalize 00963 → 963
|
||||
if (phone.startsWith('00963')) {
|
||||
phone = phone.replaceFirst('00963', '963');
|
||||
}
|
||||
|
||||
// Normalize 0963 → 963
|
||||
if (phone.startsWith('0963')) {
|
||||
phone = phone.replaceFirst('0963', '963');
|
||||
}
|
||||
|
||||
// NEW: Fix 96309xxxx → 9639xxxx
|
||||
if (phone.startsWith('96309')) {
|
||||
phone = '9639' + phone.substring(5); // remove the "0" after 963
|
||||
}
|
||||
|
||||
// If starts with 9630 → correct to 9639
|
||||
if (phone.startsWith('9630')) {
|
||||
phone = '9639' + phone.substring(4);
|
||||
}
|
||||
|
||||
// If already in correct format: 9639xxxxxxxx
|
||||
if (phone.startsWith('9639') && phone.length == 12) {
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 963 but missing the 9
|
||||
if (phone.startsWith('963') && phone.length > 3) {
|
||||
// Ensure it begins with 9639
|
||||
if (!phone.startsWith('9639')) {
|
||||
phone = '9639' + phone.substring(3);
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 09xxxxxxxx → 9639xxxxxxxx
|
||||
if (phone.startsWith('09')) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
// If 9xxxxxxxx (9 digits)
|
||||
if (phone.startsWith('9') && phone.length == 9) {
|
||||
return '963' + phone;
|
||||
}
|
||||
|
||||
// If starts with incorrect 0xxxxxxx → assume Syrian and fix
|
||||
if (phone.startsWith('0') && phone.length == 10) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
return phone;
|
||||
}
|
||||
|
||||
void _submit() async {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
setState(() => _isLoading = true);
|
||||
// PRODUCTION READY: Using the actual PhoneAuthHelper
|
||||
final rawPhone = _phoneController.text.trim().replaceFirst('+', '');
|
||||
final success = await PhoneAuthHelper.sendOtp(rawPhone);
|
||||
if (success && mounted) {
|
||||
// Get.to(() => OtpVerificationScreen(phoneNumber: rawPhone));
|
||||
await PhoneAuthHelper.verifyOtp(
|
||||
rawPhone,
|
||||
); // For testing purposes, auto-verify with a dummy OTP
|
||||
}
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AuthScreen(
|
||||
title: 'welcome to Tripz'.tr,
|
||||
subtitle: 'login or register subtitle'.tr,
|
||||
form: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Enter your phone number'.tr,
|
||||
style:
|
||||
TextStyle(color: Colors.white.withOpacity(0.9), fontSize: 16),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
IntlPhoneField(
|
||||
showCountryFlag: false,
|
||||
searchText: 'Search country'.tr,
|
||||
languageCode: 'ar',
|
||||
style: const TextStyle(color: Colors.white),
|
||||
dropdownTextStyle: const TextStyle(
|
||||
color: Colors
|
||||
.white), // Changed to White for visibility on dark BG
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Phone Number'.tr,
|
||||
hintText: 'witout zero'.tr,
|
||||
labelStyle: TextStyle(color: Colors.white.withOpacity(0.7)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.white.withOpacity(0.3)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
// Updated to Logo Cyan
|
||||
borderSide: BorderSide(color: _focusColor, width: 2),
|
||||
),
|
||||
),
|
||||
initialCountryCode: 'SY',
|
||||
onChanged: (phone) {
|
||||
_phoneController.text = phone.completeNumber;
|
||||
},
|
||||
validator: (phone) {
|
||||
if (phone == null || phone.number.isEmpty) {
|
||||
return 'Please enter your phone number'.tr;
|
||||
}
|
||||
if (phone.number.startsWith('0')) {
|
||||
return 'Please enter the number without the leading 0'.tr;
|
||||
}
|
||||
if (phone.completeNumber.length < 10) {
|
||||
// Example validation
|
||||
return 'Phone number seems too short'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_isLoading
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _submit,
|
||||
style: ElevatedButton.styleFrom(
|
||||
// Updated to Logo Cyan
|
||||
backgroundColor: _focusColor,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
elevation: 5,
|
||||
shadowColor: _focusColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
child: Text(
|
||||
'send otp button'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
// Text is dark to contrast with bright Cyan
|
||||
color: Color(0xFF1A1A2E)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class OtpVerificationScreen extends StatefulWidget {
|
||||
final String phoneNumber;
|
||||
const OtpVerificationScreen({super.key, required this.phoneNumber});
|
||||
@override
|
||||
State<OtpVerificationScreen> createState() => _OtpVerificationScreenState();
|
||||
}
|
||||
|
||||
class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final _otpController = TextEditingController();
|
||||
bool _isLoading = false;
|
||||
|
||||
// Brand Color
|
||||
final Color _brandColor = const Color(0xFF00E5FF);
|
||||
|
||||
void _submit() async {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
setState(() => _isLoading = true);
|
||||
// PRODUCTION READY: Using the actual PhoneAuthHelper
|
||||
// await PhoneAuthHelper.verifyOtp(widget.phoneNumber, _otpController.text);
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AuthScreen(
|
||||
title: 'verify your number title'.tr,
|
||||
subtitle:
|
||||
'otp sent subtitle'.trParams({'phoneNumber': widget.phoneNumber}),
|
||||
form: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Enter the 5-digit code'.tr,
|
||||
style:
|
||||
TextStyle(color: Colors.white.withOpacity(0.9), fontSize: 16),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Form(
|
||||
key: _formKey,
|
||||
child: TextFormField(
|
||||
controller: _otpController,
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 5,
|
||||
style: const TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
letterSpacing: 18, // Visually separates the digits
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
counterText: "",
|
||||
hintText: '-----',
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white.withOpacity(0.1),
|
||||
letterSpacing: 18,
|
||||
fontSize: 28),
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 10),
|
||||
// Add a subtle underline for the OTP area using brand color
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Colors.white.withOpacity(0.2))),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: _brandColor)),
|
||||
),
|
||||
validator: (v) => v == null || v.length < 5 ? '' : null,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
_isLoading
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _submit,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: _brandColor, // Updated
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
elevation: 5,
|
||||
shadowColor: _brandColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
child: Text(
|
||||
'verify and continue button'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1A1A2E)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class RegistrationScreen extends StatefulWidget {
|
||||
final String phoneNumber;
|
||||
const RegistrationScreen({super.key, required this.phoneNumber});
|
||||
@override
|
||||
State<RegistrationScreen> createState() => _RegistrationScreenState();
|
||||
}
|
||||
|
||||
class _RegistrationScreenState extends State<RegistrationScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final _firstNameController = TextEditingController();
|
||||
final _lastNameController = TextEditingController();
|
||||
final _emailController = TextEditingController();
|
||||
bool _isLoading = false;
|
||||
|
||||
// Brand Color
|
||||
final Color _brandColor = const Color(0xFF00E5FF);
|
||||
|
||||
void _submit() async {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
setState(() => _isLoading = true);
|
||||
// PRODUCTION READY: Using the actual PhoneAuthHelper
|
||||
await PhoneAuthHelper.registerUser(
|
||||
phoneNumber: widget.phoneNumber,
|
||||
firstName: _firstNameController.text.trim(),
|
||||
lastName: _lastNameController.text.trim(),
|
||||
email: _emailController.text.trim(),
|
||||
);
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to create styled text form fields
|
||||
Widget _buildTextFormField({
|
||||
required TextEditingController controller,
|
||||
required String label,
|
||||
TextInputType keyboardType = TextInputType.text,
|
||||
String? Function(String?)? validator,
|
||||
}) {
|
||||
return TextFormField(
|
||||
controller: controller,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(color: Colors.white.withOpacity(0.7)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.white.withOpacity(0.3)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
// Updated to Logo Cyan
|
||||
borderSide: BorderSide(color: _brandColor, width: 2),
|
||||
),
|
||||
),
|
||||
keyboardType: keyboardType,
|
||||
validator: validator,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AuthScreen(
|
||||
title: 'one last step title'.tr,
|
||||
subtitle: 'complete profile subtitle'.tr,
|
||||
form: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildTextFormField(
|
||||
controller: _firstNameController,
|
||||
label: 'first name label'.tr,
|
||||
validator: (v) => v!.isEmpty ? 'first name required'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildTextFormField(
|
||||
controller: _lastNameController,
|
||||
label: 'last name label'.tr,
|
||||
validator: (v) => v!.isEmpty ? 'last name required'.tr : null,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildTextFormField(
|
||||
controller: _emailController,
|
||||
label: 'email optional label'.tr,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_isLoading
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _submit,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: _brandColor, // Updated
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
elevation: 5,
|
||||
shadowColor: _brandColor.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
child: Text(
|
||||
'complete registration button'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF1A1A2E)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import '../../controller/auth/otp_controller.dart';
|
||||
import '../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class OtpPage extends StatefulWidget {
|
||||
final String phoneNumber;
|
||||
|
||||
const OtpPage({super.key, required this.phoneNumber});
|
||||
|
||||
@override
|
||||
State<OtpPage> createState() => _OtpPageState();
|
||||
}
|
||||
|
||||
class _OtpPageState extends State<OtpPage> {
|
||||
final _otpController = TextEditingController();
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
bool _loading = false;
|
||||
|
||||
void _verifyOtp() async {
|
||||
if (!_formKey.currentState!.validate()) return;
|
||||
|
||||
setState(() => _loading = true);
|
||||
|
||||
final otp = _otpController.text.trim();
|
||||
|
||||
try {
|
||||
// await PhoneAuthHelper.verifyOtpAndRegister(widget.phoneNumber, otp);
|
||||
|
||||
// بعد نجاح التسجيل أو تسجيل الدخول، نذهب مباشرة للصفحة الرئيسية
|
||||
if (mounted) {
|
||||
Get.find<LoginController>().loginUsingCredentials(
|
||||
box.read(BoxName.passengerID).toString(),
|
||||
box.read(BoxName.email).toString(),
|
||||
// widget.phoneNumber,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
_showError('فشل التحقق. حاول مرة أخرى.');
|
||||
} finally {
|
||||
if (mounted) setState(() => _loading = false);
|
||||
}
|
||||
}
|
||||
|
||||
void _showError(String message) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
message,
|
||||
backgroundColor: Colors.redAccent,
|
||||
colorText: Colors.white,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Color(0xFF2E1C59), Color(0xFF1A237E), Color(0xFF0D1117)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/images/logo.gif', height: 90),
|
||||
const SizedBox(height: 20),
|
||||
const Text('OTP Verification',
|
||||
style: TextStyle(
|
||||
fontSize: 28,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white)),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'أدخل رمز التحقق المرسل إلى ${widget.phoneNumber}',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.white.withOpacity(0.7)),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF1A237E).withOpacity(0.25),
|
||||
borderRadius: BorderRadius.circular(22),
|
||||
border: Border.all(color: Colors.white24),
|
||||
),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _otpController,
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 6,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
decoration: InputDecoration(
|
||||
labelText: 'OTP'.tr,
|
||||
counterText: '',
|
||||
labelStyle:
|
||||
const TextStyle(color: Colors.white70),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Colors.white30),
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: Color(0xFF00E5FF), width: 2),
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
validator: (v) {
|
||||
if (v == null || v.trim().length != 6) {
|
||||
return 'رمز التحقق يجب أن يكون 6 أرقام';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_loading
|
||||
? const CircularProgressIndicator(
|
||||
color: Colors.white)
|
||||
: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _verifyOtp,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
const Color(0xFF00E5FF),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16),
|
||||
),
|
||||
child: const Text('Verify OTP',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF1A1A2E),
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
// إعادة إرسال OTP
|
||||
setState(() => _loading = true);
|
||||
// final success = await PhoneAuthHelper.sendOtpAndOpenVerify(
|
||||
// widget.phoneNumber);
|
||||
setState(() => _loading = false);
|
||||
// if (!success) _showError('فشل إعادة الإرسال');
|
||||
},
|
||||
child: const Text('Resend OTP',
|
||||
style: TextStyle(color: Colors.white70)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../controller/auth/token_otp_change_controller.dart';
|
||||
|
||||
class OtpVerificationPage extends StatefulWidget {
|
||||
final String phone;
|
||||
final String deviceToken;
|
||||
final String token;
|
||||
final String ptoken;
|
||||
|
||||
const OtpVerificationPage({
|
||||
super.key,
|
||||
required this.phone,
|
||||
required this.deviceToken,
|
||||
required this.token,
|
||||
required this.ptoken,
|
||||
});
|
||||
|
||||
@override
|
||||
State<OtpVerificationPage> createState() => _OtpVerificationPageState();
|
||||
}
|
||||
|
||||
class _OtpVerificationPageState extends State<OtpVerificationPage> {
|
||||
late final OtpVerificationController controller;
|
||||
final List<FocusNode> _focusNodes = List.generate(6, (index) => FocusNode());
|
||||
final List<TextEditingController> _textControllers =
|
||||
List.generate(5, (index) => TextEditingController());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
controller = Get.put(OtpVerificationController(
|
||||
phone: widget.phone,
|
||||
deviceToken: widget.deviceToken,
|
||||
token: widget.token,
|
||||
));
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (var node in _focusNodes) {
|
||||
node.dispose();
|
||||
}
|
||||
for (var controller in _textControllers) {
|
||||
controller.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _onOtpChanged(String value, int index) {
|
||||
if (value.isNotEmpty) {
|
||||
if (index < 5) {
|
||||
_focusNodes[index + 1].requestFocus();
|
||||
} else {
|
||||
_focusNodes[index].unfocus(); // إلغاء التركيز بعد آخر حقل
|
||||
}
|
||||
} else if (index > 0) {
|
||||
_focusNodes[index - 1].requestFocus();
|
||||
}
|
||||
// تجميع نصوص كل الحقول لتكوين الرمز النهائي
|
||||
controller.otpCode.value = _textControllers.map((c) => c.text).join();
|
||||
}
|
||||
|
||||
Widget _buildOtpInputFields() {
|
||||
return Directionality(
|
||||
textDirection: TextDirection.ltr, // لضمان ترتيب الحقول من اليسار لليمين
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: List.generate(5, (index) {
|
||||
return SizedBox(
|
||||
width: 45,
|
||||
height: 55,
|
||||
child: TextFormField(
|
||||
controller: _textControllers[index],
|
||||
focusNode: _focusNodes[index],
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 1,
|
||||
style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
|
||||
decoration: InputDecoration(
|
||||
counterText: "",
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).primaryColor, width: 2),
|
||||
),
|
||||
),
|
||||
onChanged: (value) => _onOtpChanged(value, index),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Verify OTP'.tr),
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
),
|
||||
backgroundColor: Colors.grey[50],
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Icon(Icons.phonelink_lock_rounded,
|
||||
size: 80, color: Theme.of(context).primaryColor),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
'Verification Code'.tr,
|
||||
style:
|
||||
const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Text(
|
||||
'${'We have sent a verification code to your mobile number:'.tr} ${widget.phone}',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.grey.shade600, fontSize: 16, height: 1.5),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
_buildOtpInputFields(),
|
||||
const SizedBox(height: 40),
|
||||
Obx(() => SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: controller.isVerifying.value
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12))),
|
||||
onPressed: () =>
|
||||
controller.verifyOtp(widget.ptoken),
|
||||
child: Text('Verify'.tr,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 24),
|
||||
Obx(
|
||||
() => controller.canResend.value
|
||||
? TextButton(
|
||||
onPressed: controller.sendOtp,
|
||||
child: Text('Resend Code'.tr),
|
||||
)
|
||||
: Text(
|
||||
'${'You can resend in'.tr} ${controller.countdown.value} ${'seconds'.tr}',
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,297 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:Tripz/constant/style.dart';
|
||||
import 'package:Tripz/controller/auth/register_controller.dart';
|
||||
import 'package:Tripz/views/widgets/elevated_btn.dart';
|
||||
import 'package:Tripz/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
|
||||
class RegisterPage extends StatelessWidget {
|
||||
const RegisterPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterController());
|
||||
return MyScafolld(
|
||||
title: 'Register'.tr,
|
||||
body: [
|
||||
GetBuilder<RegisterController>(
|
||||
builder: (controller) => Form(
|
||||
key: controller.formKey,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(3, 3),
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3)
|
||||
],
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.firstNameController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'First name'.tr,
|
||||
hintText: 'Enter your first name'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your first name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.lastNameController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Last name'.tr,
|
||||
hintText: 'Enter your last name'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your last name.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.emailController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Email'.tr,
|
||||
hintText: 'Enter your email address'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty ||
|
||||
(!value.contains('@') ||
|
||||
!value.contains('.'))) {
|
||||
return 'Please enter Your Email.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
TextFormField(
|
||||
obscureText: true,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
controller: controller.passwordController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Password'.tr,
|
||||
hintText: 'Enter your Password'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter Your Password.'.tr;
|
||||
}
|
||||
if (value.length < 6) {
|
||||
return 'Password must br at least 6 character.'
|
||||
.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.phone,
|
||||
cursorColor: AppColor.accentColor,
|
||||
controller: controller.phoneController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Phone'.tr,
|
||||
hintText: 'Enter your phone number'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty || value.length != 10) {
|
||||
return 'Please enter your phone number.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .4,
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
controller: controller.siteController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'City'.tr,
|
||||
hintText: 'Enter your City'.tr,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your City.'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => controller.getBirthDate(),
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: Get.width * .4,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(13)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20),
|
||||
child: Text(
|
||||
controller.birthDate,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// DropdownButton(
|
||||
// value: controller.gender,
|
||||
// items: [
|
||||
// DropdownMenuItem(
|
||||
// value: 'Male'.tr,
|
||||
// child: Text('Male'.tr),
|
||||
// ),
|
||||
// DropdownMenuItem(
|
||||
// value: 'Female'.tr,
|
||||
// child: Text('Female'.tr),
|
||||
// ),
|
||||
// DropdownMenuItem(
|
||||
// value: '--'.tr,
|
||||
// child: Text('--'.tr),
|
||||
// ),
|
||||
// ],
|
||||
// onChanged: (value) {
|
||||
// controller.changeGender(value!);
|
||||
// },
|
||||
// )
|
||||
],
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Register'.tr,
|
||||
// ignore: register
|
||||
onPressed: () =>
|
||||
controller.registerWithEmailPassword())
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
isleading: true);
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
import 'package:Tripz/constant/style.dart';
|
||||
import 'package:Tripz/controller/auth/register_controller.dart';
|
||||
import 'package:Tripz/views/widgets/elevated_btn.dart';
|
||||
import 'package:Tripz/views/widgets/my_scafold.dart';
|
||||
import 'package:Tripz/views/widgets/my_textField.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
import '../../print.dart';
|
||||
import '../widgets/mycircular.dart';
|
||||
// import 'package:intl_phone_field/intl_phone_field.dart';
|
||||
|
||||
class SmsSignupEgypt extends StatelessWidget {
|
||||
SmsSignupEgypt({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterController());
|
||||
return MyScafolld(
|
||||
title: "Phone Number Check".tr,
|
||||
body: [
|
||||
GetBuilder<RegisterController>(builder: (registerController) {
|
||||
return ListView(
|
||||
children: [
|
||||
// Logo at the top
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20.0),
|
||||
child: Image.asset(
|
||||
'assets/images/logo.png', // Make sure you have a logo image in your assets folder
|
||||
height: 100,
|
||||
),
|
||||
),
|
||||
// Message to the driver
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
|
||||
child: Text(
|
||||
'We need your phone number to contact you and to help you.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
// Phone number input field with country code dropdown
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: IntlPhoneField(
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Phone Number'.tr,
|
||||
border: const OutlineInputBorder(
|
||||
borderSide: BorderSide(),
|
||||
),
|
||||
),
|
||||
initialCountryCode: 'EG',
|
||||
onChanged: (phone) {
|
||||
// Properly concatenate country code and number
|
||||
registerController.phoneController.text =
|
||||
phone.completeNumber.toString();
|
||||
Log.print(' phone.number: ${phone.number}');
|
||||
print(
|
||||
"Formatted phone number: ${registerController.phoneController.text}");
|
||||
},
|
||||
validator: (phone) {
|
||||
// Check if the phone number is not null and is valid
|
||||
if (phone == null || phone.completeNumber.isEmpty) {
|
||||
return 'Please enter your phone number';
|
||||
}
|
||||
|
||||
// Extract the phone number (excluding the country code)
|
||||
final number = phone.completeNumber.toString();
|
||||
|
||||
// Check if the number length is exactly 11 digits
|
||||
if (number.length != 13) {
|
||||
return 'Phone number must be exactly 11 digits long';
|
||||
}
|
||||
|
||||
// If all validations pass, return null
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
if (registerController.isOtpSent)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Form(
|
||||
key: registerController.formKey3,
|
||||
child: MyTextForm(
|
||||
controller: registerController.verifyCode,
|
||||
label: '5 digit'.tr,
|
||||
hint: '5 digit'.tr,
|
||||
type: TextInputType.number),
|
||||
),
|
||||
),
|
||||
// Submit button
|
||||
registerController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: MyElevatedButton(
|
||||
onPressed: () async {
|
||||
!registerController.isOtpSent
|
||||
? await registerController.sendOtpMessage()
|
||||
: await registerController.verifyOtpAndRegister();
|
||||
},
|
||||
title: 'Submit'.tr,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
isleading: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:Tripz/constant/colors.dart';
|
||||
import 'package:Tripz/constant/style.dart';
|
||||
import 'package:Tripz/controller/auth/register_controller.dart';
|
||||
import 'package:Tripz/views/widgets/elevated_btn.dart';
|
||||
import 'package:Tripz/views/widgets/my_scafold.dart';
|
||||
|
||||
class VerifyEmailPage extends StatelessWidget {
|
||||
const VerifyEmailPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(RegisterController());
|
||||
return MyScafolld(
|
||||
title: 'Verify Email'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 20,
|
||||
right: 20,
|
||||
child: Text(
|
||||
'We sent 5 digit to your Email provided'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 20),
|
||||
)),
|
||||
GetBuilder<RegisterController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 100,
|
||||
left: 80,
|
||||
right: 80,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 100,
|
||||
child: TextField(
|
||||
controller: controller.verifyCode,
|
||||
decoration: InputDecoration(
|
||||
labelStyle: AppStyle.title,
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: '5 digit'.tr,
|
||||
counterStyle: AppStyle.number,
|
||||
hintStyle: AppStyle.subtitle
|
||||
.copyWith(color: AppColor.accentColor),
|
||||
),
|
||||
maxLength: 5,
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Send Verfication Code'.tr,
|
||||
// ignore: sendVerificationCode
|
||||
onPressed: () => controller.sendOtpMessage())
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
|
||||
Padding verifyEmail() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.accentColor,
|
||||
width: 2,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SizedBox(
|
||||
width: 20,
|
||||
child: TextField(
|
||||
maxLength: 1,
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user