I am trying to implement some Cut Out Text Effect
as indicated in https://stackoverflow.com/a/55570169/8096916.
It works well until I want to add a Vertical padding
to the text.
NORMAL:
ShaderMask(
blendMode: BlendMode.srcOut,
shaderCallback: (bounds) =>
LinearGradient(colors: [Colors.white], stops: [0.0]).createShader(bounds),
child: Text('Example'),
);
WITH HORIZONTAL PADDING:
ShaderMask(
blendMode: BlendMode.srcOut,
shaderCallback: (bounds) =>
LinearGradient(colors: [Colors.white], stops: [0.0]).createShader(bounds),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child:
Text('Example'),
),);
WITH VERTICAL PADDING
ShaderMask(
blendMode: BlendMode.srcOut,
shaderCallback: (bounds) =>
LinearGradient(colors: [Colors.white], stops: [0.0]).createShader(bounds),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child:
Text('Example'),
),);
I also tried give a height in the TextStyle but has the same effect as the vertical padding.