Repository: FlutterGen/flutter_gen

Issue:
[BUG]: Import conflict: Image class defined in flutter and rive
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Version

5.6.0

### Command type

build_runner (Default)

### What happened?

Out of nowhere we started to get an error in the generated file that a image class is found both in `package/flutter/...widgets.dart` and `package/rive`:
`The name 'Image' is defined in the libraries 'package:flutter/src/widgets/image.dart (via package:flutter/widgets.dart)' and 'package:rive/src/rive_core/shapes/image.dart (via package:rive/rive.dart)'.`

Anyone else already faced that issue? Has anything changed in the package?
Or did something change in rive, e.g. they started to export the image class so it's visible?

A workaround for now is to add a `hide Image` to the rive import manually after the `assets.gen.dart` file has been generated.

Our assets folder contains png, jpg, svg and riv files.

### Relevant a pubspec.yaml.

```yaml
dependencies:
  flutter:
    sdk: flutter
  flutter_svg: ^2.0.10+1
  rive: ^0.13.12

dev_dependencies:
  build_runner: ^2.4.11
  flutter_gen_runner: ^5.6.0
  flutter_test:
    sdk: flutter

flutter:
  assets:
    - assets/
    - assets/animations/
    - assets/images/
    - assets/images/first_time_ux/
    - assets/images/first_time_ux/alerting/de/
    - assets/images/first_time_ux/alerting/en/
    - assets/images/group/
    - assets/images/menu_icons/


flutter_gen:
  output: lib/src/generated/
  line_length: 180
  assets:
    outputs:
      package_parameter_enabled: true

  integrations:
    flutter_svg: true
    rive: true
```


### Relevant log output

```shell
FlutterGen v5.6.0 Loading ... pubspec.yaml
[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 903ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Deleting 1 declared outputs which already existed on disk.
[INFO] Checking for unexpected pre-existing outputs. completed, took 2ms

[INFO] Running build...
Generated: lib/src/generated/assets.gen.dart
FlutterGen finished.
```


### Code of Conduct

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


Discussion: Hello,

The error appears starting with `rive` version `0.13.10`.

Version `0.13.9` doesn't export `Image`. For now, we will stay on `rive` `0.13.9` so we "avoid" this error.
Sounds like a `rive` issue which means the issue should be reported to the `rive` package?
Why? If the rive package needs to export the image class they can do that. The flutter_gen rive import statement should be adjusted to hide Image from rive

Fix patch:
diff --git a/examples/example/lib/gen/assets.gen.dart b/examples/example/lib/gen/assets.gen.dart
index ff963ec28..7d719b684 100644
--- a/examples/example/lib/gen/assets.gen.dart
+++ b/examples/example/lib/gen/assets.gen.dart
@@ -7,14 +7,14 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
-import 'package:rive/rive.dart';
-import 'package:lottie/lottie.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:lottie/lottie.dart' as _lottie;
+import 'package:rive/rive.dart' as _rive;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $AssetsFlareGen {
   const $AssetsFlareGen();
@@ -316,7 +316,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -329,29 +329,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
@@ -384,22 +384,22 @@ class FlareGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       _assetName,
       boundsNode: boundsNode,
       animation: animation,
@@ -431,7 +431,7 @@ class RiveGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  RiveAnimation rive({
+  _rive.RiveAnimation rive({
     String? artboard,
     List<String> animations = const [],
     List<String> stateMachines = const [],
@@ -440,10 +440,10 @@ class RiveGenImage {
     Widget? placeHolder,
     bool antialiasing = true,
     bool useArtboardSize = false,
-    List<RiveAnimationController> controllers = const [],
-    OnInitCallback? onInit,
+    List<_rive.RiveAnimationController> controllers = const [],
+    _rive.OnInitCallback? onInit,
   }) {
-    return RiveAnimation.asset(
+    return _rive.RiveAnimation.asset(
       _assetName,
       artboard: artboard,
       animations: animations,
@@ -472,19 +472,23 @@ class LottieGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  LottieBuilder lottie({
+  _lottie.LottieBuilder lottie({
     Animation<double>? controller,
     bool? animate,
-    FrameRate? frameRate,
+    _lottie.FrameRate? frameRate,
     bool? repeat,
     bool? reverse,
-    LottieDelegates? delegates,
-    LottieOptions? options,
-    void Function(LottieComposition)? onLoaded,
-    LottieImageProviderFactory? imageProviderFactory,
+    _lottie.LottieDelegates? delegates,
+    _lottie.LottieOptions? options,
+    void Function(_lottie.LottieComposition)? onLoaded,
+    _lottie.LottieImageProviderFactory? imageProviderFactory,
     Key? key,
     AssetBundle? bundle,
-    Widget Function(BuildContext, Widget, LottieComposition?)? frameBuilder,
+    Widget Function(
+      BuildContext,
+      Widget,
+      _lottie.LottieComposition?,
+    )? frameBuilder,
     ImageErrorWidgetBuilder? errorBuilder,
     double? width,
     double? height,
@@ -495,7 +499,7 @@ class LottieGenImage {
     FilterQuality? filterQuality,
     void Function(String)? onWarning,
   }) {
-    return Lottie.asset(
+    return _lottie.Lottie.asset(
       _assetName,
       controller: controller,
       animate: animate,
diff --git a/examples/example_resources/lib/gen/assets.gen.dart b/examples/example_resources/lib/gen/assets.gen.dart
index 2dec02207..496ea6579 100644
--- a/examples/example_resources/lib/gen/assets.gen.dart
+++ b/examples/example_resources/lib/gen/assets.gen.dart
@@ -7,14 +7,14 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
-import 'package:rive/rive.dart';
-import 'package:lottie/lottie.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:lottie/lottie.dart' as _lottie;
+import 'package:rive/rive.dart' as _rive;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $AssetsImagesGen {
   const $AssetsImagesGen();
@@ -167,7 +167,7 @@ class SvgGenImage {
 
   static const String package = 'example_resources';
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -181,29 +181,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
@@ -238,22 +238,22 @@ class FlareGenImage {
 
   static const String package = 'example_resources';
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       'packages/example_resources/$_assetName',
       boundsNode: boundsNode,
       animation: animation,
@@ -287,7 +287,7 @@ class RiveGenImage {
 
   static const String package = 'example_resources';
 
-  RiveAnimation rive({
+  _rive.RiveAnimation rive({
     String? artboard,
     List<String> animations = const [],
     List<String> stateMachines = const [],
@@ -296,10 +296,10 @@ class RiveGenImage {
     Widget? placeHolder,
     bool antialiasing = true,
     bool useArtboardSize = false,
-    List<RiveAnimationController> controllers = const [],
-    OnInitCallback? onInit,
+    List<_rive.RiveAnimationController> controllers = const [],
+    _rive.OnInitCallback? onInit,
   }) {
-    return RiveAnimation.asset(
+    return _rive.RiveAnimation.asset(
       'packages/example_resources/$_assetName',
       artboard: artboard,
       animations: animations,
@@ -330,19 +330,23 @@ class LottieGenImage {
 
   static const String package = 'example_resources';
 
-  LottieBuilder lottie({
+  _lottie.LottieBuilder lottie({
     Animation<double>? controller,
     bool? animate,
-    FrameRate? frameRate,
+    _lottie.FrameRate? frameRate,
     bool? repeat,
     bool? reverse,
-    LottieDelegates? delegates,
-    LottieOptions? options,
-    void Function(LottieComposition)? onLoaded,
-    LottieImageProviderFactory? imageProviderFactory,
+    _lottie.LottieDelegates? delegates,
+    _lottie.LottieOptions? options,
+    void Function(_lottie.LottieComposition)? onLoaded,
+    _lottie.LottieImageProviderFactory? imageProviderFactory,
     Key? key,
     AssetBundle? bundle,
-    Widget Function(BuildContext, Widget, LottieComposition?)? frameBuilder,
+    Widget Function(
+      BuildContext,
+      Widget,
+      _lottie.LottieComposition?,
+    )? frameBuilder,
     ImageErrorWidgetBuilder? errorBuilder,
     double? width,
     double? height,
@@ -354,7 +358,7 @@ class LottieGenImage {
     FilterQuality? filterQuality,
     void Function(String)? onWarning,
   }) {
-    return Lottie.asset(
+    return _lottie.Lottie.asset(
       _assetName,
       controller: controller,
       animate: animate,
diff --git a/packages/core/lib/generators/assets_generator.dart b/packages/core/lib/generators/assets_generator.dart
index 2547f0d48..d3de55fcf 100644
--- a/packages/core/lib/generators/assets_generator.dart
+++ b/packages/core/lib/generators/assets_generator.dart
@@ -3,7 +3,7 @@ import 'dart:io';
 
 import 'package:collection/collection.dart';
 import 'package:dart_style/dart_style.dart';
-import 'package:dartx/dartx.dart';
+import 'package:dartx/dartx.dart' hide IterableSorted;
 import 'package:flutter_gen_core/generators/generator_helper.dart';
 import 'package:flutter_gen_core/generators/integrations/flare_integration.dart';
 import 'package:flutter_gen_core/generators/integrations/image_integration.dart';
@@ -11,7 +11,6 @@ import 'package:flutter_gen_core/generators/integrations/integration.dart';
 import 'package:flutter_gen_core/generators/integrations/lottie_integration.dart';
 import 'package:flutter_gen_core/generators/integrations/rive_integration.dart';
 import 'package:flutter_gen_core/generators/integrations/svg_integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 import 'package:flutter_gen_core/settings/config.dart';
 import 'package:flutter_gen_core/settings/flavored_asset.dart';
 import 'package:flutter_gen_core/settings/pubspec.dart';
@@ -56,12 +55,10 @@ String generateAssets(
 ) {
   if (config.assets.isEmpty) {
     throw const InvalidSettingsException(
-        'The value of "flutter/assets:" is incorrect.');
+      'The value of "flutter/assets:" is incorrect.',
+    );
   }
 
-  final importsBuffer = StringBuffer();
-  final classesBuffer = StringBuffer();
-
   final integrations = <Integration>[
     ImageIntegration(config.packageParameterLiteral,
         parseMetadata: config.flutterGen.parseMetadata),
@@ -158,6 +155,7 @@ String generateAssets(
     └────────────────────────────────────────────────────────────────────────────────────────┘''');
   }
 
+  final classesBuffer = StringBuffer();
   if (config.flutterGen.assets.outputs.isDotDelimiterStyle) {
     classesBuffer.writeln(_dotDelimiterStyleDefinition(config, integrations));
   } else if (config.flutterGen.assets.outputs.isSnakeCaseStyle) {
@@ -168,19 +166,18 @@ String generateAssets(
     throw 'The value of "flutter_gen/assets/style." is incorrect.';
   }
 
-  final imports = <String>{};
-  integrations
-      .where((integration) => integration.isEnabled)
-      .forEach((integration) {
+  final imports = <Import>{};
+  for (final integration in integrations.where((e) => e.isEnabled)) {
     imports.addAll(integration.requiredImports);
     classesBuffer.writeln(integration.classOutput);
-  });
-  for (final package in imports) {
-    importsBuffer.writeln(import(package));
   }
 
-  final buffer = StringBuffer();
+  final importsBuffer = StringBuffer();
+  for (final e in imports.sorted((a, b) => a.import.compareTo(b.import))) {
+    importsBuffer.writeln(import(e));
+  }
 
+  final buffer = StringBuffer();
   buffer.writeln(header);
   buffer.writeln(ignore);
   buffer.writeln(importsBuffer.toString());
diff --git a/packages/core/lib/generators/generator_helper.dart b/packages/core/lib/generators/generator_helper.dart
index d2eb66fa5..fab1aa04b 100644
--- a/packages/core/lib/generators/generator_helper.dart
+++ b/packages/core/lib/generators/generator_helper.dart
@@ -1,3 +1,5 @@
+import 'package:flutter_gen_core/settings/import.dart';
+
 String get header {
   return '''/// GENERATED CODE - DO NOT MODIFY BY HAND
 /// *****************************************************
@@ -15,4 +17,7 @@ String get ignore {
 ''';
 }
 
-String import(String package) => 'import \'$package\';';
+String import(Import package) {
+  return 'import \'${package.import}\''
+      '${package.alias != null ? ' as ${package.alias}' : ''};';
+}
diff --git a/packages/core/lib/generators/integrations/flare_integration.dart b/packages/core/lib/generators/integrations/flare_integration.dart
index e8644e16f..949cc91f8 100644
--- a/packages/core/lib/generators/integrations/flare_integration.dart
+++ b/packages/core/lib/generators/integrations/flare_integration.dart
@@ -1,5 +1,4 @@
 import 'package:flutter_gen_core/generators/integrations/integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 
 class FlareIntegration extends Integration {
   FlareIntegration(String packageName) : super(packageName);
@@ -7,10 +6,16 @@ class FlareIntegration extends Integration {
   String? get packageExpression => isPackage ? 'packages/$packageName/' : null;
 
   @override
-  List<String> get requiredImports => [
-        'package:flutter/widgets.dart',
-        'package:flare_flutter/flare_actor.dart',
-        'package:flare_flutter/flare_controller.dart',
+  List<Import> get requiredImports => [
+        Import('package:flutter/widgets.dart'),
+        Import(
+          'package:flare_flutter/flare_actor.dart',
+          alias: '_flare_actor',
+        ),
+        Import(
+          'package:flare_flutter/flare_controller.dart',
+          alias: '_flare_controller',
+        ),
       ];
 
   @override
@@ -27,22 +32,22 @@ class FlareIntegration extends Integration {
 
 ${isPackage ? "\n  static const String package = '$packageName';" : ''}
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       ${isPackage ? '\'$packageExpression\$_assetName\'' : '_assetName'},
       boundsNode: boundsNode,
       animation: animation,
diff --git a/packages/core/lib/generators/integrations/image_integration.dart b/packages/core/lib/generators/integrations/image_integration.dart
index 17c71b561..1090c724d 100644
--- a/packages/core/lib/generators/integrations/image_integration.dart
+++ b/packages/core/lib/generators/integrations/image_integration.dart
@@ -1,7 +1,6 @@
 import 'dart:io';
 
 import 'package:flutter_gen_core/generators/integrations/integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 import 'package:image_size_getter/file_input.dart';
 import 'package:image_size_getter/image_size_getter.dart';
 
@@ -21,7 +20,7 @@ class ImageIntegration extends Integration {
       isPackage ? "'packages/$packageName/\$_assetName'" : '_assetName';
 
   @override
-  List<String> get requiredImports => ['package:flutter/widgets.dart'];
+  List<Import> get requiredImports => [Import('package:flutter/widgets.dart')];
 
   @override
   String get classOutput => _classDefinition;
diff --git a/packages/core/lib/generators/integrations/integration.dart b/packages/core/lib/generators/integrations/integration.dart
index 4a32c713a..ee1193f44 100644
--- a/packages/core/lib/generators/integrations/integration.dart
+++ b/packages/core/lib/generators/integrations/integration.dart
@@ -1,4 +1,8 @@
 import 'package:flutter_gen_core/settings/asset_type.dart';
+import 'package:flutter_gen_core/settings/import.dart';
+
+export 'package:flutter_gen_core/settings/asset_type.dart';
+export 'package:flutter_gen_core/settings/import.dart';
 
 /// A base class for all integrations. An integration is a class that
 /// generates code for a specific asset type.
@@ -13,7 +17,7 @@ abstract class Integration {
 
   final bool parseMetadata;
 
-  List<String> get requiredImports;
+  List<Import> get requiredImports;
 
   String get classOutput;
 
diff --git a/packages/core/lib/generators/integrations/lottie_integration.dart b/packages/core/lib/generators/integrations/lottie_integration.dart
index ac9bddd6e..c10060b21 100644
--- a/packages/core/lib/generators/integrations/lottie_integration.dart
+++ b/packages/core/lib/generators/integrations/lottie_integration.dart
@@ -2,7 +2,6 @@ import 'dart:convert';
 import 'dart:io';
 
 import 'package:flutter_gen_core/generators/integrations/integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 import 'package:path/path.dart' as p;
 import 'package:pub_semver/pub_semver.dart';
 
@@ -23,9 +22,9 @@ class LottieIntegration extends Integration {
   String get packageExpression => isPackage ? ' = package' : '';
 
   @override
-  List<String> get requiredImports => [
-        'package:flutter/widgets.dart',
-        'package:lottie/lottie.dart',
+  List<Import> get requiredImports => [
+        Import('package:flutter/widgets.dart'),
+        Import('package:lottie/lottie.dart', alias: '_lottie'),
       ];
 
   @override
@@ -42,19 +41,23 @@ class LottieIntegration extends Integration {
 
 ${isPackage ? "\n  static const String package = '$packageName';" : ''}
 
-  LottieBuilder lottie({
+  _lottie.LottieBuilder lottie({
     Animation<double>? controller,
     bool? animate,
-    FrameRate? frameRate,
+    _lottie.FrameRate? frameRate,
     bool? repeat,
     bool? reverse,
-    LottieDelegates? delegates,
-    LottieOptions? options,
-    void Function(LottieComposition)? onLoaded,
-    LottieImageProviderFactory? imageProviderFactory,
+    _lottie.LottieDelegates? delegates,
+    _lottie.LottieOptions? options,
+    void Function(_lottie.LottieComposition)? onLoaded,
+    _lottie.LottieImageProviderFactory? imageProviderFactory,
     Key? key,
     AssetBundle? bundle,
-    Widget Function(BuildContext, Widget, LottieComposition?)? frameBuilder,
+    Widget Function(
+      BuildContext,
+      Widget,
+      _lottie.LottieComposition?,
+    )? frameBuilder,
     ImageErrorWidgetBuilder? errorBuilder,
     double? width,
     double? height,
@@ -66,7 +69,7 @@ ${isPackage ? "\n  static const String package = '$packageName';" : ''}
     FilterQuality? filterQuality,
     void Function(String)? onWarning,
   }) {
-    return Lottie.asset(
+    return _lottie.Lottie.asset(
       _assetName,
       controller: controller,
       animate: animate,
diff --git a/packages/core/lib/generators/integrations/rive_integration.dart b/packages/core/lib/generators/integrations/rive_integration.dart
index 98742c54e..12f450b90 100644
--- a/packages/core/lib/generators/integrations/rive_integration.dart
+++ b/packages/core/lib/generators/integrations/rive_integration.dart
@@ -1,5 +1,4 @@
 import 'package:flutter_gen_core/generators/integrations/integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 
 class RiveIntegration extends Integration {
   RiveIntegration(String packageName) : super(packageName);
@@ -7,9 +6,9 @@ class RiveIntegration extends Integration {
   String? get packageExpression => isPackage ? 'packages/$packageName/' : null;
 
   @override
-  List<String> get requiredImports => [
-        'package:flutter/widgets.dart',
-        'package:rive/rive.dart',
+  List<Import> get requiredImports => [
+        Import('package:flutter/widgets.dart'),
+        Import('package:rive/rive.dart', alias: '_rive'),
       ];
 
   @override
@@ -26,7 +25,7 @@ class RiveIntegration extends Integration {
 
 ${isPackage ? "\n  static const String package = '$packageName';" : ''}
 
-  RiveAnimation rive({
+  _rive.RiveAnimation rive({
     String? artboard,
     List<String> animations = const [],
     List<String> stateMachines = const [],
@@ -35,10 +34,10 @@ ${isPackage ? "\n  static const String package = '$packageName';" : ''}
     Widget? placeHolder,
     bool antialiasing = true,
     bool useArtboardSize = false,
-    List<RiveAnimationController> controllers = const [],
-    OnInitCallback? onInit,
+    List<_rive.RiveAnimationController> controllers = const [],
+    _rive.OnInitCallback? onInit,
   }) {
-    return RiveAnimation.asset(
+    return _rive.RiveAnimation.asset(
       ${isPackage ? '\'$packageExpression\$_assetName\'' : '_assetName'},
       artboard: artboard,
       animations: animations,
diff --git a/packages/core/lib/generators/integrations/svg_integration.dart b/packages/core/lib/generators/integrations/svg_integration.dart
index 1e21e1839..212f28167 100644
--- a/packages/core/lib/generators/integrations/svg_integration.dart
+++ b/packages/core/lib/generators/integrations/svg_integration.dart
@@ -1,7 +1,6 @@
 import 'dart:io';
 
 import 'package:flutter_gen_core/generators/integrations/integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 import 'package:vector_graphics_compiler/vector_graphics_compiler.dart';
 
 class SvgIntegration extends Integration {
@@ -11,11 +10,11 @@ class SvgIntegration extends Integration {
   String get packageExpression => isPackage ? ' = package' : '';
 
   @override
-  List<String> get requiredImports => [
-        'package:flutter/widgets.dart',
-        'package:flutter/services.dart',
-        'package:flutter_svg/flutter_svg.dart',
-        'package:vector_graphics/vector_graphics.dart',
+  List<Import> get requiredImports => [
+        Import('package:flutter/widgets.dart'),
+        Import('package:flutter/services.dart'),
+        Import('package:flutter_svg/flutter_svg.dart', alias: '_svg'),
+        Import('package:vector_graphics/vector_graphics.dart', alias: '_vg'),
       ];
 
   @override
@@ -41,7 +40,7 @@ class SvgIntegration extends Integration {
 
 ${isPackage ? "\n  static const String package = '$packageName';" : ''}
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -55,29 +54,29 @@ ${isPackage ? "\n  static const String package = '$packageName';" : ''}
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
diff --git a/packages/core/lib/settings/import.dart b/packages/core/lib/settings/import.dart
new file mode 100644
index 000000000..bf236a05f
--- /dev/null
+++ b/packages/core/lib/settings/import.dart
@@ -0,0 +1,20 @@
+import 'package:meta/meta.dart';
+
+@immutable
+class Import {
+  const Import(this.import, {this.alias});
+
+  final String import;
+  final String? alias;
+
+  @override
+  bool operator ==(Object other) {
+    if (identical(this, other)) return true;
+    return other is Import &&
+        identical(other.import, import) &&
+        identical(other.alias, alias);
+  }
+
+  @override
+  int get hashCode => import.hashCode ^ alias.hashCode;
+}
diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml
index dbf129861..725b4e455 100644
--- a/packages/core/pubspec.yaml
+++ b/packages/core/pubspec.yaml
@@ -13,6 +13,7 @@ version_gen:
   path: lib/
 
 dependencies:
+  meta: ^1.7.0
   path: ^1.8.0
   yaml: ^3.0.0
   mime: ^1.0.0


Test patch:
diff --git a/packages/core/test/assets_gen_integrations_test.dart b/packages/core/test/assets_gen_integrations_test.dart
index 66002d32b..6483c414c 100644
--- a/packages/core/test/assets_gen_integrations_test.dart
+++ b/packages/core/test/assets_gen_integrations_test.dart
@@ -4,7 +4,6 @@ import 'package:flutter_gen_core/generators/integrations/integration.dart';
 import 'package:flutter_gen_core/generators/integrations/lottie_integration.dart';
 import 'package:flutter_gen_core/generators/integrations/rive_integration.dart';
 import 'package:flutter_gen_core/generators/integrations/svg_integration.dart';
-import 'package:flutter_gen_core/settings/asset_type.dart';
 import 'package:path/path.dart' as p;
 import 'package:test/test.dart';
 
@@ -28,7 +27,7 @@ class TestIntegration extends Integration {
   }
 
   @override
-  List<String> get requiredImports => [];
+  List<Import> get requiredImports => [];
 }
 
 void main() {
diff --git a/packages/core/test_resources/actual_data/assets.gen.dart b/packages/core/test_resources/actual_data/assets.gen.dart
index acf5974b7..6d465daf4 100644
--- a/packages/core/test_resources/actual_data/assets.gen.dart
+++ b/packages/core/test_resources/actual_data/assets.gen.dart
@@ -7,12 +7,12 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $PicturesGen {
   const $PicturesGen();
@@ -258,7 +258,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -271,29 +271,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
@@ -326,22 +326,22 @@ class FlareGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       _assetName,
       boundsNode: boundsNode,
       animation: animation,
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 e4025aad4..6d96fa94b 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
@@ -7,10 +7,10 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $AssetsImagesGen {
   const $AssetsImagesGen();
@@ -176,7 +176,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -189,29 +189,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
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 02b53db94..68b8b3b9c 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
@@ -7,9 +7,9 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/widgets.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
 
 class $AssetsFlareGen {
   const $AssetsFlareGen();
@@ -36,22 +36,22 @@ class FlareGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       _assetName,
       boundsNode: boundsNode,
       animation: animation,
diff --git a/packages/core/test_resources/actual_data/assets_flavored.gen.dart b/packages/core/test_resources/actual_data/assets_flavored.gen.dart
index 987e64ade..92612dfdd 100644
--- a/packages/core/test_resources/actual_data/assets_flavored.gen.dart
+++ b/packages/core/test_resources/actual_data/assets_flavored.gen.dart
@@ -7,12 +7,12 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $PicturesGen {
   const $PicturesGen();
@@ -260,7 +260,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -273,29 +273,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
@@ -328,22 +328,22 @@ class FlareGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       _assetName,
       boundsNode: boundsNode,
       animation: animation,
diff --git a/packages/core/test_resources/actual_data/assets_lottie_integrations.gen.dart b/packages/core/test_resources/actual_data/assets_lottie_integrations.gen.dart
index 8db51bf65..6cdabfb82 100644
--- a/packages/core/test_resources/actual_data/assets_lottie_integrations.gen.dart
+++ b/packages/core/test_resources/actual_data/assets_lottie_integrations.gen.dart
@@ -8,7 +8,7 @@
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
 import 'package:flutter/widgets.dart';
-import 'package:lottie/lottie.dart';
+import 'package:lottie/lottie.dart' as _lottie;
 
 class $AssetsLottieGen {
   const $AssetsLottieGen();
@@ -36,19 +36,23 @@ class LottieGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  LottieBuilder lottie({
+  _lottie.LottieBuilder lottie({
     Animation<double>? controller,
     bool? animate,
-    FrameRate? frameRate,
+    _lottie.FrameRate? frameRate,
     bool? repeat,
     bool? reverse,
-    LottieDelegates? delegates,
-    LottieOptions? options,
-    void Function(LottieComposition)? onLoaded,
-    LottieImageProviderFactory? imageProviderFactory,
+    _lottie.LottieDelegates? delegates,
+    _lottie.LottieOptions? options,
+    void Function(_lottie.LottieComposition)? onLoaded,
+    _lottie.LottieImageProviderFactory? imageProviderFactory,
     Key? key,
     AssetBundle? bundle,
-    Widget Function(BuildContext, Widget, LottieComposition?)? frameBuilder,
+    Widget Function(
+      BuildContext,
+      Widget,
+      _lottie.LottieComposition?,
+    )? frameBuilder,
     ImageErrorWidgetBuilder? errorBuilder,
     double? width,
     double? height,
@@ -59,7 +63,7 @@ class LottieGenImage {
     FilterQuality? filterQuality,
     void Function(String)? onWarning,
   }) {
-    return Lottie.asset(
+    return _lottie.Lottie.asset(
       _assetName,
       controller: controller,
       animate: animate,
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 21f1b1a9b..9985ca707 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
@@ -7,10 +7,10 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $AssetsImagesGen {
   const $AssetsImagesGen();
@@ -173,7 +173,7 @@ class SvgGenImage {
 
   static const String package = 'test';
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -187,29 +187,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
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 ef4968182..3f7a3e6e5 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
@@ -7,12 +7,12 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
+import 'package:flare_flutter/flare_actor.dart' as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart' as _flare_controller;
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
-import 'package:flare_flutter/flare_actor.dart';
-import 'package:flare_flutter/flare_controller.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $PicturesGen {
   const $PicturesGen();
@@ -267,7 +267,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -280,29 +280,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,
@@ -335,22 +335,22 @@ class FlareGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  FlareActor flare({
+  _flare_actor.FlareActor flare({
     String? boundsNode,
     String? animation,
     BoxFit fit = BoxFit.contain,
     Alignment alignment = Alignment.center,
     bool isPaused = false,
     bool snapToEnd = false,
-    FlareController? controller,
-    FlareCompletedCallback? callback,
+    _flare_controller.FlareController? controller,
+    _flare_actor.FlareCompletedCallback? callback,
     Color? color,
     bool shouldClip = true,
     bool sizeFromArtboard = false,
     String? artboard,
     bool antialias = true,
   }) {
-    return FlareActor(
+    return _flare_actor.FlareActor(
       _assetName,
       boundsNode: boundsNode,
       animation: animation,
diff --git a/packages/core/test_resources/actual_data/assets_rive_integrations.gen.dart b/packages/core/test_resources/actual_data/assets_rive_integrations.gen.dart
index d296b1689..ddf214209 100644
--- a/packages/core/test_resources/actual_data/assets_rive_integrations.gen.dart
+++ b/packages/core/test_resources/actual_data/assets_rive_integrations.gen.dart
@@ -8,7 +8,7 @@
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
 import 'package:flutter/widgets.dart';
-import 'package:rive/rive.dart';
+import 'package:rive/rive.dart' as _rive;
 
 class $AssetsRiveGen {
   const $AssetsRiveGen();
@@ -35,7 +35,7 @@ class RiveGenImage {
   final String _assetName;
   final Set<String> flavors;
 
-  RiveAnimation rive({
+  _rive.RiveAnimation rive({
     String? artboard,
     List<String> animations = const [],
     List<String> stateMachines = const [],
@@ -44,10 +44,10 @@ class RiveGenImage {
     Widget? placeHolder,
     bool antialiasing = true,
     bool useArtboardSize = false,
-    List<RiveAnimationController> controllers = const [],
-    OnInitCallback? onInit,
+    List<_rive.RiveAnimationController> controllers = const [],
+    _rive.OnInitCallback? onInit,
   }) {
-    return RiveAnimation.asset(
+    return _rive.RiveAnimation.asset(
       _assetName,
       artboard: artboard,
       animations: animations,
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 8eedabddb..c4bd61c9e 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
@@ -7,10 +7,10 @@
 // ignore_for_file: type=lint
 // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
 
-import 'package:flutter/widgets.dart';
 import 'package:flutter/services.dart';
-import 'package:flutter_svg/flutter_svg.dart';
-import 'package:vector_graphics/vector_graphics.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart' as _svg;
+import 'package:vector_graphics/vector_graphics.dart' as _vg;
 
 class $AssetsImagesGen {
   const $AssetsImagesGen();
@@ -58,7 +58,7 @@ class SvgGenImage {
   final Set<String> flavors;
   final bool _isVecFormat;
 
-  SvgPicture svg({
+  _svg.SvgPicture svg({
     Key? key,
     bool matchTextDirection = false,
     AssetBundle? bundle,
@@ -71,29 +71,29 @@ class SvgGenImage {
     WidgetBuilder? placeholderBuilder,
     String? semanticsLabel,
     bool excludeFromSemantics = false,
-    SvgTheme? theme,
+    _svg.SvgTheme? theme,
     ColorFilter? colorFilter,
     Clip clipBehavior = Clip.hardEdge,
     @deprecated Color? color,
     @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
     @deprecated bool cacheColorFilter = false,
   }) {
-    final BytesLoader loader;
+    final _svg.BytesLoader loader;
     if (_isVecFormat) {
-      loader = AssetBytesLoader(
+      loader = _vg.AssetBytesLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
       );
     } else {
-      loader = SvgAssetLoader(
+      loader = _svg.SvgAssetLoader(
         _assetName,
         assetBundle: bundle,
         packageName: package,
         theme: theme,
       );
     }
-    return SvgPicture(
+    return _svg.SvgPicture(
       loader,
       key: key,
       matchTextDirection: matchTextDirection,