import 'package:feelverapp/model/shoplist/shoplist_Model.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/shop/shop_list.dart';
import 'package:flutter/material.dart';

class ShoplistPresenter extends BasePresenter<ShopList> {
  Api _api;
  final formkey = GlobalKey<FormState>();
  shoplistModel shopModel;

  ShoplistPresenter(State<ShopList> state) : super(state);

  Listitem() async {
    _api = Api<shoplistModel>();
    var res = await _api.shoplist({
      "sort": "asc",
      "lang": "en_US",
      "limit": "8",
      "offset": "10",
      "near_location": "18.78635785784557,98.97981414149695",
    });
    if (res.fail == null) {
      setState(() {
        shopModel = res.success;
        print("gggggggggggg");

        print('${shopModel.dATA[0].storeName}');
      });
    } else {
      print('res Fail');
    }
  }
}
