import 'package:hub/backend/api_requests/api_manager.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';


import 'package:flutter/material.dart';
import 'package:hub/pages/schedule_provisional_visit_page/schedule_provisional_visit_page_widget.dart';

class ScheduleProvisionalVisitPageModel
    extends FlutterFlowModel<ScheduleProvisionalVisitPageWidget> {
  ///  Local state fields for this page.

  bool toggleIdx = false;

  List<dynamic> visitors = [];
  void addToVisitors(dynamic item) => visitors.add(item);
  void removeFromVisitors(dynamic item) => visitors.remove(item);
  void removeAtIndexFromVisitors(int index) => visitors.removeAt(index);
  void insertAtIndexInVisitors(int index, dynamic item) =>
      visitors.insert(index, item);
  void updateVisitorsAtIndex(int index, Function(dynamic) updateFn) =>
      visitors[index] = updateFn(visitors[index]);

  List<String> docs = [];
  void addToDocs(String item) => docs.add(item);
  void removeFromDocs(String item) => docs.remove(item);
  void removeAtIndexFromDocs(int index) => docs.removeAt(index);
  void insertAtIndexInDocs(int index, String item) => docs.insert(index, item);
  void updateDocsAtIndex(int index, Function(String) updateFn) =>
      docs[index] = updateFn(docs[index]);

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

  final unfocusNode = FocusNode();
  // State field(s) for TextField widget.
  FocusNode? textFieldFocusNode1;
  TextEditingController? textController1;
  String? Function(BuildContext, String?)? textController1Validator;
  DateTime? datePicked;
  // 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;
  // Stores action output result for [Backend Call - API (postProvVisitScheduling)] action in sendContainer widget.
  ApiCallResponse? provisionalVisitScheduling;

  @override
  void initState(BuildContext context) {}

  @override
  void dispose() {
    unfocusNode.dispose();
    textFieldFocusNode1?.dispose();
    textController1?.dispose();

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

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