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
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;
  }
}