Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Generate assets from subpackages into main package #391

Open
2 tasks done
natintosh opened this issue May 11, 2023 · 1 comment
Open
2 tasks done

[FR]: Generate assets from subpackages into main package #391

natintosh opened this issue May 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@natintosh
Copy link

natintosh commented May 11, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

I am not sure if this is possible or if this feature is already possible but to put it more concisely, I am not able to generate assets from a sub package

Describe the solution

I would like FlutterGen to generate assets from resources from other packages. for instance

/my_resource_package
  /assets
    /icon_1.png
    /icon_2.png
 /lib
  /others_components
pubspec.yaml    <<< Declare assets in here
/my_app
  /assets
    /others_assets
  /lib
   /gen
     assets.gen.dart     <<< Generated assets class that contains assets from my_resource_package and my_app
  pubspec.yaml           <<< flutter_gen dependencies and configurations

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@natintosh natintosh added the enhancement New feature or request label May 11, 2023
@bramp
Copy link
Contributor

bramp commented Apr 7, 2024

If it helps, I have subpackages and I generate assets.gen.dart for each subpackage. Then I just do something like this:

import 'package:ui' as ui;
import 'package:icons' as icons;

build() {
  Widget(img: ui.Assets.buttton...
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants