/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2021-03-04 16:06:21
 * @LastEditTime : 2023-05-25 15:38:39
 * @FilePath     : /wisdom-huiguanjia-app/oa_package/lib/src/pages/management/index.dart
 * @Description  : Do not edit
 */
import 'package:flutter/material.dart';
import 'package:wisdom_cli/wisdom_cli.dart';
import 'package:oa_package/src/view_models/management_store.dart';
// ignore: implementation_imports
import 'package:app_package/src/route_observer_util.dart';
import 'view.dart';
part 'index.g.dart';

///路由传递的参数
class ManagementStoreArguments {
  ///页面初始化时，tabbar选中项
  final int? indexStack;
  final stat;
  ManagementStoreArguments({
    this.indexStack,
    this.stat,
  });

  ///
  ///
  ///
  ///
  ///
  ///
  ///
//***以下为模板代码谨慎修改***
  factory ManagementStoreArguments.fromJson(var json) {
    return _$ManagementStoreArgumentsFromJson(json);
  }
  factory ManagementStoreArguments.fromRouteArguments(BuildContext context) {
    return _$ManagementStoreArgumentsFromJson(
        (ModalRoute.of(context)?.settings.arguments ??
            new Map<String, dynamic>()) as Map<String, dynamic>);
  }
  Map<String, dynamic> toJson() => _$ManagementStoreArgumentsToJson(this);
}

///
///
///
///
///
//***以下为模板代码谨慎修改***

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

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

class _ManagementPageState extends State<ManagementPage> with RouteAware {
  final RouteObserver<PageRoute> routeObserver =
      GetIt.I.get<RouteObserverUtil>().routeObserver;

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    routeObserver.subscribe(this, ModalRoute.of(context) as PageRoute<dynamic>);
  }

  @override
  void dispose() {
    routeObserver.unsubscribe(this); //取消订阅
    super.dispose();
  }

  @override
  void didPopNext() {
    // final store = ManagementStore(context);
    // store.onGetTaskTypeList();
  }

  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (_) => ManagementStore(context)),
      ],
      child: ManagementPageView(),
    );
  }
}
// class ManagementPage extends StatelessWidget {
//   const ManagementPage({Key key}) : super(key: key);
//   @override
//   Widget build(BuildContext context) {
// return MultiProvider(
//   providers: [
//     ChangeNotifierProvider(create: (_) => ManagementStore(context)),
//   ],
//   child: ManagementPageView(),
// );
//   }
// }
