From a4054b8437c015669e633284015a6c47bcdf4d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 08:45:23 +0700 Subject: [PATCH 01/10] update dependency --- .../core/lib/generators/integrations/image_integration.dart | 6 ++++-- .../lib/generators/integrations/lottie_integration.dart | 2 +- packages/core/pubspec.yaml | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/core/lib/generators/integrations/image_integration.dart b/packages/core/lib/generators/integrations/image_integration.dart index 1de34fe7..ec4fbcf7 100644 --- a/packages/core/lib/generators/integrations/image_integration.dart +++ b/packages/core/lib/generators/integrations/image_integration.dart @@ -157,8 +157,10 @@ ${isPackage ? "\n static const String package = '$packageName';" : ''} /// Extract metadata from the asset. ImageMetadata? _getMetadata(AssetType asset) { try { - final size = ImageSizeGetter.getSize(FileInput(File(asset.fullPath))); - return ImageMetadata(size.width.toDouble(), size.height.toDouble()); + final size = + ImageSizeGetter.getSizeResult(FileInput(File(asset.fullPath))); + return ImageMetadata( + size.size.width.toDouble(), size.size.height.toDouble()); } catch (e) { stderr .writeln('[WARNING] Failed to parse \'${asset.path}\' metadata: $e'); diff --git a/packages/core/lib/generators/integrations/lottie_integration.dart b/packages/core/lib/generators/integrations/lottie_integration.dart index 82362f28..55dc3cc4 100644 --- a/packages/core/lib/generators/integrations/lottie_integration.dart +++ b/packages/core/lib/generators/integrations/lottie_integration.dart @@ -125,7 +125,7 @@ ${isPackage ? "\n static const String package = '$packageName';" : ''} } if (asset.mime == 'application/zip') { final inputStream = InputFileStream(asset.fullPath); - final archive = ZipDecoder().decodeBuffer(inputStream); + final archive = ZipDecoder().decodeStream(inputStream); final jsonFile = archive.files.firstWhereOrNull( (e) => e.name.endsWith('.json'), ); diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 81af5bb6..61feb634 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: meta: ^1.7.0 path: ^1.8.0 yaml: ^3.0.0 - mime: '>=1.0.0 <3.0.0' + mime: ">=1.0.0 <3.0.0" xml: ^6.0.0 dartx: ^1.0.0 color: ^3.0.0 @@ -24,8 +24,8 @@ dependencies: json_annotation: ^4.4.0 glob: ^2.0.0 - dart_style: '>=2.2.4 <4.0.0' - archive: ^3.4.0 + dart_style: ">=2.2.4 <4.0.0" + archive: ^4.0.2 args: ^2.0.0 pub_semver: ^2.0.0 vector_graphics_compiler: ^1.1.9 From e9811e2e01de4c161cb197493fd8c4694166918e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 08:49:53 +0700 Subject: [PATCH 02/10] no message --- packages/core/pubspec.yaml | 6 +++--- packages/runner/pubspec.yaml | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 61feb634..9a15b4d9 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -1,13 +1,13 @@ name: flutter_gen_core description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.8.0 +version: 5.9.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=2.17.0 <4.0.0" version_gen: path: lib/ @@ -24,7 +24,7 @@ dependencies: json_annotation: ^4.4.0 glob: ^2.0.0 - dart_style: ">=2.2.4 <4.0.0" + dart_style: ">=3.0.1 <4.0.0" archive: ^4.0.2 args: ^2.0.0 pub_semver: ^2.0.0 diff --git a/packages/runner/pubspec.yaml b/packages/runner/pubspec.yaml index 92d57694..d564fa52 100644 --- a/packages/runner/pubspec.yaml +++ b/packages/runner/pubspec.yaml @@ -1,16 +1,19 @@ name: flutter_gen_runner description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.8.0 +version: 5.9.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=2.17.0 <4.0.0" dependencies: - flutter_gen_core: 5.8.0 + flutter_gen_core: + git: + url: https://github.com/CaoGiaHieu-dev/flutter_gen.git + path: packages/core build: ^2.0.0 collection: ^1.17.0 crypto: ^3.0.0 From e2aabe43debc3d55a7f34085d30fea074e59a25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 09:03:45 +0700 Subject: [PATCH 03/10] update --- packages/command/pubspec.yaml | 6 +++--- packages/command/test/deprecated_configs.yaml | 2 +- packages/core/lib/version.gen.dart | 2 +- packages/core/pubspec.yaml | 2 +- packages/runner/pubspec.yaml | 5 +---- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/command/pubspec.yaml b/packages/command/pubspec.yaml index 8f6f0cc2..7c38e300 100644 --- a/packages/command/pubspec.yaml +++ b/packages/command/pubspec.yaml @@ -1,19 +1,19 @@ name: flutter_gen description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.8.0 +version: 5.9.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: '>=2.17.0 <4.0.0' + sdk: ">=2.17.0 <4.0.0" executables: fluttergen: flutter_gen_command dependencies: - flutter_gen_core: 5.8.0 + flutter_gen_core: 5.9.0 args: ^2.0.0 dev_dependencies: diff --git a/packages/command/test/deprecated_configs.yaml b/packages/command/test/deprecated_configs.yaml index f41a16c5..6be274f6 100644 --- a/packages/command/test/deprecated_configs.yaml +++ b/packages/command/test/deprecated_configs.yaml @@ -6,4 +6,4 @@ flutter_gen: assets: enabled: true style: snake-case - package_parameter_enabled: true \ No newline at end of file + package_parameter_enabled: true diff --git a/packages/core/lib/version.gen.dart b/packages/core/lib/version.gen.dart index 92fad066..267d0e3b 100644 --- a/packages/core/lib/version.gen.dart +++ b/packages/core/lib/version.gen.dart @@ -1,2 +1,2 @@ /// DO NOT MODIFY BY HAND, Generated by version_gen -String packageVersion = '5.8.0'; +String packageVersion = '5.9.0'; diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 9a15b4d9..3f1c6f39 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: json_annotation: ^4.4.0 glob: ^2.0.0 - dart_style: ">=3.0.1 <4.0.0" + dart_style: ^3.0.1 archive: ^4.0.2 args: ^2.0.0 pub_semver: ^2.0.0 diff --git a/packages/runner/pubspec.yaml b/packages/runner/pubspec.yaml index d564fa52..97089229 100644 --- a/packages/runner/pubspec.yaml +++ b/packages/runner/pubspec.yaml @@ -10,10 +10,7 @@ environment: sdk: ">=2.17.0 <4.0.0" dependencies: - flutter_gen_core: - git: - url: https://github.com/CaoGiaHieu-dev/flutter_gen.git - path: packages/core + flutter_gen_core: 5.9.0 build: ^2.0.0 collection: ^1.17.0 crypto: ^3.0.0 From 3670df335e18ac7e6870e0c58d28e2e87ff2d1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 15:08:39 +0700 Subject: [PATCH 04/10] fix test --- examples/example/pubspec.yaml | 12 +++++++----- examples/example_resources/pubspec.yaml | 9 ++++----- .../generators/integrations/lottie_integration.dart | 2 +- packages/core/pubspec.yaml | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/examples/example/pubspec.yaml b/examples/example/pubspec.yaml index 62654fd8..7d1fcb50 100644 --- a/examples/example/pubspec.yaml +++ b/examples/example/pubspec.yaml @@ -1,10 +1,9 @@ name: example description: A sample project using FlutterGen. -publish_to: 'none' +publish_to: "none" environment: - sdk: '>=3.2.0 <4.0.0' - flutter: '>=3.16.0' + sdk: ">=3.2.0 <4.0.0" dependencies: flutter: @@ -12,15 +11,18 @@ dependencies: flutter_svg: ^2.0.0 rive: ^0.11.0 - lottie: ^2.0.0 + lottie: ^3.3.0 example_resources: path: ../example_resources +dependency_overrides: + lottie: ^3.3.0 + dev_dependencies: lints: ^2.0.0 build_runner: ^2.0.0 - flutter_gen_runner: ^5.8.0 + flutter_gen_runner: ^5.9.0 flutter_test: sdk: flutter diff --git a/examples/example_resources/pubspec.yaml b/examples/example_resources/pubspec.yaml index a853c6a1..4f625db6 100644 --- a/examples/example_resources/pubspec.yaml +++ b/examples/example_resources/pubspec.yaml @@ -1,10 +1,9 @@ name: example_resources description: A sample project using FlutterGen. -publish_to: 'none' +publish_to: "none" environment: - sdk: '>=3.2.0 <4.0.0' - flutter: '>=3.16.0' + sdk: ">=3.2.0 <4.0.0" dependencies: flutter: @@ -12,11 +11,11 @@ dependencies: flutter_svg: ^2.0.0 rive: ^0.11.0 - lottie: ^2.0.0 + lottie: ^3.3.0 dev_dependencies: build_runner: ^2.0.0 - flutter_gen_runner: ^5.8.0 + flutter_gen_runner: ^5.9.0 flutter_gen: output: lib/gen/ diff --git a/packages/core/lib/generators/integrations/lottie_integration.dart b/packages/core/lib/generators/integrations/lottie_integration.dart index 55dc3cc4..82362f28 100644 --- a/packages/core/lib/generators/integrations/lottie_integration.dart +++ b/packages/core/lib/generators/integrations/lottie_integration.dart @@ -125,7 +125,7 @@ ${isPackage ? "\n static const String package = '$packageName';" : ''} } if (asset.mime == 'application/zip') { final inputStream = InputFileStream(asset.fullPath); - final archive = ZipDecoder().decodeStream(inputStream); + final archive = ZipDecoder().decodeBuffer(inputStream); final jsonFile = archive.files.firstWhereOrNull( (e) => e.name.endsWith('.json'), ); diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 3f1c6f39..e71c89a5 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -25,7 +25,7 @@ dependencies: glob: ^2.0.0 dart_style: ^3.0.1 - archive: ^4.0.2 + archive: ^3.3.8 args: ^2.0.0 pub_semver: ^2.0.0 vector_graphics_compiler: ^1.1.9 From a0a066176ecbf949a688902ca9ac640660416838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 15:43:25 +0700 Subject: [PATCH 05/10] fix --- examples/example/pubspec.yaml | 7 ++----- examples/example_resources/pubspec.yaml | 4 ++-- packages/command/pubspec.yaml | 4 ++-- .../lib/generators/integrations/image_integration.dart | 6 ++---- packages/core/lib/version.gen.dart | 2 +- packages/core/pubspec.yaml | 8 ++++---- packages/runner/pubspec.yaml | 4 ++-- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/examples/example/pubspec.yaml b/examples/example/pubspec.yaml index 7d1fcb50..666dc83a 100644 --- a/examples/example/pubspec.yaml +++ b/examples/example/pubspec.yaml @@ -1,9 +1,9 @@ name: example description: A sample project using FlutterGen. -publish_to: "none" +publish_to: 'none' environment: - sdk: ">=3.2.0 <4.0.0" + sdk: '>=3.2.0 <4.0.0' dependencies: flutter: @@ -16,9 +16,6 @@ dependencies: example_resources: path: ../example_resources -dependency_overrides: - lottie: ^3.3.0 - dev_dependencies: lints: ^2.0.0 build_runner: ^2.0.0 diff --git a/examples/example_resources/pubspec.yaml b/examples/example_resources/pubspec.yaml index 4f625db6..197d4e04 100644 --- a/examples/example_resources/pubspec.yaml +++ b/examples/example_resources/pubspec.yaml @@ -1,9 +1,9 @@ name: example_resources description: A sample project using FlutterGen. -publish_to: "none" +publish_to: 'none' environment: - sdk: ">=3.2.0 <4.0.0" + sdk: '>=3.2.0 <4.0.0' dependencies: flutter: diff --git a/packages/command/pubspec.yaml b/packages/command/pubspec.yaml index 7c38e300..e79a32b3 100644 --- a/packages/command/pubspec.yaml +++ b/packages/command/pubspec.yaml @@ -1,13 +1,13 @@ name: flutter_gen description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.9.0 +version: 5.8.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: ">=2.17.0 <4.0.0" + sdk: '>=2.17.0 <4.0.0' executables: fluttergen: flutter_gen_command diff --git a/packages/core/lib/generators/integrations/image_integration.dart b/packages/core/lib/generators/integrations/image_integration.dart index ec4fbcf7..1de34fe7 100644 --- a/packages/core/lib/generators/integrations/image_integration.dart +++ b/packages/core/lib/generators/integrations/image_integration.dart @@ -157,10 +157,8 @@ ${isPackage ? "\n static const String package = '$packageName';" : ''} /// Extract metadata from the asset. ImageMetadata? _getMetadata(AssetType asset) { try { - final size = - ImageSizeGetter.getSizeResult(FileInput(File(asset.fullPath))); - return ImageMetadata( - size.size.width.toDouble(), size.size.height.toDouble()); + final size = ImageSizeGetter.getSize(FileInput(File(asset.fullPath))); + return ImageMetadata(size.width.toDouble(), size.height.toDouble()); } catch (e) { stderr .writeln('[WARNING] Failed to parse \'${asset.path}\' metadata: $e'); diff --git a/packages/core/lib/version.gen.dart b/packages/core/lib/version.gen.dart index 267d0e3b..92fad066 100644 --- a/packages/core/lib/version.gen.dart +++ b/packages/core/lib/version.gen.dart @@ -1,2 +1,2 @@ /// DO NOT MODIFY BY HAND, Generated by version_gen -String packageVersion = '5.9.0'; +String packageVersion = '5.8.0'; diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index e71c89a5..f910a97d 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -1,13 +1,13 @@ name: flutter_gen_core description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.9.0 +version: 5.8.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: ">=2.17.0 <4.0.0" + sdk: '>=2.17.0 <4.0.0' version_gen: path: lib/ @@ -16,7 +16,7 @@ dependencies: meta: ^1.7.0 path: ^1.8.0 yaml: ^3.0.0 - mime: ">=1.0.0 <3.0.0" + mime: '>=1.0.0 <3.0.0' xml: ^6.0.0 dartx: ^1.0.0 color: ^3.0.0 @@ -25,7 +25,7 @@ dependencies: glob: ^2.0.0 dart_style: ^3.0.1 - archive: ^3.3.8 + archive: ^3.4.0 args: ^2.0.0 pub_semver: ^2.0.0 vector_graphics_compiler: ^1.1.9 diff --git a/packages/runner/pubspec.yaml b/packages/runner/pubspec.yaml index 97089229..e1bd194c 100644 --- a/packages/runner/pubspec.yaml +++ b/packages/runner/pubspec.yaml @@ -1,13 +1,13 @@ name: flutter_gen_runner description: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs. -version: 5.9.0 +version: 5.8.0 homepage: https://github.com/FlutterGen/flutter_gen repository: https://github.com/FlutterGen/flutter_gen documentation: https://github.com/FlutterGen/flutter_gen issue_tracker: https://github.com/FlutterGen/flutter_gen/issues environment: - sdk: ">=2.17.0 <4.0.0" + sdk: '>=2.17.0 <4.0.0' dependencies: flutter_gen_core: 5.9.0 From d0f46765d5a0b3598b91cbe18ec44356e82c04c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 15:44:16 +0700 Subject: [PATCH 06/10] fix --- packages/command/test/deprecated_configs.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/command/test/deprecated_configs.yaml b/packages/command/test/deprecated_configs.yaml index 6be274f6..00e8df1e 100644 --- a/packages/command/test/deprecated_configs.yaml +++ b/packages/command/test/deprecated_configs.yaml @@ -6,4 +6,3 @@ flutter_gen: assets: enabled: true style: snake-case - package_parameter_enabled: true From 56bfcd4b8db1e484fea848a035b7e92c5e668447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hie=CC=82=CC=81u?= Date: Wed, 8 Jan 2025 15:48:51 +0700 Subject: [PATCH 07/10] fix --- examples/example/pubspec.yaml | 2 +- examples/example_resources/pubspec.yaml | 2 +- packages/command/pubspec.yaml | 2 +- packages/command/test/deprecated_configs.yaml | 1 + packages/runner/pubspec.yaml | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/example/pubspec.yaml b/examples/example/pubspec.yaml index 666dc83a..4b8456ed 100644 --- a/examples/example/pubspec.yaml +++ b/examples/example/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: dev_dependencies: lints: ^2.0.0 build_runner: ^2.0.0 - flutter_gen_runner: ^5.9.0 + flutter_gen_runner: ^5.8.0 flutter_test: sdk: flutter diff --git a/examples/example_resources/pubspec.yaml b/examples/example_resources/pubspec.yaml index 197d4e04..f0f0e3a4 100644 --- a/examples/example_resources/pubspec.yaml +++ b/examples/example_resources/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: dev_dependencies: build_runner: ^2.0.0 - flutter_gen_runner: ^5.9.0 + flutter_gen_runner: ^5.8.0 flutter_gen: output: lib/gen/ diff --git a/packages/command/pubspec.yaml b/packages/command/pubspec.yaml index e79a32b3..8f6f0cc2 100644 --- a/packages/command/pubspec.yaml +++ b/packages/command/pubspec.yaml @@ -13,7 +13,7 @@ executables: fluttergen: flutter_gen_command dependencies: - flutter_gen_core: 5.9.0 + flutter_gen_core: 5.8.0 args: ^2.0.0 dev_dependencies: diff --git a/packages/command/test/deprecated_configs.yaml b/packages/command/test/deprecated_configs.yaml index 00e8df1e..6be274f6 100644 --- a/packages/command/test/deprecated_configs.yaml +++ b/packages/command/test/deprecated_configs.yaml @@ -6,3 +6,4 @@ flutter_gen: assets: enabled: true style: snake-case + package_parameter_enabled: true diff --git a/packages/runner/pubspec.yaml b/packages/runner/pubspec.yaml index e1bd194c..92d57694 100644 --- a/packages/runner/pubspec.yaml +++ b/packages/runner/pubspec.yaml @@ -10,7 +10,7 @@ environment: sdk: '>=2.17.0 <4.0.0' dependencies: - flutter_gen_core: 5.9.0 + flutter_gen_core: 5.8.0 build: ^2.0.0 collection: ^1.17.0 crypto: ^3.0.0 From 412448593f70dae0076792d224e8b0f129459e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hi=E1=BA=BFu?= <57854043+CaoGiaHieu-dev@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:37:09 +0700 Subject: [PATCH 08/10] Update deprecated_configs.yaml From 1c94053184d6a11fccef499d12fb2b88179bc192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hi=E1=BA=BFu?= <57854043+CaoGiaHieu-dev@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:37:43 +0700 Subject: [PATCH 09/10] Update deprecated_configs.yaml From 4523453087b842d87d54b5ca89d22588eca9f2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cao=20Gia=20Hi=E1=BA=BFu?= <57854043+CaoGiaHieu-dev@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:40:01 +0000 Subject: [PATCH 10/10] fix --- packages/command/test/deprecated_configs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/command/test/deprecated_configs.yaml b/packages/command/test/deprecated_configs.yaml index 6be274f6..f41a16c5 100644 --- a/packages/command/test/deprecated_configs.yaml +++ b/packages/command/test/deprecated_configs.yaml @@ -6,4 +6,4 @@ flutter_gen: assets: enabled: true style: snake-case - package_parameter_enabled: true + package_parameter_enabled: true \ No newline at end of file