From 160fd609e31c26ba699d11576687f8661df99371 Mon Sep 17 00:00:00 2001 From: Daichi Furiya Date: Thu, 21 Oct 2021 22:24:57 +0900 Subject: [PATCH] feat: support dartdoc generation (#138) * feat: support generate dartdocs * style: fix \t to space * refactor: rename vars * refactor: change to suggestion Co-authored-by: Mao Yufeng Co-authored-by: Mao Yufeng --- example/lib/gen/assets.gen.dart | 28 +++++++++++ example/lib/gen/colors.gen.dart | 45 ++++++++++++++++++ example/lib/gen/fonts.gen.dart | 3 ++ .../core/lib/generators/assets_generator.dart | 46 ++++++++++++++++--- .../core/lib/generators/colors_generator.dart | 15 ++++-- .../core/lib/generators/fonts_generator.dart | 5 +- packages/core/lib/utils/color.dart | 6 +++ .../actual_data/assets.gen.dart | 24 ++++++++++ .../actual_data/assets_camel_case.gen.dart | 25 ++++++++++ .../assets_flare_integrations.gen.dart | 1 + .../assets_no_integrations.gen.dart | 21 +++++++++ .../assets_package_parameter.gen.dart | 4 ++ .../actual_data/assets_snake_case.gen.dart | 25 ++++++++++ .../assets_svg_integrations.gen.dart | 3 ++ .../assets_unknown_mime_type.gen.dart | 1 + .../actual_data/colors.gen.dart | 45 ++++++++++++++++++ .../test_resources/actual_data/fonts.gen.dart | 3 ++ 17 files changed, 286 insertions(+), 14 deletions(-) diff --git a/example/lib/gen/assets.gen.dart b/example/lib/gen/assets.gen.dart index 0affd9ef..0984e7de 100644 --- a/example/lib/gen/assets.gen.dart +++ b/example/lib/gen/assets.gen.dart @@ -14,26 +14,38 @@ import 'package:flare_flutter/flare_controller.dart'; class $PicturesGen { const $PicturesGen(); + /// File path: pictures/chip5.jpg AssetGenImage get chip5 => const AssetGenImage('pictures/chip5.jpg'); } class $AssetsFlareGen { const $AssetsFlareGen(); + /// File path: assets/flare/Penguin.flr FlareGenImage get penguin => const FlareGenImage('assets/flare/Penguin.flr'); } class $AssetsImagesGen { const $AssetsImagesGen(); + /// File path: assets/images/chip1.jpg AssetGenImage get chip1 => const AssetGenImage('assets/images/chip1.jpg'); + + /// File path: assets/images/chip2.jpg AssetGenImage get chip2 => const AssetGenImage('assets/images/chip2.jpg'); + $AssetsImagesChip3Gen get chip3 => const $AssetsImagesChip3Gen(); $AssetsImagesChip4Gen get chip4 => const $AssetsImagesChip4Gen(); $AssetsImagesIconsGen get icons => const $AssetsImagesIconsGen(); + + /// File path: assets/images/logo.png AssetGenImage get logo => const AssetGenImage('assets/images/logo.png'); + + /// File path: assets/images/profile.jpg AssetGenImage get profileJpg => const AssetGenImage('assets/images/profile.jpg'); + + /// File path: assets/images/profile.png AssetGenImage get profilePng => const AssetGenImage('assets/images/profile.png'); } @@ -41,26 +53,34 @@ class $AssetsImagesGen { class $AssetsJsonGen { const $AssetsJsonGen(); + /// File path: assets/json/fruits.json String get fruits => 'assets/json/fruits.json'; } class $AssetsMovieGen { const $AssetsMovieGen(); + /// File path: assets/movie/the_earth.mp4 String get theEarth => 'assets/movie/the_earth.mp4'; } class $AssetsUnknownGen { const $AssetsUnknownGen(); + /// File path: assets/unknown/CHANGELOG.md String get changelog => 'assets/unknown/CHANGELOG.md'; + + /// File path: assets/unknown/README.md String get readme => 'assets/unknown/README.md'; + + /// File path: assets/unknown/unknown_mime_type.bk String get unknownMimeType => 'assets/unknown/unknown_mime_type.bk'; } class $AssetsImagesChip3Gen { const $AssetsImagesChip3Gen(); + /// File path: assets/images/chip3/chip3.jpg AssetGenImage get chip3 => const AssetGenImage('assets/images/chip3/chip3.jpg'); } @@ -68,6 +88,7 @@ class $AssetsImagesChip3Gen { class $AssetsImagesChip4Gen { const $AssetsImagesChip4Gen(); + /// File path: assets/images/chip4/chip4.jpg AssetGenImage get chip4 => const AssetGenImage('assets/images/chip4/chip4.jpg'); } @@ -75,11 +96,18 @@ class $AssetsImagesChip4Gen { class $AssetsImagesIconsGen { const $AssetsImagesIconsGen(); + /// File path: assets/images/icons/dart@test.svg SvgGenImage get dartTest => const SvgGenImage('assets/images/icons/dart@test.svg'); + + /// File path: assets/images/icons/fuchsia.svg SvgGenImage get fuchsia => const SvgGenImage('assets/images/icons/fuchsia.svg'); + + /// File path: assets/images/icons/kmm.svg SvgGenImage get kmm => const SvgGenImage('assets/images/icons/kmm.svg'); + + /// File path: assets/images/icons/paint.svg SvgGenImage get paint => const SvgGenImage('assets/images/icons/paint.svg'); } diff --git a/example/lib/gen/colors.gen.dart b/example/lib/gen/colors.gen.dart index 59afc3af..a7d31964 100644 --- a/example/lib/gen/colors.gen.dart +++ b/example/lib/gen/colors.gen.dart @@ -11,11 +11,32 @@ import 'package:flutter/material.dart'; class ColorName { ColorName._(); + /// Color: #000000 static const Color black = Color(0xFF000000); + + /// Color: #4D000000 static const Color black30 = Color(0x4D000000); + + /// Color: #66000000 static const Color black40 = Color(0x66000000); + + /// Color: #80000000 static const Color black50 = Color(0x80000000); + + /// Color: #99000000 static const Color black60 = Color(0x99000000); + + /// MaterialColor: + /// 50: #FFF9E5E5 + /// 100: #FFF1BFBF + /// 200: #FFE79595 + /// 300: #FFDD6A6A + /// 400: #FFD64A4A + /// 500: #FFCF2A2A + /// 600: #FFCA2525 + /// 700: #FFC31F1F + /// 800: #FFBD1919 + /// 900: #FFB20F0F static const MaterialColor crimsonRed = MaterialColor( 0xFFCF2A2A, { @@ -31,9 +52,27 @@ class ColorName { 900: Color(0xFFB20F0F), }, ); + + /// Color: #979797 static const Color gray410 = Color(0xFF979797); + + /// Color: #EEEEEE static const Color gray70 = Color(0xFFEEEEEE); + + /// Color: #FFFFFF static const Color white = Color(0xFFFFFFFF); + + /// MaterialColor: + /// 50: #FFFBF2E5 + /// 100: #FFF5DFBE + /// 200: #FFEFCA93 + /// 300: #FFE9B568 + /// 400: #FFE4A547 + /// 500: #FFDF9527 + /// 600: #FFDB8D23 + /// 700: #FFD7821D + /// 800: #FFD27817 + /// 900: #FFCA670E static const MaterialColor yellowOcher = MaterialColor( 0xFFDF9527, { @@ -49,6 +88,12 @@ class ColorName { 900: Color(0xFFCA670E), }, ); + + /// MaterialAccentColor: + /// 100: #FFFFE8E0 + /// 200: #FFFFBCA3 + /// 400: #FFFFA989 + /// 700: #FFFF9E7A static const MaterialAccentColor yellowOcherAccent = MaterialAccentColor( 0xFFFFBCA3, { diff --git a/example/lib/gen/fonts.gen.dart b/example/lib/gen/fonts.gen.dart index 74928be1..a2088dce 100644 --- a/example/lib/gen/fonts.gen.dart +++ b/example/lib/gen/fonts.gen.dart @@ -8,6 +8,9 @@ class FontFamily { FontFamily._(); + /// Font family: Raleway static const String raleway = 'Raleway'; + + /// Font family: RobotoMono static const String robotoMono = 'RobotoMono'; } diff --git a/packages/core/lib/generators/assets_generator.dart b/packages/core/lib/generators/assets_generator.dart index e64d4383..075bdfac 100644 --- a/packages/core/lib/generators/assets_generator.dart +++ b/packages/core/lib/generators/assets_generator.dart @@ -147,17 +147,21 @@ _Statement? _createAssetTypeStatement( if (assetType.isSupportedImage) { return _Statement( type: 'AssetGenImage', + filePath: assetType.path, name: name, value: 'AssetGenImage(\'${posixStyle(assetType.path)}\')', isConstConstructor: true, + needDartDoc: true, ); } else if (FileSystemEntity.isDirectorySync(childAssetAbsolutePath)) { final childClassName = '\$${assetType.path.camelCase().capitalize()}Gen'; return _Statement( type: childClassName, + filePath: assetType.path, name: name, value: '$childClassName()', isConstConstructor: true, + needDartDoc: false, ); } else if (!assetType.isIgnoreFile) { final integration = integrations.firstWhereOrNull( @@ -166,17 +170,21 @@ _Statement? _createAssetTypeStatement( if (integration == null) { return _Statement( type: 'String', + filePath: assetType.path, name: name, value: '\'${posixStyle(assetType.path)}\'', isConstConstructor: false, + needDartDoc: true, ); } else { integration.isEnabled = true; return _Statement( type: integration.className, + filePath: assetType.path, name: name, value: integration.classInstantiate(posixStyle(assetType.path)), isConstConstructor: integration.isConstConstructor, + needDartDoc: true, ); } } @@ -226,9 +234,11 @@ String _dotDelimiterStyleDefinition( if (dirname(assetType.path) == '.') { assetsStaticStatements.add(_Statement( type: className, + filePath: assetType.path, name: assetType.baseName.camelCase(), value: '$className()', isConstConstructor: true, + needDartDoc: true, )); } } @@ -236,7 +246,8 @@ String _dotDelimiterStyleDefinition( assetTypeQueue.addAll(assetType.children); } } - buffer.writeln(_assetsClassDefinition(assetsStaticStatements)); + buffer + .writeln(_dotDelimiterStyleAssetsClassDefinition(assetsStaticStatements)); return buffer.toString(); } @@ -292,13 +303,24 @@ String _flatStyleDefinition( ) .whereType<_Statement>() .toList(); - return _assetsClassDefinition(statements); + return _flatStyleAssetsClassDefinition(statements); } -String _assetsClassDefinition(List<_Statement> statements) { - final statementsBlock = statements - .map((statement) => ' ${statement.toStaticFieldString()}') - .join('\n'); +String _flatStyleAssetsClassDefinition(List<_Statement> statements) { + final statementsBlock = + statements.map((statement) => '''${statement.toDartDocString()} + ${statement.toStaticFieldString()} + ''').join('\n'); + return _assetsClassDefinition(statementsBlock); +} + +String _dotDelimiterStyleAssetsClassDefinition(List<_Statement> statements) { + final statementsBlock = + statements.map((statement) => statement.toStaticFieldString()).join('\n'); + return _assetsClassDefinition(statementsBlock); +} + +String _assetsClassDefinition(String statementsBlock) { return ''' class Assets { Assets._(); @@ -313,7 +335,11 @@ String _directoryClassGenDefinition( List<_Statement> statements, ) { final statementsBlock = statements - .map((statement) => ' ${statement.toGetterString()}') + .map((statement) => statement.needDartDoc + ? '''${statement.toDartDocString()} + ${statement.toGetterString()} + ''' + : statement.toGetterString()) .join('\n'); return ''' class $className { @@ -383,15 +409,21 @@ class AssetGenImage extends AssetImage { class _Statement { const _Statement({ required this.type, + required this.filePath, required this.name, required this.value, required this.isConstConstructor, + required this.needDartDoc, }); final String type; + final String filePath; final String name; final String value; final bool isConstConstructor; + final bool needDartDoc; + + String toDartDocString() => '/// File path: $filePath'; String toGetterString() => '$type get $name => ${isConstConstructor ? 'const' : ''} $value;'; diff --git a/packages/core/lib/generators/colors_generator.dart b/packages/core/lib/generators/colors_generator.dart index a7a1aab7..49140a67 100644 --- a/packages/core/lib/generators/colors_generator.dart +++ b/packages/core/lib/generators/colors_generator.dart @@ -29,7 +29,7 @@ String generateColors( buffer.writeln("import 'package:flutter/material.dart';"); buffer.writeln(); buffer.writeln('class ColorName {'); - buffer.writeln(' ColorName._();'); + buffer.writeln('ColorName._();'); buffer.writeln(); final colorList = <_Color>[]; @@ -61,8 +61,9 @@ String _colorStatement(_Color color) { final buffer = StringBuffer(); if (color.isMaterial) { final swatch = swatchFromPrimaryHex(color.hex); - final statement = ''' - static const MaterialColor ${color.name.camelCase()} = MaterialColor( + final statement = '''/// MaterialColor: + ${swatch.entries.map((e) => '/// ${e.key}: ${hexFromColor(e.value)}').join('\n')} + static const MaterialColor ${color.name.camelCase()} = MaterialColor( ${swatch[500]}, { ${swatch.entries.map((e) => '${e.key}: Color(${e.value}),').join('\n')} @@ -72,8 +73,9 @@ String _colorStatement(_Color color) { } if (color.isMaterialAccent) { final accentSwatch = accentSwatchFromPrimaryHex(color.hex); - final statement = ''' - static const MaterialAccentColor ${color.name.camelCase()}Accent = MaterialAccentColor( + final statement = '''/// MaterialAccentColor: + ${accentSwatch.entries.map((e) => '/// ${e.key}: ${hexFromColor(e.value)}').join('\n')} + static const MaterialAccentColor ${color.name.camelCase()}Accent = MaterialAccentColor( ${accentSwatch[200]}, { ${accentSwatch.entries.map((e) => '${e.key}: Color(${e.value}),').join('\n')} @@ -82,8 +84,11 @@ String _colorStatement(_Color color) { buffer.writeln(statement); } if (color.isNormal) { + final comment = '/// Color: ${color.hex}'; final statement = '''static const Color ${color.name.camelCase()} = Color(${colorFromHex(color.hex)});'''; + + buffer.writeln(comment); buffer.writeln(statement); } return buffer.toString(); diff --git a/packages/core/lib/generators/fonts_generator.dart b/packages/core/lib/generators/fonts_generator.dart index b99d7191..b6ac3759 100644 --- a/packages/core/lib/generators/fonts_generator.dart +++ b/packages/core/lib/generators/fonts_generator.dart @@ -21,11 +21,12 @@ String generateFonts( buffer.writeln(header); buffer.writeln(ignoreAnalysis); buffer.writeln('class FontFamily {'); - buffer.writeln(' FontFamily._();'); + buffer.writeln('FontFamily._();'); buffer.writeln(); fonts.map((element) => element.family).distinct().sorted().forEach((family) { - buffer.writeln(" static const String ${family.camelCase()} = '$family';"); + buffer.writeln("""/// Font family: $family + static const String ${family.camelCase()} = '$family';"""); }); buffer.writeln('}'); diff --git a/packages/core/lib/utils/color.dart b/packages/core/lib/utils/color.dart index 4de29034..76c08d30 100644 --- a/packages/core/lib/utils/color.dart +++ b/packages/core/lib/utils/color.dart @@ -1,5 +1,11 @@ import 'package:color/color.dart'; +/// e.g. 0xBB1122 -> #BB1122 +String hexFromColor(String hexColor) { + return hexColor.replaceFirst('0x', '#').toUpperCase(); +} + +/// e.g. #BB1122 -> FFBB1122 String colorFromHex(String hexColor) { hexColor = hexColor.toUpperCase().replaceFirst('#', ''); if (hexColor.length == 6) { diff --git a/packages/core/test_resources/actual_data/assets.gen.dart b/packages/core/test_resources/actual_data/assets.gen.dart index e5c8f7d0..17cf1835 100644 --- a/packages/core/test_resources/actual_data/assets.gen.dart +++ b/packages/core/test_resources/actual_data/assets.gen.dart @@ -14,26 +14,38 @@ import 'package:flare_flutter/flare_controller.dart'; class $PicturesGen { const $PicturesGen(); + /// File path: pictures/chip5.jpg AssetGenImage get chip5 => const AssetGenImage('pictures/chip5.jpg'); } class $AssetsFlareGen { const $AssetsFlareGen(); + /// File path: assets/flare/Penguin.flr FlareGenImage get penguin => const FlareGenImage('assets/flare/Penguin.flr'); } class $AssetsImagesGen { const $AssetsImagesGen(); + /// File path: assets/images/chip1.jpg AssetGenImage get chip1 => const AssetGenImage('assets/images/chip1.jpg'); + + /// File path: assets/images/chip2.jpg AssetGenImage get chip2 => const AssetGenImage('assets/images/chip2.jpg'); + $AssetsImagesChip3Gen get chip3 => const $AssetsImagesChip3Gen(); $AssetsImagesChip4Gen get chip4 => const $AssetsImagesChip4Gen(); $AssetsImagesIconsGen get icons => const $AssetsImagesIconsGen(); + + /// File path: assets/images/logo.png AssetGenImage get logo => const AssetGenImage('assets/images/logo.png'); + + /// File path: assets/images/profile.jpg AssetGenImage get profileJpg => const AssetGenImage('assets/images/profile.jpg'); + +/// File path: assets/images/profile.png AssetGenImage get profilePng => const AssetGenImage('assets/images/profile.png'); } @@ -41,24 +53,28 @@ class $AssetsImagesGen { class $AssetsJsonGen { const $AssetsJsonGen(); + /// File path: assets/json/fruits.json String get fruits => 'assets/json/fruits.json'; } class $AssetsMovieGen { const $AssetsMovieGen(); + /// File path: assets/movie/the_earth.mp4 String get theEarth => 'assets/movie/the_earth.mp4'; } class $AssetsUnknownGen { const $AssetsUnknownGen(); + /// File path: assets/unknown/unknown_mime_type.bk String get unknownMimeType => 'assets/unknown/unknown_mime_type.bk'; } class $AssetsImagesChip3Gen { const $AssetsImagesChip3Gen(); + /// File path: assets/images/chip3/chip3.jpg AssetGenImage get chip3 => const AssetGenImage('assets/images/chip3/chip3.jpg'); } @@ -66,6 +82,7 @@ class $AssetsImagesChip3Gen { class $AssetsImagesChip4Gen { const $AssetsImagesChip4Gen(); + /// File path: assets/images/chip4/chip4.jpg AssetGenImage get chip4 => const AssetGenImage('assets/images/chip4/chip4.jpg'); } @@ -73,11 +90,18 @@ class $AssetsImagesChip4Gen { class $AssetsImagesIconsGen { const $AssetsImagesIconsGen(); + /// File path: assets/images/icons/dart@test.svg SvgGenImage get dartTest => const SvgGenImage('assets/images/icons/dart@test.svg'); + + /// File path: assets/images/icons/fuchsia.svg SvgGenImage get fuchsia => const SvgGenImage('assets/images/icons/fuchsia.svg'); + + /// File path: assets/images/icons/kmm.svg SvgGenImage get kmm => const SvgGenImage('assets/images/icons/kmm.svg'); + + /// File path: assets/images/icons/paint.svg SvgGenImage get paint => const SvgGenImage('assets/images/icons/paint.svg'); } diff --git a/packages/core/test_resources/actual_data/assets_camel_case.gen.dart b/packages/core/test_resources/actual_data/assets_camel_case.gen.dart index 6adb49c8..86f76e05 100644 --- a/packages/core/test_resources/actual_data/assets_camel_case.gen.dart +++ b/packages/core/test_resources/actual_data/assets_camel_case.gen.dart @@ -10,26 +10,51 @@ import 'package:flutter/widgets.dart'; class Assets { Assets._(); + /// File path: assets/images/chip1.jpg static const AssetGenImage imagesChip1 = AssetGenImage('assets/images/chip1.jpg'); + + /// File path: assets/images/chip2.jpg static const AssetGenImage imagesChip2 = AssetGenImage('assets/images/chip2.jpg'); + + /// File path: assets/images/chip3/chip3.jpg static const AssetGenImage imagesChip3Chip3 = AssetGenImage('assets/images/chip3/chip3.jpg'); + + /// File path: assets/images/chip4/chip4.jpg static const AssetGenImage imagesChip4Chip4 = AssetGenImage('assets/images/chip4/chip4.jpg'); + + /// File path: assets/images/icons/dart@test.svg static const String imagesIconsDartTest = 'assets/images/icons/dart@test.svg'; + + /// File path: assets/images/icons/fuchsia.svg static const String imagesIconsFuchsia = 'assets/images/icons/fuchsia.svg'; + + /// File path: assets/images/icons/kmm.svg static const String imagesIconsKmm = 'assets/images/icons/kmm.svg'; + + /// File path: assets/images/icons/paint.svg static const String imagesIconsPaint = 'assets/images/icons/paint.svg'; + + /// File path: assets/images/logo.png static const AssetGenImage imagesLogo = AssetGenImage('assets/images/logo.png'); + + /// File path: assets/images/profile.jpg static const AssetGenImage imagesProfileJpg = AssetGenImage('assets/images/profile.jpg'); + + /// File path: assets/images/profile.png static const AssetGenImage imagesProfilePng = AssetGenImage('assets/images/profile.png'); + + /// File path: assets/json/fruits.json static const String jsonFruits = 'assets/json/fruits.json'; + + /// File path: pictures/chip5.jpg static const AssetGenImage picturesChip5 = AssetGenImage('pictures/chip5.jpg'); } diff --git a/packages/core/test_resources/actual_data/assets_flare_integrations.gen.dart b/packages/core/test_resources/actual_data/assets_flare_integrations.gen.dart index 292f63f9..353fc876 100644 --- a/packages/core/test_resources/actual_data/assets_flare_integrations.gen.dart +++ b/packages/core/test_resources/actual_data/assets_flare_integrations.gen.dart @@ -12,6 +12,7 @@ import 'package:flare_flutter/flare_controller.dart'; class $AssetsFlareGen { const $AssetsFlareGen(); + /// File path: assets/flare/Penguin.flr FlareGenImage get penguin => const FlareGenImage('assets/flare/Penguin.flr'); } diff --git a/packages/core/test_resources/actual_data/assets_no_integrations.gen.dart b/packages/core/test_resources/actual_data/assets_no_integrations.gen.dart index 77b7628b..4a6051a0 100644 --- a/packages/core/test_resources/actual_data/assets_no_integrations.gen.dart +++ b/packages/core/test_resources/actual_data/assets_no_integrations.gen.dart @@ -10,20 +10,31 @@ import 'package:flutter/widgets.dart'; class $PicturesGen { const $PicturesGen(); + /// File path: pictures/chip5.jpg AssetGenImage get chip5 => const AssetGenImage('pictures/chip5.jpg'); } class $AssetsImagesGen { const $AssetsImagesGen(); + /// File path: assets/images/chip1.jpg AssetGenImage get chip1 => const AssetGenImage('assets/images/chip1.jpg'); + + /// File path: assets/images/chip2.jpg AssetGenImage get chip2 => const AssetGenImage('assets/images/chip2.jpg'); + $AssetsImagesChip3Gen get chip3 => const $AssetsImagesChip3Gen(); $AssetsImagesChip4Gen get chip4 => const $AssetsImagesChip4Gen(); $AssetsImagesIconsGen get icons => const $AssetsImagesIconsGen(); + + /// File path: assets/images/logo.png AssetGenImage get logo => const AssetGenImage('assets/images/logo.png'); + + /// File path: assets/images/profile.jpg AssetGenImage get profileJpg => const AssetGenImage('assets/images/profile.jpg'); + + /// File path: assets/images/profile.png AssetGenImage get profilePng => const AssetGenImage('assets/images/profile.png'); } @@ -31,12 +42,14 @@ class $AssetsImagesGen { class $AssetsJsonGen { const $AssetsJsonGen(); + /// File path: assets/json/fruits.json String get fruits => 'assets/json/fruits.json'; } class $AssetsImagesChip3Gen { const $AssetsImagesChip3Gen(); + /// File path: assets/images/chip3/chip3.jpg AssetGenImage get chip3 => const AssetGenImage('assets/images/chip3/chip3.jpg'); } @@ -44,6 +57,7 @@ class $AssetsImagesChip3Gen { class $AssetsImagesChip4Gen { const $AssetsImagesChip4Gen(); + /// File path: assets/images/chip4/chip4.jpg AssetGenImage get chip4 => const AssetGenImage('assets/images/chip4/chip4.jpg'); } @@ -51,9 +65,16 @@ class $AssetsImagesChip4Gen { class $AssetsImagesIconsGen { const $AssetsImagesIconsGen(); + /// File path: assets/images/icons/dart@test.svg String get dartTest => 'assets/images/icons/dart@test.svg'; + + /// File path: assets/images/icons/fuchsia.svg String get fuchsia => 'assets/images/icons/fuchsia.svg'; + + /// File path: assets/images/icons/kmm.svg String get kmm => 'assets/images/icons/kmm.svg'; + + /// File path: assets/images/icons/paint.svg String get paint => 'assets/images/icons/paint.svg'; } diff --git a/packages/core/test_resources/actual_data/assets_package_parameter.gen.dart b/packages/core/test_resources/actual_data/assets_package_parameter.gen.dart index 1db6b377..4d24961d 100644 --- a/packages/core/test_resources/actual_data/assets_package_parameter.gen.dart +++ b/packages/core/test_resources/actual_data/assets_package_parameter.gen.dart @@ -19,6 +19,7 @@ class $AssetsImagesGen { class $AssetsImagesChip3Gen { const $AssetsImagesChip3Gen(); + /// File path: assets/images/chip3/chip3.jpg AssetGenImage get chip3 => const AssetGenImage('assets/images/chip3/chip3.jpg'); } @@ -26,8 +27,11 @@ class $AssetsImagesChip3Gen { class $AssetsImagesIconsGen { const $AssetsImagesIconsGen(); + /// File path: assets/images/icons/dart@test.svg SvgGenImage get dartTest => const SvgGenImage('assets/images/icons/dart@test.svg'); + + /// File path: assets/images/icons/fuchsia.svg SvgGenImage get fuchsia => const SvgGenImage('assets/images/icons/fuchsia.svg'); } diff --git a/packages/core/test_resources/actual_data/assets_snake_case.gen.dart b/packages/core/test_resources/actual_data/assets_snake_case.gen.dart index a795fc75..0da93164 100644 --- a/packages/core/test_resources/actual_data/assets_snake_case.gen.dart +++ b/packages/core/test_resources/actual_data/assets_snake_case.gen.dart @@ -10,26 +10,51 @@ import 'package:flutter/widgets.dart'; class Assets { Assets._(); + /// File path: assets/images/chip1.jpg static const AssetGenImage images_chip1 = AssetGenImage('assets/images/chip1.jpg'); + + /// File path: assets/images/chip2.jpg static const AssetGenImage images_chip2 = AssetGenImage('assets/images/chip2.jpg'); + + /// File path: assets/images/chip3/chip3.jpg static const AssetGenImage images_chip3_chip3 = AssetGenImage('assets/images/chip3/chip3.jpg'); + + /// File path: assets/images/chip4/chip4.jpg static const AssetGenImage images_chip4_chip4 = AssetGenImage('assets/images/chip4/chip4.jpg'); + + /// File path: assets/images/icons/dart@test.svg static const String images_icons_dart_test = 'assets/images/icons/dart@test.svg'; + + /// File path: assets/images/icons/fuchsia.svg static const String images_icons_fuchsia = 'assets/images/icons/fuchsia.svg'; + + /// File path: assets/images/icons/kmm.svg static const String images_icons_kmm = 'assets/images/icons/kmm.svg'; + + /// File path: assets/images/icons/paint.svg static const String images_icons_paint = 'assets/images/icons/paint.svg'; + + /// File path: assets/images/logo.png static const AssetGenImage images_logo = AssetGenImage('assets/images/logo.png'); + + /// File path: assets/images/profile.jpg static const AssetGenImage images_profile_jpg = AssetGenImage('assets/images/profile.jpg'); + + /// File path: assets/images/profile.png static const AssetGenImage images_profile_png = AssetGenImage('assets/images/profile.png'); + + /// File path: assets/json/fruits.json static const String json_fruits = 'assets/json/fruits.json'; + + /// File path: pictures/chip5.jpg static const AssetGenImage pictures_chip5 = AssetGenImage('pictures/chip5.jpg'); } diff --git a/packages/core/test_resources/actual_data/assets_svg_integrations.gen.dart b/packages/core/test_resources/actual_data/assets_svg_integrations.gen.dart index 1176baff..0bd1bb25 100644 --- a/packages/core/test_resources/actual_data/assets_svg_integrations.gen.dart +++ b/packages/core/test_resources/actual_data/assets_svg_integrations.gen.dart @@ -18,8 +18,11 @@ class $AssetsImagesGen { class $AssetsImagesIconsGen { const $AssetsImagesIconsGen(); + /// File path: assets/images/icons/dart@test.svg SvgGenImage get dartTest => const SvgGenImage('assets/images/icons/dart@test.svg'); + + /// File path: assets/images/icons/fuchsia.svg SvgGenImage get fuchsia => const SvgGenImage('assets/images/icons/fuchsia.svg'); } diff --git a/packages/core/test_resources/actual_data/assets_unknown_mime_type.gen.dart b/packages/core/test_resources/actual_data/assets_unknown_mime_type.gen.dart index ff95a9d8..0ca199f1 100644 --- a/packages/core/test_resources/actual_data/assets_unknown_mime_type.gen.dart +++ b/packages/core/test_resources/actual_data/assets_unknown_mime_type.gen.dart @@ -10,6 +10,7 @@ import 'package:flutter/widgets.dart'; class $AssetsUnknownGen { const $AssetsUnknownGen(); + /// File path: assets/unknown/unknown_mime_type.bk String get unknownMimeType => 'assets/unknown/unknown_mime_type.bk'; } diff --git a/packages/core/test_resources/actual_data/colors.gen.dart b/packages/core/test_resources/actual_data/colors.gen.dart index 59afc3af..a7d31964 100644 --- a/packages/core/test_resources/actual_data/colors.gen.dart +++ b/packages/core/test_resources/actual_data/colors.gen.dart @@ -11,11 +11,32 @@ import 'package:flutter/material.dart'; class ColorName { ColorName._(); + /// Color: #000000 static const Color black = Color(0xFF000000); + + /// Color: #4D000000 static const Color black30 = Color(0x4D000000); + + /// Color: #66000000 static const Color black40 = Color(0x66000000); + + /// Color: #80000000 static const Color black50 = Color(0x80000000); + + /// Color: #99000000 static const Color black60 = Color(0x99000000); + + /// MaterialColor: + /// 50: #FFF9E5E5 + /// 100: #FFF1BFBF + /// 200: #FFE79595 + /// 300: #FFDD6A6A + /// 400: #FFD64A4A + /// 500: #FFCF2A2A + /// 600: #FFCA2525 + /// 700: #FFC31F1F + /// 800: #FFBD1919 + /// 900: #FFB20F0F static const MaterialColor crimsonRed = MaterialColor( 0xFFCF2A2A, { @@ -31,9 +52,27 @@ class ColorName { 900: Color(0xFFB20F0F), }, ); + + /// Color: #979797 static const Color gray410 = Color(0xFF979797); + + /// Color: #EEEEEE static const Color gray70 = Color(0xFFEEEEEE); + + /// Color: #FFFFFF static const Color white = Color(0xFFFFFFFF); + + /// MaterialColor: + /// 50: #FFFBF2E5 + /// 100: #FFF5DFBE + /// 200: #FFEFCA93 + /// 300: #FFE9B568 + /// 400: #FFE4A547 + /// 500: #FFDF9527 + /// 600: #FFDB8D23 + /// 700: #FFD7821D + /// 800: #FFD27817 + /// 900: #FFCA670E static const MaterialColor yellowOcher = MaterialColor( 0xFFDF9527, { @@ -49,6 +88,12 @@ class ColorName { 900: Color(0xFFCA670E), }, ); + + /// MaterialAccentColor: + /// 100: #FFFFE8E0 + /// 200: #FFFFBCA3 + /// 400: #FFFFA989 + /// 700: #FFFF9E7A static const MaterialAccentColor yellowOcherAccent = MaterialAccentColor( 0xFFFFBCA3, { diff --git a/packages/core/test_resources/actual_data/fonts.gen.dart b/packages/core/test_resources/actual_data/fonts.gen.dart index 74928be1..a2088dce 100644 --- a/packages/core/test_resources/actual_data/fonts.gen.dart +++ b/packages/core/test_resources/actual_data/fonts.gen.dart @@ -8,6 +8,9 @@ class FontFamily { FontFamily._(); + /// Font family: Raleway static const String raleway = 'Raleway'; + + /// Font family: RobotoMono static const String robotoMono = 'RobotoMono'; }