Skip to content

Commit fa6413f

Browse files
committed
action_sheet [nfc]: Rename BottomSheetHeaderPlainText to BottomSheetPlainText
This way, it can be used for purposes other than being a header, such as in the next commits, when read receipts fail to load, we use this widget in the middle of bottom sheet to give feedback to the user. This also adds a TextAlign property for controlling the alignment.
1 parent c93e683 commit fa6413f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/widgets/action_sheet.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,26 +98,28 @@ void _showActionSheet(
9898
});
9999
}
100100

101-
/// A header for a bottom sheet with a multiline UI string.
101+
/// A plain text widget for a bottom sheet with a multiline UI string.
102102
///
103-
/// Assumes 8px padding below the top of the bottom sheet.
103+
/// Comes with built-in 16px horizontal padding.
104104
///
105105
/// Figma:
106106
/// https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=3481-26993&m=dev
107-
class BottomSheetHeaderPlainText extends StatelessWidget {
108-
const BottomSheetHeaderPlainText({super.key, required this.text});
107+
class BottomSheetPlainText extends StatelessWidget {
108+
const BottomSheetPlainText({super.key, required this.text, this.textAlign});
109109

110110
final String text;
111+
final TextAlign? textAlign;
111112

112113
@override
113114
Widget build(BuildContext context) {
114115
final designVariables = DesignVariables.of(context);
115116

116117
return Padding(
117-
padding: EdgeInsets.fromLTRB(16, 8, 16, 4),
118+
padding: EdgeInsets.symmetric(horizontal: 16),
118119
child: SizedBox(
119120
width: double.infinity,
120121
child: Text(
122+
textAlign: textAlign,
121123
style: TextStyle(
122124
color: designVariables.labelTime,
123125
fontSize: 17,

lib/widgets/emoji_reaction.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ class ViewReactionsHeader extends StatelessWidget {
782782

783783
if (reactionsWithVotes == null || reactionsWithVotes.isEmpty) {
784784
return Padding(
785-
padding: const EdgeInsets.only(top: 8),
786-
child: BottomSheetHeaderPlainText(text: zulipLocalizations.seeWhoReactedSheetNoReactions),
785+
padding: const EdgeInsets.only(top: 16, bottom: 4),
786+
child: BottomSheetPlainText(text: zulipLocalizations.seeWhoReactedSheetNoReactions),
787787
);
788788
}
789789

0 commit comments

Comments
 (0)