You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document "How to create a widget with a custom RenderObject" #5173
A “creating a custom widget” section in basic Flutter layout documentation would be helpful, as the setup for a new Custom Widget requires a lot of knowledge up front:
Just the RenderBox performLayout() method has several important duties that aren’t reflected in its args or a return value
Loop through all the children via a linked list starting with “firstChild”
The RenderBox doc was pretty useful. Especially examples like with RenderOpacity. I think a page like https://flutter.io/tutorials/layout/ that walks through a hypothetical exercise with a flow-chart like structure would be nice too.
i.e. so you want to write your own RenderBox?
How many children?
-> Common reusable utils
-> One
-> Many
Do you want to customize layout?
-> Override X, details
-> Override Y, details
-> Example/exercise
Do you want to paint different?
-> Override X, details
-> Override Y, details
-> Example/exercise
@zoechi Should this be moved to the website repo? Most people I've talked to expect this to be a tutorial on the website. The API docs already have a lot of information on this, but most people want some kind of a codelab on this.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
[-]Document "How to create a custom widget"[/-][+]Document "How to create a widget with a custom RenderObject"[/+]Hixie commentedon Nov 14, 2017
Some of this is documented now in the RenderBox and RenderObject API docs. Maybe we should add more to the RenderObjectWidget API docs too?
xster commentedon Dec 21, 2017
The RenderBox doc was pretty useful. Especially examples like with RenderOpacity. I think a page like https://flutter.io/tutorials/layout/ that walks through a hypothetical exercise with a flow-chart like structure would be nice too.
i.e.
so you want to write your own RenderBox?
How many children?
-> Common reusable utils
-> One
-> Many
Do you want to customize layout?
-> Override X, details
-> Override Y, details
-> Example/exercise
Do you want to paint different?
-> Override X, details
-> Override Y, details
-> Example/exercise
Roll engine to 40a3712
Roll engine to 40a3712 (#17702)
goderbauer commentedon Dec 27, 2018
@zoechi Should this be moved to the website repo? Most people I've talked to expect this to be a tutorial on the website. The API docs already have a lot of information on this, but most people want some kind of a codelab on this.
zoechi commentedon Dec 27, 2018
I copied it to flutter/website#2122 and am going to close here.
Just reopen if you think there is still api-doc work to do as well.
github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.