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/ef6c4a7b-54f7-46b7-9ffd-99b057baa757
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;
  }
}