import 'package:flutter/material.dart';

class LLSIconBadge extends StatefulWidget {
  const LLSIconBadge({
    Key? key,
    this.padding = const EdgeInsets.symmetric(horizontal: 8),
    required this.child,
    required this.counterChild,
    this.right = 0
  }) : super(key: key);

  final Widget child;

  final Widget counterChild;

  final EdgeInsetsGeometry padding;

  final double right;

  @override
  _LLSIconBadgeState createState() => _LLSIconBadgeState();
}

class _LLSIconBadgeState extends State<LLSIconBadge> {
  @override
  Widget build(BuildContext context) => Container(
      padding: widget.padding,
      child: Stack(
        children: <Widget>[
          widget.child,
          Positioned(
            right: widget.right,
            child: widget.counterChild,
          ),
        ],
      ),
    );
}