/*
 * @Author: XianKaiQun
 * @Date: 2020-07-15 11:56:07
 * @LastEditors  : WuWei
 * @LastEditTime : 2023-10-31 17:41:29
 * @Description: 
 */
part of '../index.dart';

class _BottomComponent extends StatelessWidget {
  const _BottomComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final store = Provider.of<BillPlatformStore>(context);
    final data = store.data;
    if (data == null) return Container(height: 0);
    final feeTotal = store.allTotalFee;

    return Wisdom.row(
      color: Colors.white,
      height: 80.pt,
      borderRadius: BorderRadius.only(
        topRight: Radius.circular(12.pt),
        topLeft: Radius.circular(12.pt),
      ),
      padding: EdgeInsets.only(
        left: 15.pt,
        right: 15.pt,
        bottom: Platform.isAndroid ? 0 : 15.pt,
      ),
      children: <Widget>[
        Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            // Text(
            //   '$name',
            //   style: TextStyle(
            //     color: colorScheme.primary,
            //     fontSize: 14.pt,
            //   ),
            // ),
            Row(
              children: <Widget>[
                WisText(
                  '合计：',
                  size: 15.pt,
                  weight: FontWeight.bold,
                ),
                WisText(
                  '￥$feeTotal',
                  color: colorScheme.danger,
                  weight: FontWeight.bold,
                  size: 19.pt,
                ),
              ],
            ),
          ],
        ).asExpanded(),
        WButton(
          minWidth: 150.pt,
          onPressed: () => {
            if (double.parse(feeTotal) > 0)
              {store.route2submit()}
            else
              {
                WToastUtil.show('请录入需要缴纳的费用'),
              }
          },
          color: colorScheme.primary,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(30.pt)),
          height: 44.pt,
          padding: EdgeInsets.symmetric(
            horizontal: 15.pt,
          ),
          child: WisText(
            '缴费录单',
            size: 18.pt,
          ),
        ),
      ],
    );
  }
}
