There is no heavy widget, that why I am facing this issue:
Code:
Obx(()=>InkWell(
onTap: (){
controller.login();
},
child: Container(
alignment: Alignment.center,
height: 50,
width: 150,
color: Colors.greenAccent,
child: Text('Login Here'),
),
),
),
I just want to call this function properly, instead it gives me error of improper use of GetX
2
Answers
the
Getx
hasObx
widget in order that it triggeres updates if that widget uses some observableRx
, if you didn’t use any of it then this error is thrown since it is a waste of resources.you will need either to start using an actual observable
Rx<T>
inside of it if you need it. otherwise if you don’t want to update that widget then you don’t need to wrap it withObx
.