-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from shinyina/feature/swtich-custom-fontsize
feat(TDSwitch): 添加自定义“开/关”字体大小
- Loading branch information
Showing
4 changed files
with
99 additions
and
44 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
16 changes: 16 additions & 0 deletions
16
tdesign-component/example/assets/code/switch._customTextFont.txt
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,16 @@ | ||
|
||
Widget _customTextFont(BuildContext context) { | ||
return _buildItem( | ||
context, | ||
const TDSwitch( | ||
type: TDSwitchType.text, | ||
openText: '开', | ||
closeText: '关', | ||
thumbContentOffColor: Colors.red, | ||
thumbContentOnColor: Colors.green, | ||
thumbContentOnFont: TextStyle(fontSize: 18), | ||
thumbContentOffFont: TextStyle(fontSize: 12), | ||
), | ||
title: '基础开关', | ||
); | ||
} |
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
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