Skip to content

Commit

Permalink
refactor ModularState
Browse files Browse the repository at this point in the history
  • Loading branch information
RoxyRoses authored and shonorio committed Jan 13, 2025
1 parent 8978de5 commit 0b1489f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/app/features/chat/presentation/chat_main_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,7 @@ class ChatMainModule extends WidgetModule {
];

@override
Widget get view => const ChatMainPage();
Widget get view => ChatMainPage(
controller: Modular.get<ChatMainController>(),
);
}
9 changes: 5 additions & 4 deletions lib/app/features/chat/presentation/chat_main_page.dart
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 '../domain/entities/chat_tab_item.dart';
Expand All @@ -9,14 +8,16 @@ import 'people/chat_main_people_page.dart';
import 'talk/chat_main_talks_page.dart';

class ChatMainPage extends StatefulWidget {
const ChatMainPage({Key? key}) : super(key: key);
const ChatMainPage({Key? key, required this.controller}) : super(key: key);

final ChatMainController controller;

@override
_ChatMainPageState createState() => _ChatMainPageState();
}

class _ChatMainPageState
extends ModularState<ChatMainPage, ChatMainController> {
class _ChatMainPageState extends State<ChatMainPage> {
ChatMainController get controller => widget.controller;
@override
Widget build(BuildContext context) {
return Observer(
Expand Down

0 comments on commit 0b1489f

Please sign in to comment.