[Refactor] Remover dependência do Modular ChatMainTalksPage
#395
+145
−31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposta de Pull Request: Refatoração do ChatMainTalksPage para incluir IChatMainTalksController como dependência
Resumo
Este pull request faz alterações na implementação de ChatMainPage e ChatMainTalksPage para utilizar a injeção de dependência de um
IChatMainTalksController
. Isso melhora a testabilidade e desacopla ainda mais o código.Alterações principais
Refatoração de
ChatMainPage
:iChatMainTalksController
.controller
para oChatMainTalksPage
.Modificação em
ChatMainTalksPage
:controller
como uma dependência obrigatória.ModularState
.Atualização de testes:
MockIChatMainTalksController
para substituir dependências reais nos testes.ChatMainTalksState.error
eChatMainTalksState.loaded
.Arquivos modificados
lib/app/features/chat/presentation/chat_main_module.dart
Alterado para passar o
IChatMainTalksController
na criação daChatMainPage
.lib/app/features/chat/presentation/chat_main_page.dart
Adicionado o parâmetro obrigatório
iChatMainTalksController
naChatMainPage
.lib/app/features/chat/presentation/talk/chat_main_talks_page.dart
Alterado para aceitar um
IChatMainTalksController
explicitamente na construção da página.test/app/features/chat/presentation/talk/chat_main_talks_page_test.dart
Adicionadas as configurações de teste para o novo design.
Goldens atualizados:
test/app/features/chat/presentation/talk/goldens/ci/chat_main_talks_page_error_state.png
test/app/features/chat/presentation/talk/goldens/ci/chat_main_talks_page_initial_state.png
Diferença de código (Git Diff)