/*
 * @Author       : WuWei
 * @LastEditors: ChenYaJin
 * @Date         : 2023-03-23 17:11:18
 * @LastEditTime: 2023-03-31 10:46:16
 * @Description  : Do not edit
 */

import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';
import '../../components/block_clipper.dart';
import '../../components/info_item.dart';
import '../../view_models/park_detail_store.dart';
// import '../../view_models/search_index_store.dart';

part 'components/topinfo_card.dart';
part 'components/resident.dart';
part 'components/car.dart';

class ParkDetailPage extends StatelessWidget {
  const ParkDetailPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      create: (_) => SearchParkDetailStore(context),
      child: _PageView(),
      lazy: false,
    );
  }
}

class _PageView extends StatefulWidget {
  _PageView({Key? key}) : super(key: key);

  @override
  _PageViewState createState() => _PageViewState();
}

class _PageViewState extends State<_PageView> {
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    final store = Provider.of<SearchParkDetailStore>(context);
    // final colorScheme = WTheme.of(context).colorScheme;
    return Scaffold(
      appBar: WAppBar(
        brightness: Brightness.dark,
        iconTheme: IconThemeData(
          color: Colors.white,
          size: 19.pt,
        ),
        title: Text('车位信息'),
      ),
      body: WisScrollView(
        key: store.scorllViewKey,
        onInit: () => store.getParkDetail(
          id: store.args['id'],
        ),
        slivers: <Widget>[
          _TopInfoCard(),
          _CarResident(),
          _ParkCar(),
        ],
      ),
    );
  }
}
