I aimed for a striking, bold look for the text in my Flutter widget, intending it to serve as a title.
Initially, I experimented with setting the fontWeight property to FontWeight.bold and even tried FontWeight.w900, but neither provided the level of thickness and boldness I desired.
After delving deeper into research, I discovered a solution: utilizing the foreground property within the textStyle, which is then applied to the text.
While this addressed the issue of thickness and boldness, a new problem emerged. As visible in the attached image, there are dark outlines surrounding each letter, conforming to their shapes. Although I’m unsure of the precise term for these lines, I’m eager to explore potential solutions to eliminate them.
Below is the code snippet illustrating my current approach:
final titleTextStyle = Theme.of(context)
.textTheme
.bodyLarge!
.copyWith(
fontWeight: FontWeight.w900,
fontSize: 50,
letterSpacing: 3,
foreground: Paint()
..style = PaintingStyle.stroke
..strokeWidth = thickness
..color = color,
);
Attached is an image showcasing the current output: