Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Document] Can write a document to explaining each rendering function? #1499

Open
xieyezi opened this issue Jun 1, 2021 · 1 comment
Open

Comments

@xieyezi
Copy link

xieyezi commented Jun 1, 2021

Is your feature request related to a problem? Please describe.

We all know that getx have many render function in views, there are:

  • Obx(()=>())
Obx (() => Text (controller.name));
  • GetBuilder<Controller>
GetBuilder<CountController>(
  init: controller,
  initState: (_) {},
  builder: (controller) {
    return Text('value -> ${controller.count}');
  },
),
  • GetX<Controller>
GetX<Controller>(
  builder: (controller) {
    print("count 1 rebuild");
    return Text('${controller.count1.value}');
  },
),
  • ValueBuilder<bool>
ValueBuilder<bool>(
  initialValue: false,
  builder: (value, updateFn) => Switch(
    value: value,
    onChanged: updateFn, 
  ),
  onUpdate: (value) => print("Value updated: $value"),
  onDispose: () => print("Widget unmounted"),
),
  • ObxValue
ObxValue((data) => Switch(
        value: data.value,
        onChanged: data,
    ),
    false.obs,
),
  • GetView<AwesomeController>
 class AwesomeView extends GetView<AwesomeController> {
   @override
   Widget build(BuildContext context) {
     return Container(
       padding: EdgeInsets.all(20),
       child: Text( controller.title )
     );
   }
 }

Describe the solution you'd like

In fact, I really read the documentation carefully, but I really don’t understand these methods, how to use them, and where to use them. And the difference between them.

So can getx provide one document to explain these render function how to use, and where to use?

Thanks!

@manikantag
Copy link

This StackOverflow comment has some explanation about these https://stackoverflow.com/a/65415848/340290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants