-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liumin
committed
Jan 19, 2021
1 parent
589e009
commit 3840ee6
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ doc/api/ | |
*.js_ | ||
*.js.deps | ||
*.js.map | ||
|
||
.idea |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class StrokeFont { | ||
/// | ||
/// 生成描边字 | ||
/// fontStr 内容 | ||
/// fontSize 字体大小 | ||
/// strokeColor 描边色 | ||
/// strokeWidth 描边宽度 | ||
/// fillColor 填充色 | ||
Widget renderFont (String fontStr, double fontSize, { Color strokeColor: Colors.black,double strokeWidth: 2.0, Color fillColor: Colors.white, }) { | ||
return Stack( | ||
children: [ | ||
Text( | ||
fontStr, | ||
style: TextStyle( | ||
fontSize: fontSize, | ||
fontWeight: FontWeight.bold, | ||
foreground: Paint()..strokeWidth = strokeWidth..color = strokeColor..style = PaintingStyle.stroke, | ||
decoration: TextDecoration.none | ||
), | ||
), | ||
Text( | ||
fontStr, | ||
style: TextStyle( | ||
fontSize: fontSize, | ||
fontWeight: FontWeight.bold, | ||
foreground: Paint()..strokeWidth = strokeWidth..color = fillColor..style = PaintingStyle.fill, | ||
decoration: TextDecoration.none | ||
) | ||
), | ||
], | ||
); | ||
} | ||
} |