@@ -213,6 +213,45 @@ enum ZulipWebUiKitButtonSize {
213213 normal,
214214}
215215
216+ /// The "icon button" component in the Figma.
217+ ///
218+ /// See Figma:
219+ /// https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=7728-10468&m=dev
220+ class ZulipIconButton extends StatelessWidget {
221+ const ZulipIconButton ({
222+ super .key,
223+ required this .icon,
224+ required this .onPressed,
225+ });
226+
227+ final IconData icon;
228+ final VoidCallback onPressed;
229+
230+ @override
231+ Widget build (BuildContext context) {
232+ final designVariables = DesignVariables .of (context);
233+
234+ // Really `fg-05` from the Zulip Web UI Kit palette,
235+ // but this seems at least as good as that.
236+ final touchFeedbackColor = designVariables.foreground.withFadedAlpha (0.05 );
237+
238+ return IconButton (
239+ color: designVariables.icon,
240+ iconSize: 24 ,
241+ icon: Icon (icon),
242+ onPressed: onPressed,
243+ style: IconButton .styleFrom (
244+ tapTargetSize: MaterialTapTargetSize .shrinkWrap,
245+ fixedSize: Size .square (40 ),
246+
247+ // TODO(#417): Disable splash effects for all buttons globally.
248+ splashFactory: NoSplash .splashFactory,
249+ highlightColor: touchFeedbackColor,
250+ shape: const RoundedRectangleBorder (
251+ borderRadius: BorderRadius .all (Radius .circular (4 )))));
252+ }
253+ }
254+
216255/// Apply [Transform.scale] to the child widget when tapped, and reset its scale
217256/// when released, while animating the transitions.
218257class AnimatedScaleOnTap extends StatefulWidget {
0 commit comments