19 lines
644 B
Dart
19 lines
644 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:initial_folder/base_service.dart';
|
|
import 'package:initial_folder/models/instructor_model.dart';
|
|
import 'package:http/http.dart' as http;
|
|
|
|
class InstructorService {
|
|
Future<InstructorModel> getInstructorProfile(id) async {
|
|
Uri url = Uri.parse('$baseUrl/homepage/course/detail/instructor/$id');
|
|
http.Response response = await http.get(url, headers: baseHeader);
|
|
print('instructor' + response.body);
|
|
if (response.statusCode == 200) {
|
|
return InstructorModel.fromJson(jsonDecode(response.body));
|
|
} else {
|
|
throw Exception('Data Profile Instruktur Gagal Diambil');
|
|
}
|
|
}
|
|
}
|