TF-2046 Use controller cached in GetWidget instead of using Get.find<LoginController>()

(cherry picked from commit 4403e2871d6486e693b6c4052df92b7634eadb25)
This commit is contained in:
dab246
2023-07-20 16:02:52 +07:00
committed by Dat Vu
parent efddcc0ae5
commit 980f7e34f3
3 changed files with 23 additions and 24 deletions
@@ -47,7 +47,7 @@ class LoginView extends BaseLoginView {
style: const TextStyle(fontSize: 32, color: AppColor.colorNameEmail, fontWeight: FontWeight.w900)
)
),
Obx(() => buildLoginMessage(context, loginController.viewState.value)),
Obx(() => buildLoginMessage(context, controller.viewState.value)),
Obx(() {
switch (controller.loginFormType.value) {
case LoginFormType.credentialForm:
@@ -179,7 +179,7 @@ class LoginView extends BaseLoginView {
style: const TextStyle(fontSize: 32, color: AppColor.colorNameEmail, fontWeight: FontWeight.w900)
)
),
Obx(() => buildLoginMessage(context, loginController.viewState.value)),
Obx(() => buildLoginMessage(context, controller.viewState.value)),
Obx(() {
switch (controller.loginFormType.value) {
case LoginFormType.credentialForm:
@@ -251,14 +251,14 @@ class LoginView extends BaseLoginView {
style: const TextStyle(fontSize: 16, color: Colors.white)
),
onPressed: () {
loginController.handleSSOPressed();
controller.handleSSOPressed();
}
)
);
}
Widget _buildLoadingProgress(BuildContext context) {
return Obx(() => loginController.viewState.value.fold(
return Obx(() => controller.viewState.value.fold(
(failure) {
switch (controller.loginFormType.value) {
case LoginFormType.baseUrlForm: