getx icon indicating copy to clipboard operation
getx copied to clipboard

can't get controller methods or vara with GetVIew

Open heshesh2010 opened this issue 2 years ago • 0 comments

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';

}

heshesh2010 avatar Jul 25 '22 14:07 heshesh2010