import 'package:feelverapp/model/shoplistdetail/shoplistdetail_Model.dart';
import 'package:feelverapp/service/Loading.dart';
import 'package:feelverapp/service/api.dart';
import 'package:feelverapp/service/base_presenter.dart';
import 'package:feelverapp/ui/shop/shop_list_detail.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';


class ShoplistdetailPresenter extends BasePresenter<ShopListDetail>{
  Api _api;
  final formkey = GlobalKey<FormState>();
  shoplistdetailModel model;
  ShoplistdetailPresenter(State<ShopListDetail> state) : super(state);


  Detai(String id) async{
   
    _api = Api<shoplistdetailModel>();
    var res = await _api.shoplistDetail({
      "id": id,
    });
      
    if (res.fail == null) {
        setState(() {
        model = res.success;
        print("complete");

  
      });
      print('res Success');
    } else {
      print('res Fail');
    }
  }
   gotoDirection(String lat,String lng){

print("debug");
    print(lat);
        print(lng);

    launch('https://www.google.com/maps/dir/?api=1&destination=${lat},${lng}');
  }

}