/*
 * @Author: WuWei
 * @Date: 2020-06-17 15:12:49
 * @LastEditors: WuWei
 * @LastEditTime: 2020-06-17 17:57:33
 * @Description:
 */
part of '../index.dart';

class _CarPark extends StatelessWidget {
  const _CarPark({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final store = Provider.of<SearchCarDetailStore>(context);

    return SliverToBoxAdapter(
        child: Wisdom(
            padding: EdgeInsets.all(10.pt),
            child: Wisdom.column(
              mainAxisSize: MainAxisSize.min,
              color: Colors.white,
              borderRadius: BorderRadius.circular(14.pt),
              boxShadow: [
                BoxShadow(
                  color: Color(0x40000000),
                  blurRadius: 10.pt,
                  spreadRadius: -5.pt,
                )
              ],
              children: <Widget>[
                Wisdom.row(
                  mainAxisSize: MainAxisSize.max,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  borderRadius: BorderRadius.vertical(
                    top: Radius.circular(14.pt),
                  ),
                  padding: EdgeInsets.all(15.pt),
                  color: Color(0xFFE5EAFF),
                  children: <Widget>[
                    Wisdom(
                      borderRadius: BorderRadius.circular(100.pt),
                      width: 12.pt,
                      height: 12.pt,
                      color: Color(0xFF666666),
                      margin: EdgeInsets.only(right: 5.pt),
                    ),
                    WisText.c666(
                      '相关车位',
                      size: 16.pt,
                    )
                  ],
                ),
                store.carDetail?.parkingSpaceCode != null
                    ? Wisdom.column(
                        mainAxisSize: MainAxisSize.min,
                        padding: EdgeInsets.all(15.pt),
                        children: <Widget>[
                          Wisdom.column(
                            mainAxisSize: MainAxisSize.min,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              Wisdom(
                                margin: EdgeInsets.only(bottom: 5.pt),
                                child: WisText(
                                    '${store.carDetail?.parkingSpaceCode ?? ''}'),
                              ),
                              Wisdom.row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: <Widget>[
                                  WisText.c999(
                                    '车位类型：${store.parkType[store.carDetail?.parkingSpacetType] ?? ''}',
                                    size: 12.pt,
                                  ),
                                  WisText.c999(
                                    '车位状态：${store.parkStatus[store.carDetail?.parkingSpaceStatus] ?? ''}',
                                    size: 12.pt,
                                  )
                                ],
                              ),
                            ],
                          )
                        ],
                      )
                    : Wisdom.row(
                        padding:
                            EdgeInsets.fromLTRB(15.pt, 22.pt, 15.pt, 22.pt),
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: <Widget>[
                          WisText.c999(
                            '暂无数据',
                            size: 14.pt,
                          )
                        ],
                      )
              ],
            )));
  }
}
