import 'package:dio/dio.dart';
import '../model/course_model.dart';

// https://imes-api.myitsol.com/api/v1/public/search-courses
// https://imes-api.myitsol.com/api/v1/public/courses/lesson-free?startRecord=0&size=10
// https://imes-api.myitsol.com/api/v1/public/course/02483841-81c4-4d64-b0de-d271654854fe
class RemoteCourse{
  Future<CourseModel?> getCourseModel() async{
    var dio = Dio();
    String url = ("https://imes-api.myitsol.com/api/v1/public/courses/lesson-free?startRecord=0&size=10");
    var response = await dio.get(url);
    if(response.statusCode == 200){
      var json = response.data;
      return CourseModel.fromJson(json);
    }
    return null;
  }
}