API's implementation 1.0
parent
5b155690b1
commit
0ba98d1d32
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
@ -1,3 +1,23 @@
|
||||
enum APPSTATUS { loading, unAuthenticated, authenticated, unverified }
|
||||
enum AuthMethodTypes { sms, whatsApp, fingerPrint, faceID, moreOptions }
|
||||
enum ViewState { idle, busy, error, busyLocal, errorLocal }
|
||||
enum APPSTATUS {
|
||||
loading,
|
||||
unAuthenticated,
|
||||
authenticated,
|
||||
unverified,
|
||||
}
|
||||
|
||||
enum AuthMethodTypes {
|
||||
sms,
|
||||
whatsApp,
|
||||
fingerPrint,
|
||||
faceID,
|
||||
moreOptions,
|
||||
}
|
||||
|
||||
enum ViewState {
|
||||
hide,
|
||||
idle,
|
||||
busy,
|
||||
error,
|
||||
busyLocal,
|
||||
errorLocal,
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
import 'package:hmg_nurses/classes/enums.dart';
|
||||
import 'package:hmg_nurses/model/login/project_info_model.dart';
|
||||
import 'package:hmg_nurses/provider/base_vm.dart';
|
||||
import 'package:hmg_nurses/services/api_repo/login_api_repo.dart';
|
||||
import 'package:injector/injector.dart';
|
||||
|
||||
class LoginProviderModel extends BaseViewModel {
|
||||
LoginProviderModel() {
|
||||
setOnlyState(ViewState.hide);
|
||||
}
|
||||
|
||||
final ILoginApiRepo _loginApiRepo = Injector.appInstance.get<ILoginApiRepo>();
|
||||
|
||||
late List<ProjectInfoModel> assignedBranches;
|
||||
|
||||
getAssignedBranches(String userId) async {
|
||||
setState(ViewState.busy);
|
||||
assignedBranches = await _loginApiRepo.getProjectInfo(userId);
|
||||
print(assignedBranches.length);
|
||||
setState(ViewState.idle);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue