-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor Dio client initialization in UserRepository
The Dio client initialization in the UserRepository class has been refactored to use the BaseOptions constructor. This change improves code readability and ensures consistent configuration of the client.
- Loading branch information
Showing
4 changed files
with
61 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter_dotenv/flutter_dotenv.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:gohealth/api/layout/user_view_model.dart'; | ||
import 'package:gohealth/api/models/user_models.dart'; | ||
import 'package:gohealth/api/repositories/user_repository.dart'; | ||
import 'package:gohealth/src/app/login/login_controller.dart'; | ||
|
||
void main() async { | ||
await dotenv.load(fileName: ".env"); | ||
|
||
final repository = UserViewModel(UserRepository()); | ||
var controller = LoginController(repository); | ||
|
||
test( | ||
'Teste apenas para saber se o login está funcionando como o UserViewModel', | ||
() async { | ||
UserModels user = await controller.login('[email protected]', '123456'); | ||
|
||
if (kDebugMode) { | ||
print(user.toJson()); | ||
} | ||
expect(user.email, '[email protected]'); | ||
}); | ||
} |