import 'package:feelverapp/model/shopservice/shop_service_Model.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/shop/shop_service.dart';
import 'package:flutter/material.dart';

class ShopServicePresenter extends BasePresenter<ShopServicePage> {
  Api _api;
  int getid;
  int vendor_id;
  int store_id;
  String user_id;

  final formkey = GlobalKey<FormState>();
  shopserviceModel serviceModel;

  ShopServicePresenter(State<ShopServicePage> state) : super(state);

  Servicelistitem() async {
    _api = Api<shopserviceModel>();
    var res = await _api.shopservice(
        'https://backend-uat.feelver.com/api/product/getListsProductFormat?vendor_id=' +
            vendor_id.toString() +
            '&store_id=' +
            store_id.toString() +
            '&is_paginate=1&per_page=99&v=1');

    if (res.fail == null) {
      setState(() {
        serviceModel = res.success;
        print('${serviceModel.data[1].name}');
      });
    } else {
      print('res Fail');
    }
  }
}
