-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from aninarafath6/admin
Admin
- Loading branch information
Showing
14 changed files
with
149 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 55 additions & 55 deletions
110
arnhss-app/lib/features/users/admin/admission/view_model/course_view_model.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
import 'package:arnhss/common/routes/index_routes.dart'; | ||
import 'package:arnhss/extensions/string_extension.dart'; | ||
import 'package:arnhss/features/users/admin/admission/model/batch_model.dart'; | ||
import 'package:arnhss/features/users/admin/admission/model/course_model.dart'; | ||
import 'package:arnhss/features/users/admin/admission/repo/admission_service.dart'; | ||
import 'package:arnhss/services/base/exception/app_exceptions.dart'; | ||
import 'package:arnhss/services/base/exception/handle_exception.dart'; | ||
import 'package:intl/intl.dart'; | ||
// import 'package:arnhss/common/routes/index_routes.dart'; | ||
// import 'package:arnhss/extensions/string_extension.dart'; | ||
// import 'package:arnhss/features/users/admin/admission/model/batch_model.dart'; | ||
// import 'package:arnhss/features/users/admin/admission/model/course_model.dart'; | ||
// import 'package:arnhss/features/users/admin/admission/repo/admission_service.dart'; | ||
// import 'package:arnhss/services/base/exception/app_exceptions.dart'; | ||
// import 'package:arnhss/services/base/exception/handle_exception.dart'; | ||
// import 'package:intl/intl.dart'; | ||
|
||
class CourseViewModel with ChangeNotifier, HandleException { | ||
final List<Batch> _batches = []; | ||
// int get batchCount => _batches.length; | ||
// class CourseViewModel with ChangeNotifier, HandleException { | ||
// final List<Batch> _batches = []; | ||
// // int get batchCount => _batches.length; | ||
|
||
//* getters. | ||
// List<Batch> get batches => _batches; | ||
// //* getters. | ||
// // List<Batch> get batches => _batches; | ||
|
||
// //* setters. | ||
// set _toggleLoading(bool state) { | ||
// _loading = state; | ||
// notifyListeners(); | ||
// } | ||
// // //* setters. | ||
// // set _toggleLoading(bool state) { | ||
// // _loading = state; | ||
// // notifyListeners(); | ||
// // } | ||
|
||
// set _setBatch(List<Batch> newBatch) { | ||
// // _batches.clear(); | ||
// _batches.addAll(newBatch); | ||
// // set _setBatch(List<Batch> newBatch) { | ||
// // // _batches.clear(); | ||
// // _batches.addAll(newBatch); | ||
|
||
// notifyListeners(); | ||
// } | ||
// // notifyListeners(); | ||
// // } | ||
|
||
// //* add course functionality | ||
// Future<bool> addBatch(Course course) async { | ||
// bool isValid = validate(); | ||
// // //* add course functionality | ||
// // Future<bool> addBatch(Course course) async { | ||
// // bool isValid = validate(); | ||
|
||
// // * validate inputs fields | ||
// if (isValid) { | ||
// //* create new course with new data | ||
// Batch newBatch = Batch( | ||
// name: nameController.text.trim().capitalize, | ||
// startDate: startDateController, | ||
// code: batchCodeController.text.trim().toUpperCase(), | ||
// endDate: endDateController, | ||
// id: "", | ||
// ); | ||
// // // * validate inputs fields | ||
// // if (isValid) { | ||
// // //* create new course with new data | ||
// // Batch newBatch = Batch( | ||
// // name: nameController.text.trim().capitalize, | ||
// // startDate: startDateController, | ||
// // code: batchCodeController.text.trim().toUpperCase(), | ||
// // endDate: endDateController, | ||
// // id: "", | ||
// // ); | ||
|
||
// //* start loading | ||
// //* and set course on firebase | ||
// _setToggleLoading = true; | ||
// await _admissionService.addBatch(newBatch, courseId: course.id).then( | ||
// (course) => _setBatch = [ | ||
// ..._batches, | ||
// course ?? newBatch, | ||
// ], | ||
// ); | ||
// //* set loading as false | ||
// _setToggleLoading = false; | ||
// // //* start loading | ||
// // //* and set course on firebase | ||
// // _setToggleLoading = true; | ||
// // await _admissionService.addBatch(newBatch, courseId: course.id).then( | ||
// // (course) => _setBatch = [ | ||
// // ..._batches, | ||
// // course ?? newBatch, | ||
// // ], | ||
// // ); | ||
// // //* set loading as false | ||
// // _setToggleLoading = false; | ||
|
||
// //* clear input controllers's value | ||
// clearControllers(); | ||
// return true; | ||
// } else { | ||
// return false; | ||
// } | ||
// } | ||
// // //* clear input controllers's value | ||
// // clearControllers(); | ||
// // return true; | ||
// // } else { | ||
// // return false; | ||
// // } | ||
// // } | ||
|
||
|
||
} | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.