/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-03-23 17:11:18
 * @LastEditTime : 2023-03-30 15:47:20
 * @Description  : Do not edit
 */
import 'package:app_package/app_package.dart';
import 'package:flutter/material.dart';
import 'package:qrcode_package/src/view_models/private_security_detail_store.dart';
import 'package:wisdom_cli/wisdom_cli.dart';

part 'components/desc.dart';
part 'components/option.dart';
part 'components/form.dart';
part 'components/anti_cheating.dart';

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

class _PageView extends StatefulWidget {
  _PageView({Key? key}) : super(key: key);
  @override
  _PageViewState createState() => _PageViewState();
}

class _PageViewState extends State<_PageView> {
  PrivateSecurityDetailStore get store => Provider.of(context, listen: false);
  @override
  Widget build(BuildContext context) {
    final colorScheme = WTheme.of(context).colorScheme;
    // final textTheme = theme.textTheme;

    return Scaffold(
      appBar: WAppBar(
        brightness: Brightness.light,
        iconTheme: IconThemeData(
          color: colorScheme.mainTitle,
          size: 19.pt,
        ),
        backgroundColor: Colors.white,
        title: WisText('巡逻详情',
            size: 19.pt, weight: FontWeight.w600, color: colorScheme.mainTitle),
      ),
      body: WisScrollView(
        onInit: () => store.getData(),
        onRefresh: () => store.getData(),
        slivers: <Widget>[
          _DescComponent(),
          _OptionComponent(),
          _FormComponent(),
          _AntiCheatingComponent(),
        ],
      ),
    );
  }
}
