Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! TW-403: refactor chat_list and for…
Browse files Browse the repository at this point in the history
…ward screen
  • Loading branch information
sherlockvn committed Aug 29, 2023
1 parent bc308da commit dc23b7d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
8 changes: 6 additions & 2 deletions lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ class Chat extends StatefulWidget {
final Widget? sideView;
final MatrixFile? shareFile;

const Chat({Key? key, this.sideView, required this.roomId, this.shareFile})
: super(key: key);
const Chat({
Key? key,
this.sideView,
required this.roomId,
this.shareFile,
}) : super(key: key);

@override
ChatController createState() => ChatController();
Expand Down
3 changes: 1 addition & 2 deletions lib/pages/chat_list/chat_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class ChatListItem extends StatelessWidget {
if (onTap != null) return onTap!();
if (activeChat) return;
switch (room.membership) {
case Membership.invite:
context.go('/rooms/${room.id}');
case Membership.ban:
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
Expand All @@ -50,6 +48,7 @@ class ChatListItem extends StatelessWidget {
return;
case Membership.leave:
context.go('/archive/${room.id}');
case Membership.invite:
case Membership.join:
context.go('/rooms/${room.id}');
default:
Expand Down
14 changes: 6 additions & 8 deletions lib/pages/forward/forward_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ForwardView extends StatelessWidget {
appBar: PreferredSize(
preferredSize:
Size.fromHeight(ForwardViewStyle.preferredAppBarSize(context)),
child: ForwardAppBar(
child: _ForwardAppBar(
isSearchBarShowNotifier: controller.isSearchBarShowNotifier,
sendFromRoomId: controller.sendFromRoomId,
),
Expand Down Expand Up @@ -69,7 +69,7 @@ class ForwardView extends StatelessWidget {
),
floatingActionButton: Align(
alignment: const Alignment(0.5, 1.1),
child: ForwardButton(
child: _ForwardButton(
forwardAction: controller.forwardAction,
selectedEventsNotifier: controller.selectedEventsNotifier,
forwardMessageNotifier: controller.forwardMessageNotifier,
Expand All @@ -79,9 +79,8 @@ class ForwardView extends StatelessWidget {
}
}

class ForwardButton extends StatelessWidget {
const ForwardButton({
super.key,
class _ForwardButton extends StatelessWidget {
const _ForwardButton({
required this.selectedEventsNotifier,
required this.forwardMessageNotifier,
required this.forwardAction,
Expand Down Expand Up @@ -148,9 +147,8 @@ class ForwardButton extends StatelessWidget {
}
}

class ForwardAppBar extends StatelessWidget {
const ForwardAppBar({
super.key,
class _ForwardAppBar extends StatelessWidget {
const _ForwardAppBar({
required this.isSearchBarShowNotifier,
this.sendFromRoomId,
});
Expand Down

0 comments on commit dc23b7d

Please sign in to comment.