Skip to content

Commit d25adc6

Browse files
committed
action_sheet: Implement BottomSheetHeaderPlainText, following Figma
1 parent 1826eec commit d25adc6

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

lib/widgets/action_sheet.dart

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

101+
/// A header for a bottom sheet with a multiline UI string.
102+
///
103+
/// Assumes 8px padding below the top of the bottom sheet.
104+
///
105+
/// Figma:
106+
/// 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});
109+
110+
final String text;
111+
112+
@override
113+
Widget build(BuildContext context) {
114+
final designVariables = DesignVariables.of(context);
115+
116+
return Padding(
117+
padding: EdgeInsets.fromLTRB(16, 8, 16, 4),
118+
child: SizedBox(
119+
width: double.infinity,
120+
child: Text(
121+
style: TextStyle(
122+
color: designVariables.labelTime,
123+
fontSize: 17,
124+
height: 22 / 17),
125+
text)));
126+
}
127+
}
128+
101129
/// A button in an action sheet.
102130
///
103131
/// When built from server data, the action sheet ignores changes in that data;

lib/widgets/theme.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
171171
labelEdited: const HSLColor.fromAHSL(0.35, 0, 0, 0).toColor(),
172172
labelMenuButton: const Color(0xff222222),
173173
labelSearchPrompt: const Color(0xff000000).withValues(alpha: 0.5),
174+
labelTime: const Color(0x00000000).withValues(alpha: 0.49),
174175
listMenuItemBg: const Color(0xffcbcdd6),
175176
listMenuItemIcon: const Color(0xff9194a3),
176177
listMenuItemText: const Color(0xff2d303c),
@@ -260,6 +261,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
260261
labelEdited: const HSLColor.fromAHSL(0.35, 0, 0, 1).toColor(),
261262
labelMenuButton: const Color(0xffffffff).withValues(alpha: 0.85),
262263
labelSearchPrompt: const Color(0xffffffff).withValues(alpha: 0.5),
264+
labelTime: const Color(0xffffffff).withValues(alpha: 0.50),
263265
listMenuItemBg: const Color(0xff2d303c),
264266
listMenuItemIcon: const Color(0xff767988),
265267
listMenuItemText: const Color(0xffcbcdd6),
@@ -358,6 +360,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
358360
required this.labelEdited,
359361
required this.labelMenuButton,
360362
required this.labelSearchPrompt,
363+
required this.labelTime,
361364
required this.listMenuItemBg,
362365
required this.listMenuItemIcon,
363366
required this.listMenuItemText,
@@ -447,6 +450,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
447450
final Color labelEdited;
448451
final Color labelMenuButton;
449452
final Color labelSearchPrompt;
453+
final Color labelTime;
450454
final Color listMenuItemBg;
451455
final Color listMenuItemIcon;
452456
final Color listMenuItemText;
@@ -531,6 +535,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
531535
Color? labelEdited,
532536
Color? labelMenuButton,
533537
Color? labelSearchPrompt,
538+
Color? labelTime,
534539
Color? listMenuItemBg,
535540
Color? listMenuItemIcon,
536541
Color? listMenuItemText,
@@ -610,6 +615,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
610615
labelEdited: labelEdited ?? this.labelEdited,
611616
labelMenuButton: labelMenuButton ?? this.labelMenuButton,
612617
labelSearchPrompt: labelSearchPrompt ?? this.labelSearchPrompt,
618+
labelTime: labelTime ?? this.labelTime,
613619
listMenuItemBg: listMenuItemBg ?? this.listMenuItemBg,
614620
listMenuItemIcon: listMenuItemIcon ?? this.listMenuItemIcon,
615621
listMenuItemText: listMenuItemText ?? this.listMenuItemText,
@@ -696,6 +702,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
696702
labelEdited: Color.lerp(labelEdited, other.labelEdited, t)!,
697703
labelMenuButton: Color.lerp(labelMenuButton, other.labelMenuButton, t)!,
698704
labelSearchPrompt: Color.lerp(labelSearchPrompt, other.labelSearchPrompt, t)!,
705+
labelTime: Color.lerp(labelTime, other.labelTime, t)!,
699706
listMenuItemBg: Color.lerp(listMenuItemBg, other.listMenuItemBg, t)!,
700707
listMenuItemIcon: Color.lerp(listMenuItemIcon, other.listMenuItemIcon, t)!,
701708
listMenuItemText: Color.lerp(listMenuItemText, other.listMenuItemText, t)!,

0 commit comments

Comments
 (0)