/*
 * @Author: XianKaiQun
 * @Date: 2020-07-30 09:14:04
 * @LastEditors: ,: XianKaiQun
 * @LastEditTime: ,: 2020-10-20 11:34:49
 * @Description: 
 */
part of '../index.dart';

class _DescComponent extends StatelessWidget {
  const _DescComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final store = Provider.of<PrivateRepairMaintainStore>(context);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final theme = Theme.of(context);
    final textTheme = theme.textTheme;
    final data = store.data;
    return SliverToBoxAdapter(
      child: Wisdom.row(
        margin: EdgeInsets.all(15.pt),
        children: <Widget>[
          Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              Text(
                '${data?.name ?? ''}',
                style: textTheme.titleMedium,
              ),
              SizedBox(height: 5.pt),
              Text(
                '设备编号：${data?.number ?? ''}',
                style: textTheme.bodySmall,
              ),
            ],
          ).asExpanded(),
          WButton(
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(30.pt),
              side: BorderSide(
                color: colorScheme.primary,
              ),
            ),
            color: Colors.transparent,
            textColor: colorScheme.primary,
            onPressed: () => store.route2detail(),
            padding: EdgeInsets.symmetric(horizontal: 10.pt),
            height: 35.pt,
            child: Text('设备详情'),
          ),
        ],
      ),
    );
  }
}
