diff --git a/lib/ui/login/view/LoginView.dart b/lib/ui/login/view/LoginView.dart index af81a82..88ed26e 100644 --- a/lib/ui/login/view/LoginView.dart +++ b/lib/ui/login/view/LoginView.dart @@ -7,7 +7,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:aranduapp/ui/login/viewModel/LoginViewModel.dart'; -import 'package:aranduapp/ui/recover_account/view/RecoverAccount.dart'; +import 'package:aranduapp/ui/recover_account/view/recover_account_view.dart'; import 'package:aranduapp/ui/register_account/view/RegisterAccount.dart'; import 'package:aranduapp/ui/shared/TitleSlogan.dart'; diff --git a/lib/ui/recover_account/view/RecoverAccount.dart b/lib/ui/recover_account/view/RecoverAccount.dart deleted file mode 100644 index 3aa73f3..0000000 --- a/lib/ui/recover_account/view/RecoverAccount.dart +++ /dev/null @@ -1,82 +0,0 @@ -import 'package:aranduapp/core/log/Log.dart'; -import 'package:aranduapp/ui/recover_account/viewModel/recoverAccountViewModel.dart'; -import 'package:aranduapp/ui/shared/ErrorPopUp.dart'; -import 'package:aranduapp/ui/shared/TextAndLink.dart'; -import 'package:aranduapp/ui/shared/TextEmail.dart'; -import 'package:aranduapp/ui/shared/TitleSlogan.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class RecoverAccount extends StatelessWidget { - const RecoverAccount({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: ChangeNotifierProvider( - create: (context) => RecoverAccountViewModel(context), - builder: (context, child) { - return page(context); - }), - ); - } -} - -Widget page(BuildContext context) { - RecoverAccountViewModel viewModel = - Provider.of(context); - - return SingleChildScrollView( - child: Center( - child: Column( - children: [ - const SizedBox(height: 80), - const TitleSlogan(), - const Padding( - padding: EdgeInsets.only(top: 70, left: 20, right: 20), - child: Text( - 'Coloque o seu e-mail no campo abaixo e clique em enviar. Logo em seguida, você receberá no seu e-mail as instruções para trocar a sua senha.', - ), - ), - Form( - key: viewModel.formKey, - child: Column(children: [ - TextEmail( - padding: - const EdgeInsets.only(top: 24, left: 20, right: 20), - controller: viewModel.emailController), - ])), - Padding( - padding: const EdgeInsets.only(top: 80), - child: SizedBox( - width: 291, - height: 64, - child: ElevatedButton( - onPressed: () { - viewModel.forgetPassword().then((value) { - Log.d("Deu certo!"); - }).catchError((e) => showDialog( - context: context, - builder: (BuildContext context) => - ErrorPopUp(content: Text('$e')), - )); - }, - child: Consumer( - builder: (context, value, child) => value.isLoading - ? const CircularProgressIndicator(value: null) - : const Text('Enviar'), - )), - ), - ), - TextAndLink( - text: 'Já tem uma conta?', - link: 'Faça login', - action: () { - Navigator.of(context).pop(); - }, - ) - ], - ), - ), - ); -} diff --git a/lib/ui/recover_account/view/recover_account_view.dart b/lib/ui/recover_account/view/recover_account_view.dart new file mode 100644 index 0000000..ff30f7c --- /dev/null +++ b/lib/ui/recover_account/view/recover_account_view.dart @@ -0,0 +1,86 @@ +import 'package:aranduapp/core/log/Log.dart'; +import 'package:aranduapp/ui/recover_account/viewModel/recover_account_view_model.dart'; +import 'package:aranduapp/ui/shared/ErrorPopUp.dart'; +import 'package:aranduapp/ui/shared/TextAndLink.dart'; +import 'package:aranduapp/ui/shared/TextEmail.dart'; +import 'package:aranduapp/ui/shared/TitleSlogan.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class RecoverAccount extends StatelessWidget { + const RecoverAccount({super.key}); + + @override + Widget build(BuildContext context) { + return ChangeNotifierProvider( + create: (context) => RecoverAccountViewModel(), + builder: (context, child) { + return const RecoverAccountScreen(); + }); + } +} + +class RecoverAccountScreen extends StatelessWidget { + const RecoverAccountScreen({super.key}); + + @override + Widget build(BuildContext context) { + RecoverAccountViewModel viewModel = + Provider.of(context); + + return Scaffold( + body: SingleChildScrollView( + child: Center( + child: Column( + children: [ + const SizedBox(height: 80), + const TitleSlogan(), + const Padding( + padding: EdgeInsets.only(top: 70, left: 20, right: 20), + child: Text( + 'Coloque o seu e-mail no campo abaixo e clique em enviar. Logo em seguida, você receberá no seu e-mail as instruções para trocar a sua senha.', + ), + ), + Form( + key: viewModel.formKey, + child: Column(children: [ + TextEmail( + padding: + const EdgeInsets.only(top: 24, left: 20, right: 20), + controller: viewModel.emailController), + ])), + Padding( + padding: const EdgeInsets.only(top: 80), + child: SizedBox( + width: 291, + height: 64, + child: ElevatedButton( + onPressed: () { + viewModel.forgetPassword().then((value) { + Log.d("Deu certo!"); + }).catchError((e) => showDialog( + context: context, + builder: (BuildContext context) => + ErrorPopUp(content: Text('$e')), + )); + }, + child: viewModel.isLoading + ? const CircularProgressIndicator(value: null) + : const Text('Enviar'), + ), + ), + ), + TextAndLink( + text: 'Já tem uma conta?', + link: 'Faça login', + action: () { + Navigator.of(context).pop(); + }, + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/ui/recover_account/viewModel/recoverAccountViewModel.dart b/lib/ui/recover_account/viewModel/recover_account_view_model.dart similarity index 77% rename from lib/ui/recover_account/viewModel/recoverAccountViewModel.dart rename to lib/ui/recover_account/viewModel/recover_account_view_model.dart index 2f6f261..2037d06 100644 --- a/lib/ui/recover_account/viewModel/recoverAccountViewModel.dart +++ b/lib/ui/recover_account/viewModel/recover_account_view_model.dart @@ -4,26 +4,20 @@ import 'package:aranduapp/ui/recover_account/service/RecoverAccountService.dart' import 'package:flutter/material.dart'; class RecoverAccountViewModel extends ChangeNotifier { - final BuildContext context; - - final formKey; - - final emailController; + GlobalKey formKey; + TextEditingController emailController; bool isLoading; - RecoverAccountViewModel(this.context) + RecoverAccountViewModel() : formKey = GlobalKey(), emailController = TextEditingController(), isLoading = false; - - Future forgetPassword() async { - // TODO use mutex to make this - if (isLoading){ + if (isLoading) { return; } @@ -35,18 +29,13 @@ class RecoverAccountViewModel extends ChangeNotifier { throw Exception('Valores inválidos'); } - await RecoverAccountService.forgetPassword(RecoverAccountRequest(emailController.text)); - + await RecoverAccountService.forgetPassword( + RecoverAccountRequest(emailController.text)); } catch (e) { rethrow; } finally { isLoading = false; super.notifyListeners(); } - - - - - } } diff --git a/pubspec.lock b/pubspec.lock index a7ff271..36d2843 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,35 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + url: "https://pub.dev" + source: hosted + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + url: "https://pub.dev" + source: hosted + version: "6.7.0" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" async: dependency: transitive description: @@ -17,6 +46,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct main" + description: + name: build_runner + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" + source: hosted + version: "2.4.13" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" + source: hosted + version: "7.3.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" + url: "https://pub.dev" + source: hosted + version: "8.9.3" characters: dependency: transitive description: @@ -25,6 +118,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" clock: dependency: transitive description: @@ -33,6 +134,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" collection: dependency: transitive description: @@ -41,6 +150,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" crypto: dependency: transitive description: @@ -57,6 +174,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" dio: dependency: "direct main" description: @@ -89,6 +214,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flex_color_scheme: dependency: "direct main" description: @@ -192,6 +333,22 @@ packages: url: "https://pub.dev" source: hosted version: "10.8.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" google_fonts: dependency: "direct main" description: @@ -200,6 +357,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.2.1" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" http: dependency: transitive description: @@ -208,6 +373,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" http_parser: dependency: transitive description: @@ -224,6 +397,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" js: dependency: transitive description: @@ -232,6 +413,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" leak_tracker: dependency: transitive description: @@ -312,6 +501,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.5.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -336,6 +541,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.15.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct main" + description: + name: mockito + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + url: "https://pub.dev" + source: hosted + version: "5.4.4" nested: dependency: transitive description: @@ -344,6 +565,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" + url: "https://pub.dev" + source: hosted + version: "2.1.1" path: dependency: transitive description: @@ -416,6 +645,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" provider: dependency: "direct main" description: @@ -424,11 +661,51 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + url: "https://pub.dev" + source: hosted + version: "2.0.1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" source_span: dependency: transitive description: @@ -453,6 +730,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" string_scanner: dependency: transitive description: @@ -477,6 +762,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.2" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" typed_data: dependency: transitive description: @@ -501,6 +794,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" + watcher: + dependency: transitive + description: + name: watcher + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + url: "https://pub.dev" + source: hosted + version: "1.1.1" web: dependency: transitive description: @@ -509,6 +810,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + url: "https://pub.dev" + source: hosted + version: "3.0.1" win32: dependency: transitive description: @@ -525,6 +842,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" sdks: dart: ">=3.5.3 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 13b4578..c0ede18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,8 @@ dependencies: dio: ^5.7.0 font_awesome_flutter: ^10.8.0 flutter_secure_storage: ^9.2.2 + mockito: ^5.4.4 + build_runner: ^2.4.13 dev_dependencies: diff --git a/test/ui/recover_account/view/recover_account_test.dart b/test/ui/recover_account/view/recover_account_test.dart new file mode 100644 index 0000000..68052cb --- /dev/null +++ b/test/ui/recover_account/view/recover_account_test.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; +import 'package:aranduapp/ui/recover_account/view/recover_account_view.dart'; +import 'package:aranduapp/ui/recover_account/viewModel/recover_account_view_model.dart'; + +@GenerateNiceMocks([MockSpec()]) +import 'recover_account_test.mocks.dart'; + +void main() { + late MockRecoverAccountViewModel mockViewModel; + + setUp(() { + mockViewModel = MockRecoverAccountViewModel(); + when(mockViewModel.formKey).thenReturn(GlobalKey()); + when(mockViewModel.emailController).thenReturn(TextEditingController()); + when(mockViewModel.isLoading).thenReturn(false); + }); + + testWidgets('Testa estado do botão enviar quando isLoading é verdadeiro', + (WidgetTester tester) async { + when(mockViewModel.isLoading).thenReturn(true); + + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: mockViewModel, + child: const MaterialApp( + home: RecoverAccountScreen(), + ), + ), + ); + + expect(find.byType(CircularProgressIndicator), findsOneWidget); + expect(find.text('Enviar'), findsNothing); + }); + + testWidgets('Testa estado do botão enviar quando isLoading é falso', + (WidgetTester tester) async { + when(mockViewModel.isLoading).thenReturn(false); + + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: mockViewModel, + child: const MaterialApp( + home: RecoverAccountScreen(), + ), + ), + ); + + expect(find.byType(CircularProgressIndicator), findsNothing); + expect(find.text('Enviar'), findsOneWidget); + }); + + testWidgets('Teste envio da requisição', (WidgetTester tester) async { + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: mockViewModel, + child: const MaterialApp( + home: RecoverAccountScreen(), + ), + ), + ); + + final emailField = find.byType(TextFormField); + expect(emailField, findsOneWidget); + + await tester.enterText(emailField, 'fulano@gmail.com'); + await tester.pump(); + + final sendButton = find.text('Enviar'); + expect(sendButton, findsOneWidget); + + await tester.tap(sendButton); + await tester.pump(); + + verify(mockViewModel.forgetPassword()).called(1); + }); +} diff --git a/test/ui/recover_account/view/recover_account_test.mocks.dart b/test/ui/recover_account/view/recover_account_test.mocks.dart new file mode 100644 index 0000000..dee8ba1 --- /dev/null +++ b/test/ui/recover_account/view/recover_account_test.mocks.dart @@ -0,0 +1,166 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in aranduapp/test/ui/recover_account/view/recover_account_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:aranduapp/ui/recover_account/viewModel/recover_account_view_model.dart' + as _i3; +import 'package:flutter/material.dart' as _i1; +import 'package:mockito/mockito.dart' as _i2; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeGlobalKey_0> + extends _i2.SmartFake implements _i1.GlobalKey { + _FakeGlobalKey_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTextEditingController_1 extends _i2.SmartFake + implements _i1.TextEditingController { + _FakeTextEditingController_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [RecoverAccountViewModel]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRecoverAccountViewModel extends _i2.Mock + implements _i3.RecoverAccountViewModel { + @override + _i1.GlobalKey<_i1.FormState> get formKey => (super.noSuchMethod( + Invocation.getter(#formKey), + returnValue: _FakeGlobalKey_0<_i1.FormState>( + this, + Invocation.getter(#formKey), + ), + returnValueForMissingStub: _FakeGlobalKey_0<_i1.FormState>( + this, + Invocation.getter(#formKey), + ), + ) as _i1.GlobalKey<_i1.FormState>); + + @override + set formKey(_i1.GlobalKey<_i1.FormState>? _formKey) => super.noSuchMethod( + Invocation.setter( + #formKey, + _formKey, + ), + returnValueForMissingStub: null, + ); + + @override + _i1.TextEditingController get emailController => (super.noSuchMethod( + Invocation.getter(#emailController), + returnValue: _FakeTextEditingController_1( + this, + Invocation.getter(#emailController), + ), + returnValueForMissingStub: _FakeTextEditingController_1( + this, + Invocation.getter(#emailController), + ), + ) as _i1.TextEditingController); + + @override + set emailController(_i1.TextEditingController? _emailController) => + super.noSuchMethod( + Invocation.setter( + #emailController, + _emailController, + ), + returnValueForMissingStub: null, + ); + + @override + bool get isLoading => (super.noSuchMethod( + Invocation.getter(#isLoading), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + set isLoading(bool? _isLoading) => super.noSuchMethod( + Invocation.setter( + #isLoading, + _isLoading, + ), + returnValueForMissingStub: null, + ); + + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i4.Future forgetPassword() => (super.noSuchMethod( + Invocation.method( + #forgetPassword, + [], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + + @override + void addListener(dynamic listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + + @override + void removeListener(dynamic listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +}