getx
getx copied to clipboard
can't get controller methods or vara with GetVIew
class DrawerSideMenu extends GetView<AuthController> {
const DrawerSideMenu({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Text(controller.title) // shows error : The getter 'title' isn't defined for the type 'AuthController Function()'.
Try importing the library that defines 'title', correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
}
}
controller.dart
class AuthController extends GetxController {
final String title = 'My Awesome View';
}