
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.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 writeReviewService extends BaseService{



  AppSharedPreferences sharedPref = AppSharedPreferences();
  AppGlobal appGlobal = new AppGlobal();

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

  List<OrderModel> get writeReview => writeReview;
  List<OrderModel> _writeReviewList = List();
  List<OrderModel> get orderList => _writeReviewList;


  Future getProductReview() async {
    hasError = false;
    await baseAppClient.getPharmacy(WRITE_REVIEW,
        onSuccess: (dynamic response, int statusCode) {
          _writeReviewList.clear();
          response[''].forEach((item) {
            _writeReviewList.add(OrderModel.fromJson(item));
          });
        }, onFailure: (String error, int statusCode) {
          hasError = true;
          super.error = error;
        });
  }
}