What’s TextButton?

A Material Design ‘Text Button’. Use text buttons on toolbars, in dialogs, or inline with other content but offset from that content with padding so that the button’s presence is obvious.

Check the official documentation for more.

TextButton explained for Android Developers

Text buttons do not have visible borders and must therefore rely on their position relative to other content for context. In dialogs and cards, they should be grouped together in one of the bottom corners. Avoid using text buttons where they would blend in with other content, for example in the middle of lists. This is similar to how Android developers use buttons in layouts, where the visual hierarchy and spacing are crucial for usability.

Example Code

Here is an example of how to use TextButton:

TextButton(
onPressed: () {},
child: const Text('Enabled'),
)
TextButton(
onPressed: null,
child: Text('Disabled'),
)

TextButton Remarks

The static styleFrom method is a convenient way to create a text button ButtonStyle from simple values.

Bootstrap Your app with ShipFlutter

A fully customizable starter kit to seamlessly launch responsive Android, iOS, and Web apps with Flutter powered by Firebase and Vertex AI.