import 'package:bloc/bloc.dart';
import 'package:e_commerce_training/src/model/repository/app_repository.dart';
import 'package:e_commerce_training/src/model/response/viewed_product_response.dart';
import 'package:meta/meta.dart';

part 'viewed_products_state.dart';

class ViewedProductsCubit extends Cubit<ViewedProductsState> {
  final AppRepository repository;
  ViewedProductsCubit(this.repository) : super(ViewedProductsInitial());
  List<ViewedProductsResponse> listProduct = [];
  int index= 0;
  void addViewedProduct() {
    listProduct.add(
      ViewedProductsResponse(
        listViewedProduct: [
          ListViewedProduct(
            id: 1,
            thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2020/09/ostelin-vitamin-d-calcium-cua-uc-5f4daddea5953-01092020091142.jpg",
            title: "Ostelin Calcium & Vitamin D3 Của Úc, 130 viên",
            price: "100000",
            producer: "Hãng sản xuất:",
            evaluate: "(50)",
            manufacture: "Pháp"
          ),
          ListViewedProduct(
            id: 2,
            thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2020/10/detoxic-cua-nga-chinh-hang-mua-2-tang-1-mua-3-tang-2-5f8953e50f36f-16102020150349.png",
            title: "Detoxic Của Nga Chính Hãng (Mua 2 Tặng 1, Mua 3 Tặng 2), Đen - con nhộng",
            price: "400000",
            producer: "Hãng sản xuất:",
            evaluate: "(50)",
            manufacture: "Mỹ"
          ),
          ListViewedProduct(
            id: 3,
            thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/05/ginkgo-biloba-120mg-trunature-cua-my-60b4a7ba25854-31052021160914.jpg",
            title: "Kẹo Bổ Sung Vitamin Cho Người Lớn Kirkland Adult Multivitamin",
            price: "100000",
            producer: "Hãng sản xuất:",
            evaluate: "(50)",
            manufacture: "Việt Nam"
          ),
          ListViewedProduct(
            id: 4,
            thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2019/01/dong-ho-timex-expedition-tw4b10200-tre-trung-cho-nam-5c3e99ee8a1fb-16012019094150.jpg",
            title: "Đồng Hồ Timex Expedition TW4B10200 Trẻ Trung Cho Nam",
            price: "300000",
            producer: "Hãng sản xuất:",
            evaluate: "(50)",
            manufacture: "Canada"
          ),
          ListViewedProduct(
            id: 5,
            thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/02/bh-12-thang-may-lam-sua-hat-ukoeo-pr5-plus-tieu-chuan-chau-au-60375918ae0a2-25022021150024.jpg",
            title: "Máy Làm Sữa Hạt Ukoeo PR5 Plus Tiêu Chuẩn Châu Âu",
            price: "200000",
            producer: "Hãng sản xuất:",
            evaluate: "(50)",
            manufacture: "Thái Lan"
          ),
          ListViewedProduct(
              id: 5,
              thumb: "https://cdn.chiaki.vn/unsafe/0x900/left/top/smart/filters:quality(90)/https://chiaki.vn/upload/product/2021/02/bh-12-thang-may-lam-sua-hat-ukoeo-pr5-plus-tieu-chuan-chau-au-60375918ae0a2-25022021150024.jpg",
              title: "Máy Làm Sữa Hạt Ukoeo PR5 Plus Tiêu Chuẩn Châu Âu",
              price: "200000",
              producer: "Hãng sản xuất:",
              evaluate: "(50)",
              manufacture: "Thái Lan"
          ),
        ],
      ),
    );
  }
}
