I am using Get (getx) package to manage the state of my app, and I am trying to use a controller inside another one. For example I have a class the contains methods for firebase authentication
class FirebaseAuthController extends GetxController {
static FirebaseAuthController get to => Get.find<FirebaseAuthController>();
.....
Future<void> createUser(String email, String password) async {
try {
await _auth.createUserWithEmailAndPassword(
email: email, password: password);
} catch (e) {
...
}
}
...
...
}
and I have another controller which is signUpController that interacts with the UI
class SignInController extends GetxController {
static SignInController get to => Get.find<SignInController>();
...
....
Future<void> clickSignInButton() async {
print(emailController.text);
print(passwordController.text);
if (formKey.currentState.validate()) {
try {
await FirebaseAuthController.to
.login(emailController.text, passwordController.text);
} catch (e) {
print(e);
}
}
}
}
when I try to do this, it gives me an error
lib/screens/authentication_screens/controller/sign_up_controller.dart:56:37: Error: Getter not found: 'to'.
await FirebaseAuthController.to
any idea what might be the issue?