import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../app.dart';

class ProductState {
  CartController cartController = Get.put(CartController());

  // review form
  final reviewFormKey = GlobalKey<FormState>();
  final reviewCtrl = TextEditingController();
  final reviewFocusNode = FocusNode();
  RxDouble rating = 0.0.obs;
  RxBool hasRatingError = false.obs;

  // reviews
  RxList<ReviewModel> reviews = <ReviewModel>[].obs;
  RxBool isReviewLoading = false.obs;
  RxBool hasReviewError = false.obs;

  RxDouble appbarOpacity = 0.0.obs;
  RxBool isLoading = false.obs;

  // product additional info, displayed on the harakteristiki
  RxList<ProductAdditionalInfoModel> productAdditionalInfoList = <ProductAdditionalInfoModel>[].obs;
  RxBool isAdditionalInfoLoading = false.obs;
  RxBool hasAdditionalInfoError = false.obs;

  Rxn<AttributeModel> attribute = Rxn<AttributeModel>();
  Rxn<Option> selectedOption = Rxn<Option>();
  Rxn<ProductModel> selectedProduct = Rxn<ProductModel>();

  Rxn<SimpleAttributeModel> simpleAttribute = Rxn<SimpleAttributeModel>();
  Rxn<SimpleOption> selectedSimpleOption = Rxn<SimpleOption>();
}
