Skip to content

Migration help when moving from onWidgets to onRenderBlock? #1108

Answered by mark8044
mark8044 asked this question in Q&A
Discussion options

You must be logged in to vote

Ok so I came up with this and I think it works....

Is this the proper migration in your opinion?

      meta.register(BuildOp(
        onRenderBlock: (tree, placeholder)
          {
          buildColumnPlaceholder(meta, [placeholder])?.wrapWith(
                  (_, child) {

                if (meta.element.parent == null)
                {
                  return _TextPadding(MyWidget(child: child), textPadding);   // first quote
                }
                else
                {
                  return MyWidget(child: child); 
                }
                }

          );
          return placeholder;
          }
      ));

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by mark8044
Comment options

You must be logged in to vote
5 replies
@mark8044
Comment options

@daohoangson
Comment options

@mark8044
Comment options

@daohoangson
Comment options

@ArvidNy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants