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

import '../model/lesson_model.dart';


// https://imes-api.myitsol.com/api/v1/student/course/part?lessonId=fb228efa-7b32-419e-98b4-a6d5135f4361
class RemoteLesson{
  Future<LessonModel?> getLessonModel({required BuildContext context,required String lessonID}) async{
    var dio = Dio();
    String url = ("https://imes-api.myitsol.com/api/v1/student/course/part?lessonId=");
    var response = await dio.get(url+lessonID);
    if(response.statusCode == 200){
      var json = response.data;
      return LessonModel.fromJson(json);
    }
    return null;
  }
}