Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps
This commit is contained in:
@@ -410,7 +410,7 @@ class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
|
||||
final rawPhone = _phoneController.text.trim().replaceFirst('+', '');
|
||||
final success = await PhoneAuthHelper.sendOtp(rawPhone);
|
||||
if (success && mounted) {
|
||||
await PhoneAuthHelper.verifyOtp(rawPhone);
|
||||
Get.to(() => OtpVerificationScreen(phoneNumber: rawPhone));
|
||||
}
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
@@ -537,7 +537,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
void _submit() async {
|
||||
if (_formKey.currentState!.validate()) {
|
||||
setState(() => _isLoading = true);
|
||||
// Logic for OTP verification here
|
||||
await PhoneAuthHelper.verifyOtp(widget.phoneNumber, _otpController.text.trim());
|
||||
if (mounted) setState(() => _isLoading = false);
|
||||
}
|
||||
}
|
||||
@@ -596,7 +596,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
controller: _otpController,
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 5,
|
||||
maxLength: 3,
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -605,7 +605,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
counterText: '',
|
||||
hintText: '·····',
|
||||
hintText: '···',
|
||||
hintStyle: TextStyle(
|
||||
color: isDark ? Colors.white12 : const Color(0xFFD1D5DB),
|
||||
letterSpacing: 20,
|
||||
@@ -615,7 +615,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 6),
|
||||
),
|
||||
validator: (v) => v == null || v.length < 5 ? '' : null,
|
||||
validator: (v) => v == null || v.length < 3 ? '' : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -625,10 +625,10 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
|
||||
ValueListenableBuilder<TextEditingValue>(
|
||||
valueListenable: _otpController,
|
||||
builder: (_, value, __) {
|
||||
final filled = value.text.length.clamp(0, 5);
|
||||
final filled = value.text.length.clamp(0, 3);
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: List.generate(5, (i) {
|
||||
children: List.generate(3, (i) {
|
||||
final active = i < filled;
|
||||
return AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
|
||||
@@ -23,9 +23,9 @@ class OtpVerificationPage extends StatefulWidget {
|
||||
|
||||
class _OtpVerificationPageState extends State<OtpVerificationPage> {
|
||||
late final OtpVerificationController controller;
|
||||
final List<FocusNode> _focusNodes = List.generate(6, (index) => FocusNode());
|
||||
final List<FocusNode> _focusNodes = List.generate(3, (index) => FocusNode());
|
||||
final List<TextEditingController> _textControllers =
|
||||
List.generate(5, (index) => TextEditingController());
|
||||
List.generate(3, (index) => TextEditingController());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -50,7 +50,7 @@ class _OtpVerificationPageState extends State<OtpVerificationPage> {
|
||||
|
||||
void _onOtpChanged(String value, int index) {
|
||||
if (value.isNotEmpty) {
|
||||
if (index < 5) {
|
||||
if (index < 2) {
|
||||
_focusNodes[index + 1].requestFocus();
|
||||
} else {
|
||||
_focusNodes[index].unfocus(); // إلغاء التركيز بعد آخر حقل
|
||||
@@ -67,7 +67,7 @@ class _OtpVerificationPageState extends State<OtpVerificationPage> {
|
||||
textDirection: TextDirection.ltr, // لضمان ترتيب الحقول من اليسار لليمين
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: List.generate(5, (index) {
|
||||
children: List.generate(3, (index) {
|
||||
return SizedBox(
|
||||
width: 45,
|
||||
height: 55,
|
||||
|
||||
Reference in New Issue
Block a user