/*
 * @Author: XianKaiQun
 * @Date: 2020-07-31 10:25:40
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-07-31 11:10:04
 * @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<PrivateCleanListStore>(context);
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final theme = Theme.of(context);
    final textTheme = theme.textTheme;
    final data = store.data;
    if (data == null) {
      return SliverToBoxAdapter();
    }
    return Wisdom.column(
      padding: EdgeInsets.fromLTRB(15.pt, 15.pt, 15.pt, 0),
      margin: EdgeInsets.symmetric(horizontal: 15.pt),
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: <Widget>[
        Text(
          '${data.positionName ?? ''}',
          style: textTheme.titleMedium,
        ),
        Divider(height: 30.pt),
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text('保洁位置编号'),
            Text('${data.number ?? ''}'),
          ],
        ),
        SizedBox(height: 18.pt),
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text('所属位置'),
            Text('${data.position ?? ''}'),
          ],
        ),
        SizedBox(height: 18.pt),
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Text('保洁位置状态'),
            Text(
              data.status == 1 ? '启用' : '禁用',
              style: TextStyle(
                color:
                    data.status == 1 ? colorScheme.green : colorScheme.danger,
              ),
            ),
          ],
        ),
      ],
    ).asSliver();
  }
}
