title: Flutter GetX state management does not work
body: <p>The problem I am facing is the ui text doesn't get updated. The data I want, in this case placeName, printed successfully on DEBUG Console, but it doesn't change Text widget UI. I thought in simple statement management in Getx, it would update the variable using update() in a method. I faced similar situation and I couldn't figure that out before, so I had to use statefuleWidget to solve it. But, this time I would like to continue this with Getx.</p>
  <p><a href="https://i.stack.imgur.com/P2qd4.gif" rel="nofollow noreferrer">enter image description here</a></p>
  <p>Could anybody please help me?</p>
  <p>2021-11-10
  I updated my code, but it still doesn't work</p>
  <p>2021-11-18
  I figured it out changing return type of function(searchCoordinateAddress) and assign it to the variable(pickUpLocation) that I wanted to update.</p>
  <pre><code>// home_controller.dart
  class HomeController extends GetxController {
    ...
    Rx&lt;Address&gt; pickUpLocation = Address().obs;
    RxBool isLoading = false.obs;
    ...
  
  
  void locatePosition() async {
    ...
    ...
  
  //  String? address = await UberRepository.to.searchCoordinateAddress(position); // previous
  
  // current
   Address? address = await UberRepository.to.searchCoordinateAddress(position);
   pickUpLocation(address);
   isLoading(true);
  }
  
  
  // previous
  /*
  void updatePickUpLocationAddress(Address pickUpAddress) {
  print(&quot;pickUpAddress.placeName: ${pickUpAddress.placeName}&quot;);
  pickUpLocation(pickUpAddress);
  print(&quot;pickUpLocation.value.placeName: ${pickUpLocation.value.placeName}&quot;);
    }
  }
  */
  </code></pre>
  <pre><code>// uber_repository.dart
  class UberRepository extends GetConnect {
    static UberRepository get to =&gt; Get.find();
  
    @override
    void onInit() {
      httpClient.baseUrl = 'https://maps.googleapis.com/';
      super.onInit();
    }
  
    // Future&lt;String?&gt; // previous
    // current
    Future&lt;Address?&gt; searchCoordinateAddress(Position position) async {
      String placeAddress = &quot;&quot;;
  
      String url =
          'maps/api/geocode/json?latlng=${position.latitude},${position.longitude}&amp;key=$mapKey';
  
      final response = await get(url);
  
      if (response.status.hasError) {
        Future.error(response.statusText!);
      } else {
        placeAddress = response.body[&quot;results&quot;][0][&quot;formatted_address&quot;];
  
        Address userPickUpAddress = Address();
        userPickUpAddress.latitude = position.latitude;
        userPickUpAddress.longitude = position.longitude;
        userPickUpAddress.placeName = placeAddress;
  
  
        return userPickUpAddress; // current
  
        // HomeController().updatePickUpLocationAddress(userPickUpAddress); // previous
  
  
      }
      // return placeAddress; // previous
    }
  }
  </code></pre>
  <pre><code>// home.dart
  class Home extends GetView&lt;HomeController&gt; {
    const Home({
      Key? key,
    }) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
  ...
   body:  Stack(
            children: [
              GoogleMap(
                padding: EdgeInsets.only(
                  bottom: controller.bottomPaddingOfMap.value,
                ),
                mapType: MapType.normal,
                myLocationButtonEnabled: true,
                initialCameraPosition: controller.kGooglePlex,
                myLocationEnabled: true,
                zoomGesturesEnabled: true,
                zoomControlsEnabled: true,
                onMapCreated: (GoogleMapController googleMapController) {
                  controller.controllerGoogleMap.complete(googleMapController);
                  controller.newGoogleMapController = googleMapController;
                  // when map created and map is set correctly, call current location
                  controller.setBottomPaddingOfMap();
                  controller.locatePosition(); 
                },
              ),
  ...
  ...
  Expanded(
      child: Obx(() =&gt; 
                    Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                   children: [
                      // TODO: UI update...
                      !controller.isLoading.value
                            ? CircularProgressIndicator()
                            : Text(
                               controller.pickUpLocation.value != null
                            ? controller.pickUpLocation.value.placeName!
                                 : &quot;Add Home&quot;,
                                 maxLines: 2,
                              overflow: TextOverflow.ellipsis,
                              softWrap: false,
                                ),
                                SizedBox(height: 4.0),
                                Text(
                                  &quot;Your living home address&quot;,
                                  style: TextStyle(
                                    color: Colors.black54,
                                    fontSize: 12.0,
                     ),
                     ),
                    ],
              ),
             ),
       ),
  ...
  
  </code></pre>
  <pre><code>// address.dart
  class Address {
    String? placeFormattedAddress;
    String? placeName;
    String? placeId;
    double? latitude;
    double? longitude;
  
    Address({
      this.placeFormattedAddress,
      this.placeName,
      this.placeId,
      this.latitude,
      this.longitude,
    });
  }
  
  </code></pre>