operator > method
👆 "Chevron" this Icon
Icon operator >(VoidCallback onTap)
Returns this
Icon wrapped in an IconButton
with size
for IconButton.iconSize.
Color is forwarded as well.
Parameter following the greater-than
symbol is a Function
of type VoidCallback.
final Icon icon = Icon(Icons.arrow_back, size: 40);
// Whoa! `operator >(onTap)` method 😏
final IconButton button = icon * Colors.red > () => setState(() {});
Implementation
IconButton operator >(VoidCallback onTap) => IconButton(
icon: this,
iconSize: size ?? 24.0,
color: color,
onPressed: onTap,
);