refactor: remove the unused submitUserInfo method and enhance the searchable dropdown functionality

- Removed `submitUserInfo` from auth services and integrations.
- Refined dropdown with new multi-select and searchable options.
- Added `PersianFormatter` for better input handling.
- Updated `local.properties` to set flutter build mode to debug.
This commit is contained in:
2025-11-15 16:00:47 +03:30
parent 63d18cedca
commit 716a7ed259
17 changed files with 504 additions and 186 deletions

View File

@@ -48,15 +48,15 @@ void main() {
// Mock the flow
when(
() => mockAuthRemote.getUserInfo(phoneNumber),
() => mockAuthRemote.getUserInfo(phoneNumber),
).thenAnswer((_) async => expectedUserInfo);
when(
() => mockAuthRemote.submitUserInfo(any()),
() => mockAuthRemote.submitUserInfo(any()),
).thenAnswer((_) async {});
when(
() => mockAuthRemote.login(authRequest: authRequest),
() => mockAuthRemote.login(authRequest: authRequest),
).thenAnswer((_) async => expectedUserProfile);
// Act - Step 1: Get user info
@@ -77,7 +77,7 @@ void main() {
// Assert
expect(userProfile, equals(expectedUserProfile));
verify(() => mockAuthRemote.getUserInfo(phoneNumber)).called(1);
verify(() => mockAuthRemote.submitUserInfo(any())).called(1);
//verify(() => mockAuthRemote.submitUserInfo(any())).called(1);
verify(() => mockAuthRemote.login(authRequest: authRequest)).called(1);
});
@@ -100,11 +100,11 @@ void main() {
// Mock the flow
when(
() => mockAuthRemote.hasAuthenticated(),
() => mockAuthRemote.hasAuthenticated(),
).thenAnswer((_) async => false);
when(
() => mockAuthRemote.login(authRequest: authRequest),
() => mockAuthRemote.login(authRequest: authRequest),
).thenAnswer((_) async => expectedUserProfile);
// Act - Step 1: Check authentication status
@@ -129,7 +129,7 @@ void main() {
const phoneNumber = '09123456789';
when(
() => mockAuthRemote.getUserInfo(phoneNumber),
() => mockAuthRemote.getUserInfo(phoneNumber),
).thenAnswer((_) async => null);
// Act
@@ -158,15 +158,15 @@ void main() {
// Mock the flow
when(
() => mockAuthRemote.getUserInfo(phoneNumber),
() => mockAuthRemote.getUserInfo(phoneNumber),
).thenAnswer((_) async => expectedUserInfo);
when(
() => mockAuthRemote.submitUserInfo(any()),
() => mockAuthRemote.submitUserInfo(any()),
).thenAnswer((_) async {});
when(
() => mockAuthRemote.login(authRequest: authRequest),
() => mockAuthRemote.login(authRequest: authRequest),
).thenAnswer((_) async => null);
// Act - Step 1: Get user info (success)
@@ -209,7 +209,7 @@ void main() {
test('should track authentication state correctly', () async {
// Arrange
when(
() => mockAuthRemote.hasAuthenticated(),
() => mockAuthRemote.hasAuthenticated(),
).thenAnswer((_) async => true);
// Act
@@ -223,7 +223,7 @@ void main() {
test('should handle authentication state changes', () async {
// Arrange
when(
() => mockAuthRemote.hasAuthenticated(),
() => mockAuthRemote.hasAuthenticated(),
).thenAnswer((_) async => false);
// Act
@@ -242,7 +242,7 @@ void main() {
final expectedData = {'mobile': phone, 'device_name': null};
when(
() => mockAuthRemote.submitUserInfo(any()),
() => mockAuthRemote.submitUserInfo(any()),
).thenAnswer((_) async {});
// Act
@@ -259,7 +259,7 @@ void main() {
final expectedData = {'mobile': phone, 'device_name': deviceName};
when(
() => mockAuthRemote.submitUserInfo(any()),
() => mockAuthRemote.submitUserInfo(any()),
).thenAnswer((_) async {});
// Act