import 'package:flutter/material.dart';

class TabButtonGroup extends StatefulWidget {
  const TabButtonGroup(
    this.tabButtonList, {
    this.margin = const EdgeInsets.only(right: 8),
    Key? key,
  }) : super(key: key);

  final List<Widget>? tabButtonList;
  final EdgeInsetsGeometry? margin;
  @override
  State<TabButtonGroup> createState() => _TabButtonGroupState();
}

class _TabButtonGroupState extends State<TabButtonGroup> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          child: Flex(
            direction: Axis.horizontal,
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Container(
                height: 40,
                alignment: Alignment.center,
                margin: widget.margin,
                child: MouseRegion(
                  cursor: SystemMouseCursors.click,
                  child: Row(
                    children: widget.tabButtonList ?? [],
                  ),
                ),
              ),
            ],
          ),
        ),
        SizedBox(
          height: 4,
          child: Container(
            height: 4,
            decoration: BoxDecoration(color: Theme.of(context).primaryColor),
          ),
        )
      ],
    );
  }
}
