ZetaTab constructor

ZetaTab({
  1. Widget? icon,
  2. String? text,
  3. Key? key,
})

Creates a Zeta Design tab bar.

Implementation

ZetaTab({
  Widget? icon,
  String? text,
  super.key,
}) : super(
        child: Builder(
          builder: (context) {
            return Semantics(
              button: true,
              child: SelectionContainer.disabled(
                child: Row(
                  mainAxisSize: MainAxisSize.min,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    if (icon != null) ...[
                      SizedBox(width: Zeta.of(context).spacing.medium),
                      icon,
                    ],
                    if (text != null)
                      Padding(
                        padding:
                            icon != null ? EdgeInsets.only(left: Zeta.of(context).spacing.small) : EdgeInsets.zero,
                        child: Text(text),
                      ),
                    if (icon != null) SizedBox(width: Zeta.of(context).spacing.medium),
                  ],
                ),
              ),
            );
          },
        ),
      );