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

import 'package:flutter/material.dart';
import 'package:hub/pages/message_history_page/message_history_page_widget.dart';

class MessageHistoryPageModel
    extends FlutterFlowModel<MessageHistoryPageWidget> {
  ///  State fields for stateful widgets in this page.
  ///

  //copyWith

  final unfocusNode = FocusNode();
  // State field(s) for TextField widget.
  FocusNode? textFieldFocusNode;
  TextEditingController? textController;
  String? Function(BuildContext, String?)? textControllerValidator;

  TabController? tabBarController;
  int get tabBarCurrentIndex =>
      tabBarController != null ? tabBarController!.index : 0;

  /// Query cache managers for this widget.

  final _getLiberationsManager = StreamRequestManager<ApiCallResponse>();
  Stream<ApiCallResponse> getLiberations({
    String? uniqueQueryKey,
    bool? overrideCache,
    required Stream<ApiCallResponse> Function() requestFn,
  }) =>
      _getLiberationsManager.performRequest(
        uniqueQueryKey: uniqueQueryKey,
        overrideCache: overrideCache,
        requestFn: requestFn,
      );
  void clearGetLiberationsCache() => _getLiberationsManager.clear();
  void clearGetLiberationsCacheKey(String? uniqueKey) =>
      _getLiberationsManager.clearRequest(uniqueKey);

  @override
  void initState(BuildContext context) {}

  @override
  void dispose() {
    unfocusNode.dispose();
    textFieldFocusNode?.dispose();
    textController?.dispose();
    tabBarController?.dispose();

    /// Dispose query cache managers for this widget.

    clearGetLiberationsCache();
  }
}
