Last active
December 6, 2021 19:49
-
-
Save mihalycsaba/0cbaa938873ba2a1553b7189f3e8ea85 to your computer and use it in GitHub Desktop.
text background paint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Center( | |
child: Stack( | |
children: [ | |
Text( | |
'sadasdasdadsadsadsdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffsdadasdadasdd', | |
style: TextStyle( | |
color: Colors.transparent, | |
fontWeight: FontWeight.w600, | |
fontSize: 20, | |
background: Paint() | |
..strokeWidth = 25 | |
..color = Colors.grey | |
..style = PaintingStyle.stroke | |
..strokeJoin = StrokeJoin.round)), | |
const Text( | |
'sadasdasdadsadsadsdsffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffsdadasdadasdd', | |
style: TextStyle( | |
fontWeight: FontWeight.w600, | |
fontSize: 20, | |
backgroundColor: Colors.transparent)) | |
], | |
)))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment