Initial commit: Penyerahan final Source code Tugas Akhir

This commit is contained in:
ferdiakhh
2025-07-10 19:15:14 +07:00
commit e1f2206b8a
687 changed files with 80132 additions and 0 deletions

View File

@ -0,0 +1,27 @@
import 'package:flutter/foundation.dart';
import 'package:initial_folder/models/lesson_model.dart';
import 'package:initial_folder/providers/lesson_course_provider.dart';
import 'package:initial_folder/services/current_lesson_service.dart';
class CurrentLessonProvider extends ChangeNotifier {
late LessonModel _currentLesson;
LessonModel get payload => _currentLesson;
ResultState _state = ResultState.loading;
ResultState get state => _state;
Future<dynamic> fetchCurrentLesson(String lessonId) async {
_state = ResultState.loading;
notifyListeners();
try {
final data = await CurrentLessonService().getCurrentLesson(lessonId);
_currentLesson = data;
_state = ResultState.hasData;
notifyListeners();
} catch (e) {
_state = ResultState.error;
notifyListeners();
}
}
}