import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:amos_flutter_ui/amos_flutter_ui.dart';
import 'package:jcs_airport/services/api.dart';
import 'package:jcs_airport/view/common/base_choose_department.dart';
import 'package:jcs_airport/view/common/tree_view.dart';

///@Description     消防建筑树选择
///@author          helinlin
///@create          2021-09-08 13:42
/*class ChooseFireproofBuilding extends BaseTreeChoose {
  @override
  BaseTreeChooseState getBaseBaseChooseDepartmentState() => _ChooseFireproofBuildingState();

  ChooseFireproofBuilding(Map chooseDepartment) : super(chooseDepartment: chooseDepartment);
}

class _ChooseFireproofBuildingState extends BaseTreeChooseState {
  @override
  Future<void> getData() async {
    Future.delayed(Duration.zero, () async {
      MsgBox.showProgressDialog(context, content: '加载中，请稍后...');
      var data = await API.equipBuildingTree();
      Get.back();
      setState(() {
        if (data != null) {
          departments.addAll(data.first['children']);
        }
      });
    });
  }

  @override
  String getIdKey() => 'id';

  @override
  String getNameKey() => 'name';
}*/

class ChooseFireproofBuild extends StatefulWidget {
  final Map build;

  const ChooseFireproofBuild({Key key, this.build}) : super(key: key);

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

class _ChooseFireproofBuildState extends ChooseTreeState<ChooseFireproofBuild> {
  @override
  Future getData() => API.equipBuildingTree();

  @override
  String getKey() => 'id';

  @override
  String getName() => 'name';
}
