// πŸŽ“ 학생 λŒ€μ‹œλ³΄λ“œ(λ§ˆμŠ€ν„° 계정 μ „μš© 계정 κ°•μ œ μ‚­μ œ)의 κΈ°λŠ₯(μ„œλ²„ 톡신/μƒνƒœ) λ‹΄λ‹Ή 컨트둀러. import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import '../config.dart'; class StudentDashboardController extends ChangeNotifier { bool _isLoading = false; bool get isLoading => _isLoading; /// πŸ‘‘ λ§ˆμŠ€ν„° 계정 μ „μš© νšŒμ› μ‚­μ œ API 호좜. Future<(bool success, String message)> deleteUser(String userId) async { _isLoading = true; notifyListeners(); final url = Uri.parse('$baseUrl/api/users/delete/$userId'); try { final response = await http.delete(url); if (response.statusCode == 200) { final responseData = jsonDecode(response.body); return (true, 'βœ… ${responseData['message']}'); } else { final errorData = jsonDecode(response.body); return (false, '❌ μ‚­μ œ μ‹€νŒ¨: ${errorData['detail'] ?? 'μ•Œ 수 μ—†λŠ” 였λ₯˜'}'); } } catch (e) { return (false, '❌ μ„œλ²„μ™€ μ—°κ²°ν•  수 μ—†μŠ΅λ‹ˆλ‹€. (λ„€νŠΈμ›Œν¬ μ—λŸ¬)'); } finally { _isLoading = false; notifyListeners(); } } }