Skip to content

Instantly share code, notes, and snippets.

@mihalycsaba
Last active December 6, 2021 19:49
Show Gist options
  • Save mihalycsaba/0cbaa938873ba2a1553b7189f3e8ea85 to your computer and use it in GitHub Desktop.
Save mihalycsaba/0cbaa938873ba2a1553b7189f3e8ea85 to your computer and use it in GitHub Desktop.
text background paint
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