DEV Community

Cover image for DefaultTextStyle in FLutter
vasanthkumar
vasanthkumar

Posted on • Edited on

2 2

DefaultTextStyle in FLutter

If you want to have a default Text Style down the tree.we can use the DefaultTextStyle. All you need to do is to mention the style and wrap the child around DefaultTextStyle.
The text style to apply to descendant Text widgets which don't have an explicit style.

style: TextStyle(
          fontSize: 20,
          fontWeight: FontWeight.bold,
          color: Colors.black,
        ),
Enter fullscreen mode Exit fullscreen mode


Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more