import '/backend/api_requests/api_calls.dart';
import '/components/appbar_widget.dart';
import '/components/nav_bar1_widget.dart';
import '/components/no_permission_widget.dart';
import '/flutterlib/flutter_button_tabbar.dart';
import '/flutterlib/flutter_theme.dart';
import '/flutterlib/flutter_util.dart';
import '/flutterlib/flutter_widgets.dart';
import 'account1_widget.dart' show Account1Widget;
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';

class Account1Model extends FlutterModel<Account1Widget> {
  ///  Local state fields for this page.

  bool checkPermission20 = false;

  ///  State fields for stateful widgets in this page.

  final unfocusNode = FocusNode();
  // Stores action output result for [Backend Call - API (Check role has permission)] action in account1 widget.
  ApiCallResponse? apiResult20;
  // Stores action output result for [Backend Call - API (logout)] action in Button widget.
  ApiCallResponse? logout;
  // State field(s) for TabBar widget.
  TabController? tabBarController;
  int get tabBarCurrentIndex =>
      tabBarController != null ? tabBarController!.index : 0;

  // State field(s) for TextField widget.
  FocusNode? textFieldFocusNode1;
  TextEditingController? textController1;
  String? Function(BuildContext, String?)? textController1Validator;
  // State field(s) for TextField widget.
  FocusNode? textFieldFocusNode2;
  TextEditingController? textController2;
  String? Function(BuildContext, String?)? textController2Validator;
  // State field(s) for TextField widget.
  FocusNode? textFieldFocusNode3;
  TextEditingController? textController3;
  String? Function(BuildContext, String?)? textController3Validator;
  // State field(s) for Switch widget.
  bool? switchValue;
  // Model for noPermission component.
  late NoPermissionModel noPermissionModel;
  // Model for NavBar1 component.
  late NavBar1Model navBar1Model;
  // Model for appbar component.
  late AppbarModel appbarModel;

  /// Initialization and disposal methods.

  void initState(BuildContext context) {
    noPermissionModel = createModel(context, () => NoPermissionModel());
    navBar1Model = createModel(context, () => NavBar1Model());
    appbarModel = createModel(context, () => AppbarModel());
  }

  void dispose() {
    unfocusNode.dispose();
    tabBarController?.dispose();
    textFieldFocusNode1?.dispose();
    textController1?.dispose();

    textFieldFocusNode2?.dispose();
    textController2?.dispose();

    textFieldFocusNode3?.dispose();
    textController3?.dispose();

    noPermissionModel.dispose();
    navBar1Model.dispose();
    appbarModel.dispose();
  }

  /// Action blocks are added here.

  /// Additional helper methods are added here.
}
