sticker static method

Widget sticker({
  1. Color? color,
  2. VoidCallback? onPressed,
  3. String? tooltip,
  4. String? text,
  5. IconData? icon,
  6. double size = 22,
  7. 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);
    });