
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';


class CancelOrderService extends BaseService{
  AppSharedPreferences sharedPref = AppSharedPreferences();
  AppGlobal appGlobal = new AppGlobal();

  AuthenticatedUser authUser = new AuthenticatedUser();
  AuthProvider authProvider = new AuthProvider();

  List<OrderDetailModel> _cancelOrderList = List();
  List<OrderDetailModel> get cancelOrderList => _cancelOrderList;
  String url ="";


  Future getCanceledOrder(order) async {
    print("step 1");
    hasError = false;

    dynamic res;

    await baseAppClient.getPharmacy(GET_Cancel_ORDER+order,
        onSuccess: (dynamic response, int statusCode) {
      res = response;
      print(res);
//          _cancelOrderList.clear();
//          response['success'].forEach((item) {
//            _cancelOrderList.add(OrderModel.fromJson(item));
//          });
        }, onFailure: (String error, int statusCode) {
          hasError = true;
          super.error = error;
        });
    return res;
  }
}