Skip to content

How to make a Button with it's label is a Widget? #523

Answered by tilucasoli
lvsecoto asked this question in Q&A
Discussion options

You must be logged in to vote

I recommend using a builder in the label property and passing the TextSpec to the builder, as who implements this button can utilize it to receive the TextSpec and apply to a TextSpecWidget.

Button(
  label: (spec) {
    Row(
        child: [
          TextSpecWidget('Text with Mix Style', spec: spec),
          Text('Text with ThemeData Style'),
          OthersWidget(),
        ]
      ),
    }
)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tilucasoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants