import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import '../model/course_detail_model.dart';

// https://imes-api.myitsol.com/api/v1/public/course/02483841-81c4-4d64-b0de-d271654854fe
class RemoteCourseDetail{
  Future<CourseDetailModel?> getCourseDetailModel({required BuildContext context,required String idCourse}) async{
    var dio = Dio();
    String url = ("https://imes-api.myitsol.com/api/v1/public/course/");
    var response = await dio.get(url+idCourse);
    if(response.statusCode == 200){
      var json = response.data;
      return CourseDetailModel.fromJson(json);
    }
    return null;
  }
}