Skip to content

Commit

Permalink
action_sheet [nfc]: Tighten button constructors onto one line
Browse files Browse the repository at this point in the history
This is a nice small bonus from renaming the parameter that was
`messageListContext` to the shorter name `pageContext`.

Some of these don't quite fit in 80 columns.  But the details of
the parameter list are boring (because they're all the same),
so it's OK that some of them go a little over.
  • Loading branch information
gnprice committed Nov 7, 2024
1 parent e258773 commit f741a8c
Showing 1 changed file with 7 additions and 35 deletions.
42 changes: 7 additions & 35 deletions lib/widgets/action_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ class MessageActionSheetCancelButton extends StatelessWidget {
// This button is very temporary, to complete #125 before we have a way to
// choose an arbitrary reaction (#388). So, skipping i18n.
class AddThumbsUpButton extends MessageActionSheetMenuItemButton {
AddThumbsUpButton({
super.key,
required super.message,
required super.pageContext,
});
AddThumbsUpButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => ZulipIcons.smile;

Expand Down Expand Up @@ -223,11 +219,7 @@ class AddThumbsUpButton extends MessageActionSheetMenuItemButton {
}

class StarButton extends MessageActionSheetMenuItemButton {
StarButton({
super.key,
required super.message,
required super.pageContext,
});
StarButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => _isStarred ? ZulipIcons.star_filled : ZulipIcons.star;

Expand Down Expand Up @@ -320,11 +312,7 @@ Future<String?> fetchRawContentWithFeedback({
}

class QuoteAndReplyButton extends MessageActionSheetMenuItemButton {
QuoteAndReplyButton({
super.key,
required super.message,
required super.pageContext,
});
QuoteAndReplyButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => ZulipIcons.format_quote;

Expand Down Expand Up @@ -380,11 +368,7 @@ class QuoteAndReplyButton extends MessageActionSheetMenuItemButton {
}

class MarkAsUnreadButton extends MessageActionSheetMenuItemButton {
MarkAsUnreadButton({
super.key,
required super.message,
required super.pageContext,
});
MarkAsUnreadButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => Icons.mark_chat_unread_outlined;

Expand All @@ -400,11 +384,7 @@ class MarkAsUnreadButton extends MessageActionSheetMenuItemButton {
}

class CopyMessageTextButton extends MessageActionSheetMenuItemButton {
CopyMessageTextButton({
super.key,
required super.message,
required super.pageContext,
});
CopyMessageTextButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => ZulipIcons.copy;

Expand Down Expand Up @@ -437,11 +417,7 @@ class CopyMessageTextButton extends MessageActionSheetMenuItemButton {
}

class CopyMessageLinkButton extends MessageActionSheetMenuItemButton {
CopyMessageLinkButton({
super.key,
required super.message,
required super.pageContext,
});
CopyMessageLinkButton({super.key, required super.message, required super.pageContext});

@override IconData get icon => Icons.link;

Expand All @@ -467,11 +443,7 @@ class CopyMessageLinkButton extends MessageActionSheetMenuItemButton {
}

class ShareButton extends MessageActionSheetMenuItemButton {
ShareButton({
super.key,
required super.message,
required super.pageContext,
});
ShareButton({super.key, required super.message, required super.pageContext});

@override
IconData get icon => defaultTargetPlatform == TargetPlatform.iOS
Expand Down

0 comments on commit f741a8c

Please sign in to comment.