Controller sa kojim pozivamo provider

PHOTO EMBED

Wed May 18 2022 09:46:22 GMT+0000 (UTC)

Saved by @Vesko_devv #dart

class HomeController extends GetxController with StateMixin<List<dynamic>> {


  @override
  void onInit() {
    super.onInit();
    UserProvider().getUser().then((resp) {
      change(resp, status: RxStatus.success());
    }, onError: (err) {

      change(
        null,
        status: RxStatus.error(err.toString()),
      );
    });

  }

}
content_copyCOPY