Repository: FlutterGen/flutter_gen

Issue:
[BUG]: SvgTheme does not work
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Version

5.5.0+1

### Command type

build_runner (Default)

### What happened?

The SvgTheme no longer works when using the flutter_svg integration. The issue is that the `theme` should be passed to the `bytesLoader` when using the default `SvgPicture` constructor, but right now it's passed to the constructor (which is deprecated).

### Relevant a pubspec.yaml.

_No response_

### Relevant log output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct



Fix patch:
diff --git a/examples/example/lib/gen/assets.gen.dart b/examples/example/lib/gen/assets.gen.dart
index 11b4264e1..9efacf68d 100644
--- a/examples/example/lib/gen/assets.gen.dart
+++ b/examples/example/lib/gen/assets.gen.dart
@@ -318,7 +318,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -329,7 +329,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
diff --git a/examples/example_resources/lib/gen/assets.gen.dart b/examples/example_resources/lib/gen/assets.gen.dart
index d1fce0460..0ce358a51 100644
--- a/examples/example_resources/lib/gen/assets.gen.dart
+++ b/examples/example_resources/lib/gen/assets.gen.dart
@@ -186,7 +186,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -197,7 +197,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
diff --git a/packages/core/lib/generators/integrations/svg_integration.dart b/packages/core/lib/generators/integrations/svg_integration.dart
index dc29412e0..247afb1c9 100644
--- a/packages/core/lib/generators/integrations/svg_integration.dart
+++ b/packages/core/lib/generators/integrations/svg_integration.dart
@@ -62,7 +62,7 @@ ${isPackage ? "\n  static const String package = '$packageName';" : ''}
     return SvgPicture(
       _isVecFormat ? 
         AssetBytesLoader(_assetName, assetBundle: bundle, packageName: package) :
-        SvgAssetLoader(_assetName, assetBundle: bundle, packageName: package),
+        SvgAssetLoader(_assetName, assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -73,7 +73,6 @@ ${isPackage ? "\n  static const String package = '$packageName';" : ''}
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ?? (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
       cacheColorFilter: cacheColorFilter,
diff --git a/packages/runner/example/lib/gen/assets.gen.dart b/packages/runner/example/lib/gen/assets.gen.dart
index d895b0c0a..74af6de41 100644
--- a/packages/runner/example/lib/gen/assets.gen.dart
+++ b/packages/runner/example/lib/gen/assets.gen.dart
@@ -293,7 +293,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -304,7 +304,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,


Test patch:
diff --git a/packages/core/test_resources/actual_data/assets.gen.dart b/packages/core/test_resources/actual_data/assets.gen.dart
index c84322a7b..623750cb5 100644
--- a/packages/core/test_resources/actual_data/assets.gen.dart
+++ b/packages/core/test_resources/actual_data/assets.gen.dart
@@ -276,7 +276,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -287,7 +287,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
diff --git a/packages/core/test_resources/actual_data/assets_directory_path.gen.dart b/packages/core/test_resources/actual_data/assets_directory_path.gen.dart
index b5ddfc8ad..0071ab5d1 100644
--- a/packages/core/test_resources/actual_data/assets_directory_path.gen.dart
+++ b/packages/core/test_resources/actual_data/assets_directory_path.gen.dart
@@ -194,7 +194,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -205,7 +205,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
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 b448067fe..99ae52686 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
@@ -192,7 +192,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -203,7 +203,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
diff --git a/packages/core/test_resources/actual_data/assets_parse_metadata.gen.dart b/packages/core/test_resources/actual_data/assets_parse_metadata.gen.dart
index 9eaa21011..8a343ff4b 100644
--- a/packages/core/test_resources/actual_data/assets_parse_metadata.gen.dart
+++ b/packages/core/test_resources/actual_data/assets_parse_metadata.gen.dart
@@ -285,7 +285,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -296,7 +296,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,
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 5c8dc7ad9..4d9b32b11 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
@@ -81,7 +81,7 @@ class SvgGenImage {
           ? AssetBytesLoader(_assetName,
               assetBundle: bundle, packageName: package)
           : SvgAssetLoader(_assetName,
-              assetBundle: bundle, packageName: package),
+              assetBundle: bundle, packageName: package, theme: theme),
       key: key,
       matchTextDirection: matchTextDirection,
       width: width,
@@ -92,7 +92,6 @@ class SvgGenImage {
       placeholderBuilder: placeholderBuilder,
       semanticsLabel: semanticsLabel,
       excludeFromSemantics: excludeFromSemantics,
-      theme: theme,
       colorFilter: colorFilter ??
           (color == null ? null : ColorFilter.mode(color, colorBlendMode)),
       clipBehavior: clipBehavior,