title: how to Flutter Getx binds obs to Widget?
body: <p>when I use <code>Getx</code> to update my Widget?
  I do not know <code>Rx()</code> how to contact to the thing I put in.</p>
  <p>code is <code>_obx=Rx()</code>.
  but I send data is <code>&quot;&quot;.obs</code>. that is not <code>Rx()</code> but this is <code>RxString()</code>.
  when I use <code>&quot;&quot;.obs.value=&quot;newString&quot;</code>. why <code>Rx()</code> can know that who updates data.</p>
  <p>just like :</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:get/get.dart';
  
  class GetIncrementPage extends StatefulWidget {
    GetIncrementPage({Key key}) : super(key: key);
  
    @override
    _GetIncrementPageState createState() =&gt; _GetIncrementPageState();
  }
  
  class _GetIncrementPageState extends State&lt;GetIncrementPage&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text('get'),
        ),
        body: Container(
          alignment: Alignment.center,
          child: _body(),
        ),
      );
    }
  
    Widget _body() {
      return Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          OutlineButton(
            child: Text('get 数字加减'),
            onPressed: c.increment,
          ),
          OutlineButton(
            child: Text('get log 变化'),
            onPressed: c.change,
          ),
  
          Obx(() {
            printInfo(info: '刷新了页面 get_example');
            return Text(c.count.toString());
          }),
  
          ObxValue((v) {
            printInfo(info: '刷新了页面 get_ObxValue_log1 ');
            return Text('logValue:' + v.toString());
          }, ObjectKey('key').obs),
  
          Obx(() {
            printInfo(info: '刷新了页面 get_obx_log1');
  
            return Text('logObx:' + c.log.toString());
          }),
          Obx(() {
            printInfo(info: '刷新了页面 get_obx_log2');
  
            return Text(c.log2.toString());
          }),
  
          // ObxValue((var value) =&gt; Text('${value.toString()}'), c),
        ],
      );
    }
  
    @override
    void dispose() {
      Get.delete&lt;Controller2&gt;();
      super.dispose();
    }
  
    final Controller2 c = Get.put(Controller2());
  }
  
  ///
  /// Created by fgyong on 2020/10/22.
  ///
  
  class Controller2 extends GetxController {
    var count = 0.obs;
    var count2 = 0.obs;
  
    final log = ''.obs;
    final log2 = ''.obs;
  
    increment() =&gt; count++;
    @override
    void onClose() {
      printInfo(info: 'Controller close');
      super.onClose();
    }
  
    void change() {
      log.value += ' ${log.value.length}';
    }
  }
  
  </code></pre>
  <p>when i change log.value to new String,why log2 do not fresh.</p>
  <pre><code>class Obx extends StatefulWidget {
    final WidgetCallback builder;
  
    const Obx(this.builder);
  
    _ObxState createState() =&gt; _ObxState();
  }
  
  class _ObxState extends State&lt;Obx&gt; {
    RxInterface _observer;
    StreamSubscription subs;
  
    _ObxState() {
      _observer = Rx();
    }
  
    @override
    void initState() {
      subs = _observer.subject.stream.listen((data) =&gt; setState(() {}));
      super.initState();
    }
  
    @override
    void dispose() {
      subs.cancel();
      _observer.close();
      super.dispose();
    }
  
    Widget get notifyChilds {
      final observer = getObs;
      getObs = _observer;
      final result = widget.builder();
      if (!_observer.canUpdate) {
        throw &quot;&quot;&quot;
        [Get] the improper use of a GetX has been detected. 
        You should only use GetX or Obx for the specific widget that will be updated.
        If you are seeing this error, you probably did not insert any observable variables into GetX/Obx 
        or insert them outside the scope that GetX considers suitable for an update 
        (example: GetX =&gt; HeavyWidget =&gt; variableObservable).
        If you need to update a parent widget and a child widget, wrap each one in an Obx/GetX.
        &quot;&quot;&quot;;
      }
      getObs = observer;
      return result;
    }
  
    @override
    Widget build(BuildContext context) =&gt; notifyChilds;
  }
  </code></pre>
  <p>Why can rx() establish contact with the log, please help me. When I update
  How can Rx() know when logging？</p>
  <p>just help me.</p>