/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-03-13 17:15:13
 * @LastEditTime : 2023-03-29 10:24:35
 * @Description  : Do not edit
 */

part of '../view.dart';

class _TabbarComponent extends StatelessWidget {
  const _TabbarComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateProcessStore>(context, listen: false);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    return Observer(
      builder: (_) {
        return Wisdom.row(
          color: Colors.white,
          borderRadius: BorderRadius.circular(13.pt),
          border: Border.all(color: colorScheme.primary, width: 1.pt),
          margin: EdgeInsets.all(15.pt),
          children: [
            Wisdom(
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(12.pt),
                bottomLeft: Radius.circular(12.pt),
              ),
              onTap: store.isForm ? null : () => store.setisForm(true),
              alignment: Alignment.center,
              color: !store.isForm ? null : colorScheme.primary,
              padding: EdgeInsets.symmetric(vertical: 6.pt),
              child: Text(
                '发起审批',
                style: TextStyle(
                  fontSize: 15.pt,
                  fontWeight: FontWeight.w300,
                  color: store.isForm ? Colors.white : colorScheme.primary,
                ),
              ),
            ).asExpanded(),
            Wisdom(
              borderRadius: BorderRadius.only(
                topRight: Radius.circular(12.pt),
                bottomRight: Radius.circular(12.pt),
              ),
              onTap: !store.isForm ? null : () => store.setisForm(false),
              alignment: Alignment.center,
              color: store.isForm ? null : colorScheme.primary,
              padding: EdgeInsets.symmetric(vertical: 6.pt),
              child: Text(
                '提交记录',
                style: TextStyle(
                  fontSize: 15.pt,
                  fontWeight: FontWeight.w300,
                  color: !store.isForm ? Colors.white : colorScheme.primary,
                ),
              ),
            ).asExpanded(),
          ],
        );
      },
    );
  }
}
