-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] Remover dependência do Modular ChatMainTalksPage
#395
base: main
Are you sure you want to change the base?
Changes from all commits
ca7a23c
f694e4e
c1ed3ed
68735eb
4705308
e1173d2
8986620
60d1946
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,5 @@ | ||||||||||
import 'package:flutter/material.dart'; | ||||||||||
import 'package:flutter_mobx/flutter_mobx.dart'; | ||||||||||
import 'package:flutter_modular/flutter_modular.dart'; | ||||||||||
|
||||||||||
import '../../../../shared/design_system/colors.dart'; | ||||||||||
import '../../../authentication/presentation/shared/page_progress_indicator.dart'; | ||||||||||
|
@@ -12,14 +11,24 @@ import '../pages/chat_channel_card.dart'; | |||||||||
import 'chat_main_talks_controller.dart'; | ||||||||||
|
||||||||||
class ChatMainTalksPage extends StatefulWidget { | ||||||||||
const ChatMainTalksPage({Key? key}) : super(key: key); | ||||||||||
const ChatMainTalksPage({Key? key, required this.controller}) | ||||||||||
: super(key: key); | ||||||||||
|
||||||||||
final ChatMainTalksController controller; | ||||||||||
|
||||||||||
@override | ||||||||||
_ChatMainTalksPageState createState() => _ChatMainTalksPageState(); | ||||||||||
} | ||||||||||
|
||||||||||
class _ChatMainTalksPageState | ||||||||||
extends ModularState<ChatMainTalksPage, IChatMainTalksController> { | ||||||||||
class _ChatMainTalksPageState extends State<ChatMainTalksPage> { | ||||||||||
ChatMainTalksController get controller => widget.controller; | ||||||||||
|
||||||||||
@override | ||||||||||
void initState() { | ||||||||||
super.initState(); | ||||||||||
controller.initialize(); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Melhor garantir que o controller seja acionado apenas quando as Widgets estiverem prontas para isto
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
@override | ||||||||||
Widget build(BuildContext context) { | ||||||||||
return Container( | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,10 @@ class SupportCenterModule extends WidgetModule { | |
|
||
@override | ||
Widget get view => SupportCenterPage( | ||
controller: Modular.get<SupportCenterController>(), | ||
controller: SupportCenterController( | ||
supportCenterUseCase: SupportCenterUseCase( | ||
locationService: Modular.get<ILocationServices>(), | ||
supportCenterRepository: SupportCenterRepository( | ||
apiProvider: Modular.get<ApiProvider>()))), | ||
Comment on lines
+53
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Não entendi a necessidade de alterar este código, não entendi a relação desta alteração com o PR |
||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Para melhorar a lógica, é melhor manter a criação do controllers no Bind (onde já estão) e aqui consumir a injeção, melhorando a organização e a manutenibilidade do código.