Skip to content

Commit 81749c1

Browse files
committed
Added icons library and icons example page code generator(python)
1. Automatically generate platform icons extension class (library file) with the same name between Material and Cupertino to `lib/src/platform_icons_gen.dart` file with sorted by name by dart's `Extension`, without changing the existing code(`lib/src/platform_icons.dart`) 2. Automatically generate example page of all icons to file `example/lib//icons_page.dart` with sorted by name, from file `lib/src/platform_icons.dart` and `lib/src/platform_icons_gen.dart`.
1 parent 3b89f46 commit 81749c1

File tree

10 files changed

+805
-21
lines changed

10 files changed

+805
-21
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ ios/Runner/GeneratedPluginRegistrant.*
1212
ios/Flutter/flutter_export_environment.sh
1313

1414
pubspec.lock
15-
example/ios/Flutter/flutter_export_environment.sh
15+
example/ios/Flutter/flutter_export_environment.sh
16+
17+
__pycache__

example/lib/icons_page.dart

Lines changed: 86 additions & 12 deletions
Large diffs are not rendered by default.

lib/flutter_platform_widgets.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export 'src/platform_dialog_action.dart';
3030
export 'src/platform_elevated_button.dart';
3131
export 'src/platform_icon_button.dart';
3232
export 'src/platform_icons.dart';
33+
export 'src/platform_icons_gen.dart';
3334
export 'src/platform_nav_bar.dart';
3435
export 'src/platform_page.dart';
3536
export 'src/platform_page_route.dart';

lib/src/platform_icons.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,24 @@ class PlatformIcons {
188188
isMaterial(context) ? Icons.cloud : CupertinoIcons.cloud_fill;
189189

190190
/// Icons: Icons.cloud_download_outlined : CupertinoIcons.cloud_download
191-
IconData get cloudDownload =>
192-
isMaterial(context) ? Icons.cloud_download_outlined : CupertinoIcons.cloud_download;
191+
IconData get cloudDownload => isMaterial(context)
192+
? Icons.cloud_download_outlined
193+
: CupertinoIcons.cloud_download;
193194

194195
/// Icons: Icons.cloud_download : CupertinoIcons.cloud_download_fill
195-
IconData get cloudDownloadSolid =>
196-
isMaterial(context) ? Icons.cloud_download : CupertinoIcons.cloud_download_fill;
196+
IconData get cloudDownloadSolid => isMaterial(context)
197+
? Icons.cloud_download
198+
: CupertinoIcons.cloud_download_fill;
197199

198200
/// Icons: Icons.cloud_upload_outlined : CupertinoIcons.cloud_upload
199-
IconData get cloudUpload =>
200-
isMaterial(context) ? Icons.cloud_upload_outlined : CupertinoIcons.cloud_upload;
201+
IconData get cloudUpload => isMaterial(context)
202+
? Icons.cloud_upload_outlined
203+
: CupertinoIcons.cloud_upload;
201204

202205
/// Icons: Icons.cloud_upload : CupertinoIcons.cloud_upload_fill
203-
IconData get cloudUploadSolid =>
204-
isMaterial(context) ? Icons.cloud_upload : CupertinoIcons.cloud_upload_fill;
206+
IconData get cloudUploadSolid => isMaterial(context)
207+
? Icons.cloud_upload
208+
: CupertinoIcons.cloud_upload_fill;
205209

206210
/// Icons: Icons.collections : CupertinoIcons.collections
207211
IconData get collections =>

0 commit comments

Comments
 (0)