feat: update icon
This commit is contained in:
parent
ab9069af40
commit
827b793b9d
|
|
@ -5,24 +5,25 @@ import 'package:yx_icon_fonts_example/example_icon.dart';
|
|||
|
||||
final icons = <ExampleIcon>[
|
||||
// 其他图标
|
||||
ExampleIcon(YXIconFonts.iconVoicepause, 'icon voicepause'),
|
||||
ExampleIcon(YXIconFonts.icon44Search, 'icon 44 search'),
|
||||
ExampleIcon(YXIconFonts.icon36ClearPeople, 'icon 36 clear people'),
|
||||
ExampleIcon(YXIconFonts.icon32Publish, 'icon 32 publish'),
|
||||
ExampleIcon(YXIconFonts.icon32Close, 'icon 32 close'),
|
||||
ExampleIcon(YXIconFonts.icon32Output, 'icon 32 output'),
|
||||
ExampleIcon(YXIconFonts.icon24Download, 'icon 24 download'),
|
||||
ExampleIcon(YXIconFonts.iconVoicePause, 'icon voice pause'),
|
||||
ExampleIcon(YXIconFonts.iconVoice, 'icon voice'),
|
||||
ExampleIcon(YXIconFonts.Subtract, 'Subtract'),
|
||||
ExampleIcon(YXIconFonts.iconSubtract, 'icon subtract'),
|
||||
ExampleIcon(YXIconFonts.icon44CancelAccount, 'icon 44 cancel account'),
|
||||
ExampleIcon(YXIconFonts.icon24Search, 'icon 24 search'),
|
||||
ExampleIcon(YXIconFonts.icon24Up, 'icon 24 up'),
|
||||
|
||||
// 编辑相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Edit, 'icon 44 edit'),
|
||||
ExampleIcon(YXIconFonts.icon36Editline, 'icon 36 editline'),
|
||||
ExampleIcon(YXIconFonts.icon24Edit, 'icon 24 edit'),
|
||||
|
||||
// 删除相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Delete, 'icon 44 delete'),
|
||||
ExampleIcon(YXIconFonts.icon36Delete, 'icon 36 delete'),
|
||||
ExampleIcon(YXIconFonts.icon24Delete, 'icon 24 delete'),
|
||||
ExampleIcon(YXIconFonts.icon24Minus, 'icon 24 minus'),
|
||||
ExampleIcon(YXIconFonts.icon36OnlySee, 'icon 36 only see'),
|
||||
ExampleIcon(YXIconFonts.icon24Plus, 'icon 24 plus'),
|
||||
|
||||
// 个人中心相关图标
|
||||
ExampleIcon(YXIconFonts.icon44MeQuit, 'icon 44 me quit'),
|
||||
ExampleIcon(YXIconFonts.icon44MeLogOut, 'icon 44 me log out'),
|
||||
ExampleIcon(YXIconFonts.icon44MeSwitch, 'icon 44 me switch'),
|
||||
ExampleIcon(YXIconFonts.icon44MePassword, 'icon 44 me password'),
|
||||
ExampleIcon(YXIconFonts.icon44MeHelp, 'icon 44 me help'),
|
||||
ExampleIcon(YXIconFonts.icon44MeVersion, 'icon 44 me version'),
|
||||
|
|
@ -31,27 +32,39 @@ final icons = <ExampleIcon>[
|
|||
ExampleIcon(YXIconFonts.icon44MeSafe, 'icon 44 me safe'),
|
||||
ExampleIcon(YXIconFonts.icon44MePhone, 'icon 44 me phone'),
|
||||
|
||||
// 分享相关图标
|
||||
ExampleIcon(YXIconFonts.icon44WechatShareWhite, 'icon 44 wechat share white'),
|
||||
ExampleIcon(YXIconFonts.icon44Share, 'icon 44 share'),
|
||||
|
||||
// 编辑相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Edit, 'icon 44 edit'),
|
||||
ExampleIcon(YXIconFonts.icon36EditLine, 'icon 36 edit line'),
|
||||
ExampleIcon(YXIconFonts.icon24Edit, 'icon 24 edit'),
|
||||
|
||||
// 删除相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Delete, 'icon 44 delete'),
|
||||
ExampleIcon(YXIconFonts.icon36Delete, 'icon 36 delete'),
|
||||
ExampleIcon(YXIconFonts.icon24Delete, 'icon 24 delete'),
|
||||
|
||||
// 消息相关图标
|
||||
ExampleIcon(YXIconFonts.iconMsgContacts, 'icon msg contacts'),
|
||||
ExampleIcon(YXIconFonts.iconMsgViedo, 'icon msg viedo'),
|
||||
ExampleIcon(YXIconFonts.iconMsgVideo, 'icon msg video'),
|
||||
ExampleIcon(YXIconFonts.iconMsgSearch, 'icon msg search'),
|
||||
ExampleIcon(YXIconFonts.iconMsgCall, 'icon msg call'),
|
||||
ExampleIcon(YXIconFonts.iconMsgPhoto, 'icon msg photo'),
|
||||
ExampleIcon(YXIconFonts.iconMsgImg, 'icon msg img'),
|
||||
ExampleIcon(YXIconFonts.iconMsgFile, 'icon msg file'),
|
||||
ExampleIcon(YXIconFonts.icon56Msgadd, 'icon 56 msgadd'),
|
||||
ExampleIcon(YXIconFonts.icon56Msgface, 'icon 56 msgface'),
|
||||
ExampleIcon(YXIconFonts.icon56Msgvoice, 'icon 56 msgvoice'),
|
||||
ExampleIcon(YXIconFonts.icon56MsgAdd, 'icon 56 msg add'),
|
||||
ExampleIcon(YXIconFonts.icon56MsgFace, 'icon 56 msg face'),
|
||||
ExampleIcon(YXIconFonts.icon56MsgVoice, 'icon 56 msg voice'),
|
||||
|
||||
// 箭头相关图标
|
||||
ExampleIcon(YXIconFonts.icon32Arrowright, 'icon 32 arrowright'),
|
||||
ExampleIcon(YXIconFonts.icon44Arrowleft, 'icon 44 arrowleft'),
|
||||
ExampleIcon(YXIconFonts.icon44Arrowright, 'icon 44 arrowright'),
|
||||
ExampleIcon(YXIconFonts.icon24Arrowleft, 'icon 24 arrowleft'),
|
||||
ExampleIcon(YXIconFonts.icon24Arrowdown, 'icon 24 arrowdown'),
|
||||
|
||||
// 特殊字符图标
|
||||
ExampleIcon(YXIconFonts.icon24, 'icon 24 -'),
|
||||
ExampleIcon(YXIconFonts.icon32ArrowRight, 'icon 32 arrow right'),
|
||||
ExampleIcon(YXIconFonts.icon44ArrowLeft, 'icon 44 arrow left'),
|
||||
ExampleIcon(YXIconFonts.icon44ArrowRight, 'icon 44 arrow right'),
|
||||
ExampleIcon(YXIconFonts.icon44ArrowDownLine, 'icon 44 arrow down line'),
|
||||
ExampleIcon(YXIconFonts.icon24ArrowRight, 'icon 24 arrow right'),
|
||||
ExampleIcon(YXIconFonts.icon24ArrowDown, 'icon 24 arrow down'),
|
||||
|
||||
// 团队和用户相关图标
|
||||
ExampleIcon(YXIconFonts.icon36Team, 'icon 36 team'),
|
||||
|
|
@ -60,12 +73,11 @@ final icons = <ExampleIcon>[
|
|||
// 功能图标
|
||||
ExampleIcon(YXIconFonts.icon32Filter, 'icon 32 filter'),
|
||||
ExampleIcon(YXIconFonts.icon36Question, 'icon 36 question'),
|
||||
ExampleIcon(YXIconFonts.icon36Onlysee, 'icon 36 onlysee'),
|
||||
ExampleIcon(YXIconFonts.icon36Hint, 'icon 36 hint'),
|
||||
ExampleIcon(YXIconFonts.icon24Switch, 'icon 24 switch'),
|
||||
|
||||
// 退出相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Quitlite, 'icon 44 quitlite'),
|
||||
ExampleIcon(YXIconFonts.icon44QuitLite, 'icon 44 quit lite'),
|
||||
ExampleIcon(YXIconFonts.icon32Quit, 'icon 32 quit'),
|
||||
ExampleIcon(YXIconFonts.icon44Quit, 'icon 44 quit'),
|
||||
|
||||
|
|
@ -79,9 +91,6 @@ final icons = <ExampleIcon>[
|
|||
// 日历相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Calendar, 'icon 44 calendar'),
|
||||
|
||||
// 分享相关图标
|
||||
ExampleIcon(YXIconFonts.icon44Share, 'icon 44 share'),
|
||||
|
||||
// 添加相关图标
|
||||
ExampleIcon(YXIconFonts.icon24Add, 'icon 24 add'),
|
||||
ExampleIcon(YXIconFonts.icon44Add, 'icon 44 add'),
|
||||
|
|
|
|||
|
|
@ -71,26 +71,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "10.0.9"
|
||||
version: "11.0.2"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.0.9"
|
||||
version: "3.0.10"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -180,33 +180,33 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.7.4"
|
||||
version: "0.7.6"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
version: "2.2.0"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "15.0.0"
|
||||
version: "15.0.2"
|
||||
yx_icon_fonts:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.0.4"
|
||||
version: "1.0.5"
|
||||
sdks:
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
dart: ">=3.8.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -53,6 +53,11 @@ check_files() {
|
|||
print_error "找不到 scripts/generate_example.dart 文件"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "scripts/generate_wrapper.dart" ]; then
|
||||
print_error "找不到 scripts/generate_wrapper.dart 文件"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# 生成图标数据
|
||||
|
|
@ -69,6 +74,13 @@ generate_example() {
|
|||
print_success "示例文件生成完成"
|
||||
}
|
||||
|
||||
# 生成外部封装文件
|
||||
generate_wrapper() {
|
||||
print_info "正在生成外部封装文件..."
|
||||
dart scripts/generate_wrapper.dart
|
||||
print_success "外部封装文件生成完成"
|
||||
}
|
||||
|
||||
# 生成所有文件
|
||||
generate_all() {
|
||||
print_info "开始生成所有文件..."
|
||||
|
|
@ -76,6 +88,8 @@ generate_all() {
|
|||
|
||||
generate_icons
|
||||
echo
|
||||
generate_wrapper
|
||||
echo
|
||||
generate_example
|
||||
echo
|
||||
|
||||
|
|
@ -90,6 +104,7 @@ show_help() {
|
|||
echo
|
||||
echo "选项:"
|
||||
echo " icons 只生成图标数据 (lib/src/yx_icon_fonts_data.dart)"
|
||||
echo " wrapper 只生成外部封装文件 (generate/icons.dart)"
|
||||
echo " example 只生成示例文件 (example/lib/icons.dart)"
|
||||
echo " all 生成所有文件 (默认)"
|
||||
echo " help 显示此帮助信息"
|
||||
|
|
@ -97,6 +112,7 @@ show_help() {
|
|||
echo "示例:"
|
||||
echo " $0 # 生成所有文件"
|
||||
echo " $0 icons # 只生成图标数据"
|
||||
echo " $0 wrapper # 只生成外部封装文件"
|
||||
echo " $0 example # 只生成示例文件"
|
||||
echo
|
||||
}
|
||||
|
|
@ -111,6 +127,11 @@ main() {
|
|||
check_files
|
||||
generate_icons
|
||||
;;
|
||||
"wrapper")
|
||||
check_dart
|
||||
check_files
|
||||
generate_wrapper
|
||||
;;
|
||||
"example")
|
||||
check_dart
|
||||
check_files
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:yx_icon_fonts/yx_icon_fonts.dart';
|
||||
|
||||
class FontIcons {
|
||||
// 私有构造函数,防止实例化
|
||||
FontIcons._();
|
||||
|
||||
// 其他图标
|
||||
static const IconData icon44Search = YXIconFonts.icon44Search;
|
||||
static const IconData icon36ClearPeople = YXIconFonts.icon36ClearPeople;
|
||||
static const IconData icon32Publish = YXIconFonts.icon32Publish;
|
||||
static const IconData icon32Close = YXIconFonts.icon32Close;
|
||||
static const IconData icon32Output = YXIconFonts.icon32Output;
|
||||
static const IconData icon24Download = YXIconFonts.icon24Download;
|
||||
static const IconData iconVoicePause = YXIconFonts.iconVoicePause;
|
||||
static const IconData iconVoice = YXIconFonts.iconVoice;
|
||||
static const IconData icon44CancelAccount = YXIconFonts.icon44CancelAccount;
|
||||
static const IconData icon24Search = YXIconFonts.icon24Search;
|
||||
static const IconData icon24Up = YXIconFonts.icon24Up;
|
||||
static const IconData icon24Minus = YXIconFonts.icon24Minus;
|
||||
static const IconData icon36OnlySee = YXIconFonts.icon36OnlySee;
|
||||
|
||||
// 编辑相关图标
|
||||
static const IconData icon44Edit = YXIconFonts.icon44Edit;
|
||||
static const IconData icon36EditLine = YXIconFonts.icon36EditLine;
|
||||
static const IconData icon24Edit = YXIconFonts.icon24Edit;
|
||||
|
||||
// 删除相关图标
|
||||
static const IconData icon44Delete = YXIconFonts.icon44Delete;
|
||||
static const IconData icon36Delete = YXIconFonts.icon36Delete;
|
||||
static const IconData icon24Delete = YXIconFonts.icon24Delete;
|
||||
|
||||
// 个人中心相关图标
|
||||
static const IconData icon44MeLogOut = YXIconFonts.icon44MeLogOut;
|
||||
static const IconData icon44MeSwitch = YXIconFonts.icon44MeSwitch;
|
||||
static const IconData icon44MePassword = YXIconFonts.icon44MePassword;
|
||||
static const IconData icon44MeHelp = YXIconFonts.icon44MeHelp;
|
||||
static const IconData icon44MeVersion = YXIconFonts.icon44MeVersion;
|
||||
static const IconData icon44MePrivacy = YXIconFonts.icon44MePrivacy;
|
||||
static const IconData icon44MeUser = YXIconFonts.icon44MeUser;
|
||||
static const IconData icon44MeSafe = YXIconFonts.icon44MeSafe;
|
||||
static const IconData icon44MePhone = YXIconFonts.icon44MePhone;
|
||||
|
||||
// 消息相关图标
|
||||
static const IconData iconMsgContacts = YXIconFonts.iconMsgContacts;
|
||||
static const IconData iconMsgVideo = YXIconFonts.iconMsgVideo;
|
||||
static const IconData iconMsgSearch = YXIconFonts.iconMsgSearch;
|
||||
static const IconData iconMsgCall = YXIconFonts.iconMsgCall;
|
||||
static const IconData iconMsgPhoto = YXIconFonts.iconMsgPhoto;
|
||||
static const IconData iconMsgImg = YXIconFonts.iconMsgImg;
|
||||
static const IconData iconMsgFile = YXIconFonts.iconMsgFile;
|
||||
static const IconData icon56MsgAdd = YXIconFonts.icon56MsgAdd;
|
||||
static const IconData icon56MsgFace = YXIconFonts.icon56MsgFace;
|
||||
static const IconData icon56MsgVoice = YXIconFonts.icon56MsgVoice;
|
||||
|
||||
// 箭头相关图标
|
||||
static const IconData icon32ArrowRight = YXIconFonts.icon32ArrowRight;
|
||||
static const IconData icon44ArrowLeft = YXIconFonts.icon44ArrowLeft;
|
||||
static const IconData icon44ArrowRight = YXIconFonts.icon44ArrowRight;
|
||||
static const IconData icon44ArrowDownLine = YXIconFonts.icon44ArrowDownLine;
|
||||
static const IconData icon24ArrowRight = YXIconFonts.icon24ArrowRight;
|
||||
static const IconData icon24ArrowDown = YXIconFonts.icon24ArrowDown;
|
||||
|
||||
// 特殊字符图标
|
||||
static const IconData iconSubtract = YXIconFonts.iconSubtract;
|
||||
|
||||
// 团队和用户相关图标
|
||||
static const IconData icon36Team = YXIconFonts.icon36Team;
|
||||
static const IconData icon32Student = YXIconFonts.icon32Student;
|
||||
|
||||
// 功能图标
|
||||
static const IconData icon32Filter = YXIconFonts.icon32Filter;
|
||||
static const IconData icon36Question = YXIconFonts.icon36Question;
|
||||
static const IconData icon36Hint = YXIconFonts.icon36Hint;
|
||||
static const IconData icon24Switch = YXIconFonts.icon24Switch;
|
||||
|
||||
// 退出相关图标
|
||||
static const IconData icon44QuitLite = YXIconFonts.icon44QuitLite;
|
||||
static const IconData icon32Quit = YXIconFonts.icon32Quit;
|
||||
static const IconData icon44Quit = YXIconFonts.icon44Quit;
|
||||
|
||||
// 更多和菜单相关图标
|
||||
static const IconData icon44More2 = YXIconFonts.icon44More2;
|
||||
static const IconData icon44More = YXIconFonts.icon44More;
|
||||
|
||||
// 复制相关图标
|
||||
static const IconData icon24Copy = YXIconFonts.icon24Copy;
|
||||
|
||||
// 日历相关图标
|
||||
static const IconData icon44Calendar = YXIconFonts.icon44Calendar;
|
||||
|
||||
// 分享相关图标
|
||||
static const IconData icon44WechatShareWhite =
|
||||
YXIconFonts.icon44WechatShareWhite;
|
||||
static const IconData icon44Share = YXIconFonts.icon44Share;
|
||||
|
||||
// 添加相关图标
|
||||
static const IconData icon24Add = YXIconFonts.icon24Add;
|
||||
static const IconData icon24Plus = YXIconFonts.icon24Plus;
|
||||
static const IconData icon44Add = YXIconFonts.icon44Add;
|
||||
static const IconData icon32Add = YXIconFonts.icon32Add;
|
||||
|
||||
// 键盘相关图标
|
||||
static const IconData icon44Keyboard = YXIconFonts.icon44Keyboard;
|
||||
}
|
||||
135
iconfont.json
135
iconfont.json
|
|
@ -5,10 +5,73 @@
|
|||
"css_prefix_text": "",
|
||||
"description": "学习官OA系统图标",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "45876267",
|
||||
"name": "icon_44_search",
|
||||
"font_class": "icon_44_search",
|
||||
"unicode": "e655",
|
||||
"unicode_decimal": 58965
|
||||
},
|
||||
{
|
||||
"icon_id": "45855059",
|
||||
"name": "icon_36_clear_people",
|
||||
"font_class": "icon_36_clear_people",
|
||||
"unicode": "e654",
|
||||
"unicode_decimal": 58964
|
||||
},
|
||||
{
|
||||
"icon_id": "45530506",
|
||||
"name": "icon_44_me_log_out",
|
||||
"font_class": "icon_44_me_log_out",
|
||||
"unicode": "e652",
|
||||
"unicode_decimal": 58962
|
||||
},
|
||||
{
|
||||
"icon_id": "45530507",
|
||||
"name": "icon_44_me_switch",
|
||||
"font_class": "icon_44_me_switch",
|
||||
"unicode": "e653",
|
||||
"unicode_decimal": 58963
|
||||
},
|
||||
{
|
||||
"icon_id": "45513436",
|
||||
"name": "icon_44_wechat_share_white",
|
||||
"font_class": "icon_44_wechat_share_white",
|
||||
"unicode": "e651",
|
||||
"unicode_decimal": 58961
|
||||
},
|
||||
{
|
||||
"icon_id": "45513173",
|
||||
"name": "icon_32_publish",
|
||||
"font_class": "icon_32_publish",
|
||||
"unicode": "e64e",
|
||||
"unicode_decimal": 58958
|
||||
},
|
||||
{
|
||||
"icon_id": "45513174",
|
||||
"name": "icon_32_close",
|
||||
"font_class": "icon_32_close",
|
||||
"unicode": "e64f",
|
||||
"unicode_decimal": 58959
|
||||
},
|
||||
{
|
||||
"icon_id": "45513172",
|
||||
"name": "icon_32_output",
|
||||
"font_class": "icon_32_output",
|
||||
"unicode": "e650",
|
||||
"unicode_decimal": 58960
|
||||
},
|
||||
{
|
||||
"icon_id": "45500127",
|
||||
"name": "icon_24_download",
|
||||
"font_class": "icon_24_download",
|
||||
"unicode": "e64d",
|
||||
"unicode_decimal": 58957
|
||||
},
|
||||
{
|
||||
"icon_id": "45492400",
|
||||
"name": "icon_voicepause",
|
||||
"font_class": "icon_voicepause",
|
||||
"name": "icon_voice_pause",
|
||||
"font_class": "icon_voice_pause",
|
||||
"unicode": "e64b",
|
||||
"unicode_decimal": 58955
|
||||
},
|
||||
|
|
@ -21,8 +84,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "45263171",
|
||||
"name": "Subtract",
|
||||
"font_class": "Subtract",
|
||||
"name": "icon_subtract",
|
||||
"font_class": "icon_subtract",
|
||||
"unicode": "e64a",
|
||||
"unicode_decimal": 58954
|
||||
},
|
||||
|
|
@ -42,8 +105,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "45160662",
|
||||
"name": "icon_44_me_quit",
|
||||
"font_class": "icon_44_me_quit",
|
||||
"name": "icon_44_cancel_account",
|
||||
"font_class": "icon_44_cancel_account",
|
||||
"unicode": "e647",
|
||||
"unicode_decimal": 58951
|
||||
},
|
||||
|
|
@ -70,8 +133,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44659960",
|
||||
"name": "icon_msg_viedo",
|
||||
"font_class": "icon_msg_viedo",
|
||||
"name": "icon_msg_video",
|
||||
"font_class": "icon_msg_video",
|
||||
"unicode": "e63e",
|
||||
"unicode_decimal": 58942
|
||||
},
|
||||
|
|
@ -112,8 +175,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44625643",
|
||||
"name": "icon_32_arrowright",
|
||||
"font_class": "icon_32_arrowright",
|
||||
"name": "icon_32_arrow_right",
|
||||
"font_class": "icon_32_arrow_right",
|
||||
"unicode": "e61d",
|
||||
"unicode_decimal": 58909
|
||||
},
|
||||
|
|
@ -133,8 +196,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44625447",
|
||||
"name": "icon_24_-",
|
||||
"font_class": "icon_24_-",
|
||||
"name": "icon_24_minus",
|
||||
"font_class": "icon_24_minus",
|
||||
"unicode": "e63b",
|
||||
"unicode_decimal": 58939
|
||||
},
|
||||
|
|
@ -154,8 +217,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44625458",
|
||||
"name": "icon_44_quitlite",
|
||||
"font_class": "icon_44_quitlite",
|
||||
"name": "icon_44_quit_lite",
|
||||
"font_class": "icon_44_quit_lite",
|
||||
"unicode": "e631",
|
||||
"unicode_decimal": 58929
|
||||
},
|
||||
|
|
@ -189,8 +252,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44625453",
|
||||
"name": "icon_36_onlysee",
|
||||
"font_class": "icon_36_onlysee",
|
||||
"name": "icon_36_only_see",
|
||||
"font_class": "icon_36_only_see",
|
||||
"unicode": "e636",
|
||||
"unicode_decimal": 58934
|
||||
},
|
||||
|
|
@ -259,22 +322,22 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44572502",
|
||||
"name": "icon_44_arrowleft",
|
||||
"font_class": "icon_44_arrowleft",
|
||||
"name": "icon_44_arrow_left",
|
||||
"font_class": "icon_44_arrow_left",
|
||||
"unicode": "e62a",
|
||||
"unicode_decimal": 58922
|
||||
},
|
||||
{
|
||||
"icon_id": "44572499",
|
||||
"name": "icon_36_editline",
|
||||
"font_class": "icon_36_editline",
|
||||
"name": "icon_36_edit_line",
|
||||
"font_class": "icon_36_edit_line",
|
||||
"unicode": "e62b",
|
||||
"unicode_decimal": 58923
|
||||
},
|
||||
{
|
||||
"icon_id": "44572515",
|
||||
"name": "icon_44_arrowright",
|
||||
"font_class": "icon_44_arrowright",
|
||||
"name": "icon_44_arrow_right",
|
||||
"font_class": "icon_44_arrow_right",
|
||||
"unicode": "e622",
|
||||
"unicode_decimal": 58914
|
||||
},
|
||||
|
|
@ -287,22 +350,22 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44572513",
|
||||
"name": "icon_56_msgadd",
|
||||
"font_class": "icon_56_msgadd",
|
||||
"name": "icon_56_msg_add",
|
||||
"font_class": "icon_56_msg_add",
|
||||
"unicode": "e624",
|
||||
"unicode_decimal": 58916
|
||||
},
|
||||
{
|
||||
"icon_id": "44572511",
|
||||
"name": "icon_56_msgface",
|
||||
"font_class": "icon_56_msgface",
|
||||
"name": "icon_56_msg_face",
|
||||
"font_class": "icon_56_msg_face",
|
||||
"unicode": "e625",
|
||||
"unicode_decimal": 58917
|
||||
},
|
||||
{
|
||||
"icon_id": "44572516",
|
||||
"name": "icon_56_msgvoice",
|
||||
"font_class": "icon_56_msgvoice",
|
||||
"name": "icon_56_msg_voice",
|
||||
"font_class": "icon_56_msg_voice",
|
||||
"unicode": "e616",
|
||||
"unicode_decimal": 58902
|
||||
},
|
||||
|
|
@ -329,8 +392,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44572512",
|
||||
"name": "icon_24_+",
|
||||
"font_class": "a-icon_24_",
|
||||
"name": "icon_24_plus",
|
||||
"font_class": "icon_24_plus",
|
||||
"unicode": "e618",
|
||||
"unicode_decimal": 58904
|
||||
},
|
||||
|
|
@ -364,15 +427,15 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44572503",
|
||||
"name": "icon_44_arrowright(1)",
|
||||
"font_class": "a-icon_44_arrowright1",
|
||||
"name": "icon_44_arrow_down_line",
|
||||
"font_class": "icon_44_arrow_down_line",
|
||||
"unicode": "e61c",
|
||||
"unicode_decimal": 58908
|
||||
},
|
||||
{
|
||||
"icon_id": "44572493",
|
||||
"name": "icon_24_arrowleft",
|
||||
"font_class": "icon_24_arrowleft",
|
||||
"name": "icon_24_arrow_right",
|
||||
"font_class": "icon_24_arrow_right",
|
||||
"unicode": "e61e",
|
||||
"unicode_decimal": 58910
|
||||
},
|
||||
|
|
@ -392,8 +455,8 @@
|
|||
},
|
||||
{
|
||||
"icon_id": "44572492",
|
||||
"name": "icon_24_arrowdown",
|
||||
"font_class": "icon_24_arrowdown",
|
||||
"name": "icon_24_arrow_down",
|
||||
"font_class": "icon_24_arrow_down",
|
||||
"unicode": "e621",
|
||||
"unicode_decimal": 58913
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,20 +9,65 @@ class YXIconFonts {
|
|||
// 私有构造函数,防止实例化
|
||||
YXIconFonts._();
|
||||
|
||||
/// icon_voicepause 图标
|
||||
/// icon_44_search 图标
|
||||
///
|
||||
/// Unicode: e655
|
||||
static const IconData icon44Search = YXIconData(0xe655);
|
||||
|
||||
/// icon_36_clear_people 图标
|
||||
///
|
||||
/// Unicode: e654
|
||||
static const IconData icon36ClearPeople = YXIconData(0xe654);
|
||||
|
||||
/// icon_44_me_log_out 图标
|
||||
///
|
||||
/// Unicode: e652
|
||||
static const IconData icon44MeLogOut = YXIconData(0xe652);
|
||||
|
||||
/// icon_44_me_switch 图标
|
||||
///
|
||||
/// Unicode: e653
|
||||
static const IconData icon44MeSwitch = YXIconData(0xe653);
|
||||
|
||||
/// icon_44_wechat_share_white 图标
|
||||
///
|
||||
/// Unicode: e651
|
||||
static const IconData icon44WechatShareWhite = YXIconData(0xe651);
|
||||
|
||||
/// icon_32_publish 图标
|
||||
///
|
||||
/// Unicode: e64e
|
||||
static const IconData icon32Publish = YXIconData(0xe64e);
|
||||
|
||||
/// icon_32_close 图标
|
||||
///
|
||||
/// Unicode: e64f
|
||||
static const IconData icon32Close = YXIconData(0xe64f);
|
||||
|
||||
/// icon_32_output 图标
|
||||
///
|
||||
/// Unicode: e650
|
||||
static const IconData icon32Output = YXIconData(0xe650);
|
||||
|
||||
/// icon_24_download 图标
|
||||
///
|
||||
/// Unicode: e64d
|
||||
static const IconData icon24Download = YXIconData(0xe64d);
|
||||
|
||||
/// icon_voice_pause 图标
|
||||
///
|
||||
/// Unicode: e64b
|
||||
static const IconData iconVoicepause = YXIconData(0xe64b);
|
||||
static const IconData iconVoicePause = YXIconData(0xe64b);
|
||||
|
||||
/// icon_voice 图标
|
||||
///
|
||||
/// Unicode: e64c
|
||||
static const IconData iconVoice = YXIconData(0xe64c);
|
||||
|
||||
/// Subtract 图标
|
||||
/// icon_subtract 图标
|
||||
///
|
||||
/// Unicode: e64a
|
||||
static const IconData Subtract = YXIconData(0xe64a);
|
||||
static const IconData iconSubtract = YXIconData(0xe64a);
|
||||
|
||||
/// icon_44_edit 图标
|
||||
///
|
||||
|
|
@ -34,10 +79,10 @@ class YXIconFonts {
|
|||
/// Unicode: e649
|
||||
static const IconData icon44Delete = YXIconData(0xe649);
|
||||
|
||||
/// icon_44_me_quit 图标
|
||||
/// icon_44_cancel_account 图标
|
||||
///
|
||||
/// Unicode: e647
|
||||
static const IconData icon44MeQuit = YXIconData(0xe647);
|
||||
static const IconData icon44CancelAccount = YXIconData(0xe647);
|
||||
|
||||
/// icon_24_search 图标
|
||||
///
|
||||
|
|
@ -54,10 +99,10 @@ class YXIconFonts {
|
|||
/// Unicode: e644
|
||||
static const IconData iconMsgContacts = YXIconData(0xe644);
|
||||
|
||||
/// icon_msg_viedo 图标
|
||||
/// icon_msg_video 图标
|
||||
///
|
||||
/// Unicode: e63e
|
||||
static const IconData iconMsgViedo = YXIconData(0xe63e);
|
||||
static const IconData iconMsgVideo = YXIconData(0xe63e);
|
||||
|
||||
/// icon_msg_search 图标
|
||||
///
|
||||
|
|
@ -84,10 +129,10 @@ class YXIconFonts {
|
|||
/// Unicode: e643
|
||||
static const IconData iconMsgFile = YXIconData(0xe643);
|
||||
|
||||
/// icon_32_arrowright 图标
|
||||
/// icon_32_arrow_right 图标
|
||||
///
|
||||
/// Unicode: e61d
|
||||
static const IconData icon32Arrowright = YXIconData(0xe61d);
|
||||
static const IconData icon32ArrowRight = YXIconData(0xe61d);
|
||||
|
||||
/// icon_44_me_password 图标
|
||||
///
|
||||
|
|
@ -99,10 +144,10 @@ class YXIconFonts {
|
|||
/// Unicode: e63a
|
||||
static const IconData icon44MeHelp = YXIconData(0xe63a);
|
||||
|
||||
/// icon_24_- 图标
|
||||
/// icon_24_minus 图标
|
||||
///
|
||||
/// Unicode: e63b
|
||||
static const IconData icon24 = YXIconData(0xe63b);
|
||||
static const IconData icon24Minus = YXIconData(0xe63b);
|
||||
|
||||
/// icon_36_team 图标
|
||||
///
|
||||
|
|
@ -114,10 +159,10 @@ class YXIconFonts {
|
|||
/// Unicode: e63d
|
||||
static const IconData icon32Filter = YXIconData(0xe63d);
|
||||
|
||||
/// icon_44_quitlite 图标
|
||||
/// icon_44_quit_lite 图标
|
||||
///
|
||||
/// Unicode: e631
|
||||
static const IconData icon44Quitlite = YXIconData(0xe631);
|
||||
static const IconData icon44QuitLite = YXIconData(0xe631);
|
||||
|
||||
/// icon_44_me_version 图标
|
||||
///
|
||||
|
|
@ -139,10 +184,10 @@ class YXIconFonts {
|
|||
/// Unicode: e635
|
||||
static const IconData icon44More2 = YXIconData(0xe635);
|
||||
|
||||
/// icon_36_onlysee 图标
|
||||
/// icon_36_only_see 图标
|
||||
///
|
||||
/// Unicode: e636
|
||||
static const IconData icon36Onlysee = YXIconData(0xe636);
|
||||
static const IconData icon36OnlySee = YXIconData(0xe636);
|
||||
|
||||
/// icon_44_me_user 图标
|
||||
///
|
||||
|
|
@ -189,40 +234,40 @@ class YXIconFonts {
|
|||
/// Unicode: e629
|
||||
static const IconData icon44More = YXIconData(0xe629);
|
||||
|
||||
/// icon_44_arrowleft 图标
|
||||
/// icon_44_arrow_left 图标
|
||||
///
|
||||
/// Unicode: e62a
|
||||
static const IconData icon44Arrowleft = YXIconData(0xe62a);
|
||||
static const IconData icon44ArrowLeft = YXIconData(0xe62a);
|
||||
|
||||
/// icon_36_editline 图标
|
||||
/// icon_36_edit_line 图标
|
||||
///
|
||||
/// Unicode: e62b
|
||||
static const IconData icon36Editline = YXIconData(0xe62b);
|
||||
static const IconData icon36EditLine = YXIconData(0xe62b);
|
||||
|
||||
/// icon_44_arrowright 图标
|
||||
/// icon_44_arrow_right 图标
|
||||
///
|
||||
/// Unicode: e622
|
||||
static const IconData icon44Arrowright = YXIconData(0xe622);
|
||||
static const IconData icon44ArrowRight = YXIconData(0xe622);
|
||||
|
||||
/// icon_24_delete 图标
|
||||
///
|
||||
/// Unicode: e623
|
||||
static const IconData icon24Delete = YXIconData(0xe623);
|
||||
|
||||
/// icon_56_msgadd 图标
|
||||
/// icon_56_msg_add 图标
|
||||
///
|
||||
/// Unicode: e624
|
||||
static const IconData icon56Msgadd = YXIconData(0xe624);
|
||||
static const IconData icon56MsgAdd = YXIconData(0xe624);
|
||||
|
||||
/// icon_56_msgface 图标
|
||||
/// icon_56_msg_face 图标
|
||||
///
|
||||
/// Unicode: e625
|
||||
static const IconData icon56Msgface = YXIconData(0xe625);
|
||||
static const IconData icon56MsgFace = YXIconData(0xe625);
|
||||
|
||||
/// icon_56_msgvoice 图标
|
||||
/// icon_56_msg_voice 图标
|
||||
///
|
||||
/// Unicode: e616
|
||||
static const IconData icon56Msgvoice = YXIconData(0xe616);
|
||||
static const IconData icon56MsgVoice = YXIconData(0xe616);
|
||||
|
||||
/// icon_44_share 图标
|
||||
///
|
||||
|
|
@ -239,7 +284,7 @@ class YXIconFonts {
|
|||
/// Unicode: e617
|
||||
static const IconData icon24Add = YXIconData(0xe617);
|
||||
|
||||
/// icon_24_+ 图标
|
||||
/// icon_24_plus 图标
|
||||
///
|
||||
/// Unicode: e618
|
||||
static const IconData icon24Plus = YXIconData(0xe618);
|
||||
|
|
@ -264,15 +309,15 @@ class YXIconFonts {
|
|||
/// Unicode: e61b
|
||||
static const IconData icon24Switch = YXIconData(0xe61b);
|
||||
|
||||
/// icon_44_arrowright(1) 图标
|
||||
/// icon_44_arrow_down_line 图标
|
||||
///
|
||||
/// Unicode: e61c
|
||||
static const IconData icon44Arrowright1 = YXIconData(0xe61c);
|
||||
static const IconData icon44ArrowDownLine = YXIconData(0xe61c);
|
||||
|
||||
/// icon_24_arrowleft 图标
|
||||
/// icon_24_arrow_right 图标
|
||||
///
|
||||
/// Unicode: e61e
|
||||
static const IconData icon24Arrowleft = YXIconData(0xe61e);
|
||||
static const IconData icon24ArrowRight = YXIconData(0xe61e);
|
||||
|
||||
/// icon_32_add 图标
|
||||
///
|
||||
|
|
@ -284,9 +329,9 @@ class YXIconFonts {
|
|||
/// Unicode: e620
|
||||
static const IconData icon24Edit = YXIconData(0xe620);
|
||||
|
||||
/// icon_24_arrowdown 图标
|
||||
/// icon_24_arrow_down 图标
|
||||
///
|
||||
/// Unicode: e621
|
||||
static const IconData icon24Arrowdown = YXIconData(0xe621);
|
||||
static const IconData icon24ArrowDown = YXIconData(0xe621);
|
||||
|
||||
}
|
||||
|
|
|
|||
26
pubspec.lock
26
pubspec.lock
|
|
@ -71,26 +71,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "10.0.9"
|
||||
version: "11.0.2"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
|
||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.0.9"
|
||||
version: "3.0.10"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -180,26 +180,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
|
||||
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "0.7.4"
|
||||
version: "0.7.6"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
version: "2.2.0"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
||||
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
||||
url: "https://pub.flutter-io.cn"
|
||||
source: hosted
|
||||
version: "15.0.0"
|
||||
version: "15.0.2"
|
||||
sdks:
|
||||
dart: ">=3.7.0-0 <4.0.0"
|
||||
dart: ">=3.8.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: yx_icon_fonts
|
||||
description: 学习官OA系统图标字体库,基于iconfont.ttf和iconfont.json生成
|
||||
version: 1.0.4
|
||||
version: 1.0.5
|
||||
homepage: https://gitea.23544.com/wangyang/yx_icon_fonts_flutter
|
||||
|
||||
environment:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,144 @@
|
|||
import 'dart:io';
|
||||
import 'utils.dart';
|
||||
|
||||
/// 自动生成外部使用的图标封装文件
|
||||
///
|
||||
/// 从 iconfont.json 文件读取图标信息,生成 FontIcons 封装类
|
||||
/// 生成位置:项目根目录的 icons.dart
|
||||
void main() {
|
||||
final iconData = readIconFontJson();
|
||||
final glyphs = getGlyphs(iconData);
|
||||
final definedIcons = getDefinedIconNames();
|
||||
|
||||
_generateWrapperFile(glyphs, definedIcons);
|
||||
|
||||
print('✅ 外部图标封装文件生成成功: \x1B[32mgenerate/icons.dart\x1B[0m');
|
||||
print('📊 共生成 ${definedIcons.length} 个图标常量');
|
||||
}
|
||||
|
||||
/// 生成 icons.dart 文件
|
||||
void _generateWrapperFile(List<dynamic> glyphs, Set<String> definedIcons) {
|
||||
final buffer = StringBuffer();
|
||||
|
||||
// 文件头部
|
||||
buffer.writeln("// ignore_for_file: constant_identifier_names");
|
||||
buffer.writeln();
|
||||
buffer.writeln("import 'package:flutter/material.dart';");
|
||||
buffer.writeln("import 'package:yx_icon_fonts/yx_icon_fonts.dart';");
|
||||
buffer.writeln();
|
||||
buffer.writeln("class FontIcons {");
|
||||
buffer.writeln(" // 私有构造函数,防止实例化");
|
||||
buffer.writeln(" FontIcons._();");
|
||||
buffer.writeln();
|
||||
|
||||
// 按类别分组图标
|
||||
final categories = _categorizeIcons(glyphs, definedIcons);
|
||||
|
||||
// 定义类别显示顺序
|
||||
final categoryOrder = [
|
||||
'其他图标',
|
||||
'编辑相关图标',
|
||||
'删除相关图标',
|
||||
'个人中心相关图标',
|
||||
'消息相关图标',
|
||||
'箭头相关图标',
|
||||
'特殊字符图标',
|
||||
'团队和用户相关图标',
|
||||
'功能图标',
|
||||
'退出相关图标',
|
||||
'更多和菜单相关图标',
|
||||
'复制相关图标',
|
||||
'日历相关图标',
|
||||
'分享相关图标',
|
||||
'添加相关图标',
|
||||
'键盘相关图标',
|
||||
];
|
||||
|
||||
// 按顺序生成图标
|
||||
for (final category in categoryOrder) {
|
||||
if (categories.containsKey(category) && categories[category]!.isNotEmpty) {
|
||||
buffer.writeln(" // $category");
|
||||
for (final iconName in categories[category]!) {
|
||||
buffer.writeln(" static const IconData $iconName = YXIconFonts.$iconName;");
|
||||
}
|
||||
buffer.writeln();
|
||||
}
|
||||
}
|
||||
|
||||
buffer.writeln("}");
|
||||
|
||||
// 确保 generate 目录存在
|
||||
final dir = Directory('generate');
|
||||
if (!dir.existsSync()) {
|
||||
dir.createSync(recursive: true);
|
||||
}
|
||||
|
||||
// 写入文件
|
||||
final file = File('generate/icons.dart');
|
||||
file.writeAsStringSync(buffer.toString());
|
||||
}
|
||||
|
||||
/// 将图标按类别分组
|
||||
Map<String, List<String>> _categorizeIcons(List<dynamic> glyphs, Set<String> definedIcons) {
|
||||
final categories = <String, List<String>>{};
|
||||
|
||||
for (final glyph in glyphs) {
|
||||
final name = glyph['font_class'] as String;
|
||||
final camelCaseName = toLegalDartName(name);
|
||||
|
||||
// 跳过未定义的图标
|
||||
if (!definedIcons.contains(camelCaseName)) continue;
|
||||
|
||||
// 确定类别
|
||||
String category = _getCategory(name);
|
||||
|
||||
categories.putIfAbsent(category, () => []);
|
||||
categories[category]!.add(camelCaseName);
|
||||
}
|
||||
|
||||
return categories;
|
||||
}
|
||||
|
||||
/// 根据图标名称确定类别
|
||||
String _getCategory(String name) {
|
||||
final lowerName = name.toLowerCase();
|
||||
|
||||
if (lowerName.contains('edit')) {
|
||||
return '编辑相关图标';
|
||||
} else if (lowerName.contains('delete')) {
|
||||
return '删除相关图标';
|
||||
} else if (lowerName.contains('me_')) {
|
||||
return '个人中心相关图标';
|
||||
} else if (lowerName.contains('msg')) {
|
||||
return '消息相关图标';
|
||||
} else if (lowerName.contains('arrow')) {
|
||||
return '箭头相关图标';
|
||||
} else if (lowerName == '24_-' || lowerName.contains('subtract')) {
|
||||
return '特殊字符图标';
|
||||
} else if (lowerName.contains('team') || lowerName.contains('student')) {
|
||||
return '团队和用户相关图标';
|
||||
} else if (lowerName.contains('filter') ||
|
||||
lowerName.contains('question') ||
|
||||
lowerName.contains('onlysee') ||
|
||||
lowerName.contains('hint') ||
|
||||
lowerName.contains('switch')) {
|
||||
return '功能图标';
|
||||
} else if (lowerName.contains('quit')) {
|
||||
return '退出相关图标';
|
||||
} else if (lowerName.contains('more')) {
|
||||
return '更多和菜单相关图标';
|
||||
} else if (lowerName.contains('copy')) {
|
||||
return '复制相关图标';
|
||||
} else if (lowerName.contains('calendar')) {
|
||||
return '日历相关图标';
|
||||
} else if (lowerName.contains('share')) {
|
||||
return '分享相关图标';
|
||||
} else if (lowerName.contains('add') || lowerName.contains('+') || lowerName.contains('plus')) {
|
||||
return '添加相关图标';
|
||||
} else if (lowerName.contains('keyboard')) {
|
||||
return '键盘相关图标';
|
||||
} else {
|
||||
return '其他图标';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue