import 'package:flutter/material.dart';
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_model.dart';
import 'package:hub/components/organism_components/menu_component/menu_component_model.dart';
import 'package:hub/components/organism_components/message_well_component/message_well_component_model.dart';
import 'package:hub/flutter_flow/flutter_flow_model.dart';
import 'package:hub/pages/home_page/home_page_widget.dart';
import 'package:hub/shared/utils/storage_util.dart';

class HomePageModel extends FlutterFlowModel<HomePageWidget> {
  bool isGrid = false;
  late final String devUUID;
  late final String cliUUID;
  late final String userUUID;
  late final String userName;
  late final String userEmail;

  final unfocusNode = FocusNode();
  FocusNode? textFieldFocusNode;
  TextEditingController? textController;
  String? Function(BuildContext, String?)? textControllerValidator;
  late LocalProfileComponentModel localComponentModel;
  late MenuComponentModel menuComponentModel;
  late MessageWellComponentModel messageWellComponentModel;

  Future<void> _initVariable() async {
    devUUID = StorageUtil().devUUID;
    cliUUID = StorageUtil().cliUUID;
    userUUID = StorageUtil().userUUID;
    userName = StorageUtil().userName;
    userEmail = StorageUtil().email;
  }

  @override
  void initState(BuildContext context) {
    _initVariable();
    localComponentModel =
        createModel(context, () => LocalProfileComponentModel());
    menuComponentModel = createModel(context, () => MenuComponentModel());
    messageWellComponentModel =
        createModel(context, () => MessageWellComponentModel());
  }

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

    localComponentModel.dispose();
    menuComponentModel.dispose();
    messageWellComponentModel.dispose();
  }
}
