import 'package:english_learning/core/services/repositories/section_repository.dart'; import 'package:english_learning/features/learning/modules/model/section_model.dart'; import 'package:flutter/foundation.dart'; class SectionProvider extends ChangeNotifier { final SectionRepository _repository = SectionRepository(); List
_sections = []; bool _isLoading = false; String? _error; List
get sections => _sections; bool get isLoading => _isLoading; String? get error => _error; Future fetchSections(String token) async { _isLoading = true; _error = null; notifyListeners(); try { _sections = await _repository.getSections(token); _isLoading = false; notifyListeners(); } catch (e) { _isLoading = false; _error = e.toString(); notifyListeners(); } } }