Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps

This commit is contained in:
Hamza-Ayed
2026-06-01 23:35:29 +03:00
parent 8f555691b9
commit cbf693c804
56 changed files with 6091 additions and 1217 deletions

View File

@@ -307,7 +307,7 @@ class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
Log.print('📱 _submit rawPhone: "$rawPhone" (from _completePhone: "$_completePhone")');
final success = await PhoneAuthHelper.sendOtp(rawPhone);
if (success && mounted) {
await PhoneAuthHelper.verifyOtp(rawPhone);
Get.to(() => OtpVerificationScreen(phoneNumber: rawPhone));
}
if (mounted) setState(() => _isLoading = false);
}
@@ -416,7 +416,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
void _submit() async {
if (_formKey.currentState!.validate()) {
setState(() => _isLoading = true);
await PhoneAuthHelper.verifyOtp(widget.phoneNumber);
await PhoneAuthHelper.verifyOtp(widget.phoneNumber, _otpController.text.trim());
if (mounted) setState(() => _isLoading = false);
}
}
@@ -431,7 +431,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'Enter the 5-digit code',
'Enter the 3-digit code',
style: TextStyle(color: Colors.black87, fontSize: 16),
textAlign: TextAlign.center,
),
@@ -442,7 +442,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
controller: _otpController,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
maxLength: 5,
maxLength: 3,
style: const TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
@@ -451,7 +451,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
),
decoration: InputDecoration(
counterText: "",
hintText: '-----',
hintText: '---',
hintStyle: TextStyle(
color: Colors.black.withOpacity(0.2),
letterSpacing: 18,
@@ -459,7 +459,7 @@ class _OtpVerificationScreenState extends State<OtpVerificationScreen> {
border: InputBorder.none,
contentPadding: const EdgeInsets.symmetric(vertical: 10),
),
validator: (v) => v == null || v.length < 5 ? '' : null,
validator: (v) => v == null || v.length < 3 ? '' : null,
),
),
const SizedBox(height: 30),

View File

@@ -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(6, (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,