sticker static method
Widget
sticker({
- Color? color,
- VoidCallback? onPressed,
- String? tooltip,
- String? text,
- IconData? icon,
- double size = 22,
- EdgeInsets margin = const EdgeInsets.only(bottom: 5, right: 8, top: 5, left: 5),
Implementation
static Widget sticker({
Color? color,
VoidCallback? onPressed,
String? tooltip,
String? text,
IconData? icon,
double size = 22,
EdgeInsets margin = const EdgeInsets.only(
bottom: 5,
right: 8,
top: 5,
left: 5,
),
}) =>
ThemeBuilder((context) {
final _color = color ?? context.iconColor ?? context.secondaryColor;
return Container(
width: size,
height: size,
margin: margin,
padding: EdgeInsets.only(top: icon != null ? 3.2 : 4),
alignment: Alignment.topCenter,
decoration: BoxDecoration(
border: Border.all(color: _color),
borderRadius: BorderRadius.only(
topRight: 6.radius,
topLeft: 6.radius,
bottomLeft: 6.radius,
bottomRight: 12.radius,
),
),
child: icon != null
? Icon(icon, color: _color, size: 13)
: Text(
text?.take(3).uppercase ?? "",
style: GoogleFonts.ubuntuCondensed(
fontSize: 8,
color: _color,
),
),
).clickable(onTap: onPressed).tooltip(tooltip);
});