How does flutter plugin depend on android module - flutter

I am writing a flutter plugin and need to import a module, but after importing it, the folder is in example/android and cannot be used after other projects depend on it.
What should I do to properly depend on the module?
like this question: but it's been 3 years since this issue

Related

Is there a way to convert flutter package to plugin?

I have a Package made a while ago but I want to add some Android specific code (Java, but this doesn't matter). The only approach I currently have is just creating a new Plugin and moving things around from the old package to the new plugin.
Is there another way I'm missing?
Maybe a command line prompt or another tool?
Note for the differences between Package and Plugin from flutter.dev

Xcode import local Swift Package and build from the app

The goal is to import a local Swift Package "Shared" into a Xcode project and have them both in a workspace.
I have created a workspace, dragged and dropped both the package and the project in, and then added the package to the app by adding it to Frameworks, Libraries, and Embedded Content.
This works when building from the workspace! But I have to make it also possible to build from the app project, currently it throws: "Missing package product 'Shared'".
I know it is possible to do what I want because I have an example project where it works, in there Shared is listed as a local Swift Package in the app project, in mine it is not. In the project Shared is listed under Frameworks, Libraries, and Embedded Content but can't be added again after removing the reference.
It would be great if someone could help me with this!
The solution is to create a local Swift Package in the app project and to import the Shared Package there. Then it will be available in the whole project.

How to add a new flutter project as a IntelliJ module in a larger project

I have a single INTELLIJ project, with 4 java modules and 4 python modules, each is also pretty much a separate sub-project in gradle. Now, in an isolated module in the same project I want a flutter app.
Eventually I might want to make custom gradle tasks to run flutter as a subproject so that I can build all from gradle but that is way down the road. Right now I'm trying to get the intelliJ flutter plugin to work with the flutter project as a module (instead of the base folder, one level down, app/flutterApp/[Anything Flutter Needs]).
The dream is to have these 9 projects in the same folder, master project, git and build pipeline as a single set without losing functionality... if it can happen without touching android studio even better.
Instructions (So far):
File - new - module, then select flutter.
Add the module in project structure so it's inline with the others (use dot notation to signify module groups/folders).
Add "Dart SDK", "Dart Packages" and "Flutter Plugins" Dependencies in the said tab of the module.
Set the flutter sdk location (File - Settings - Languages - Flutter)
RUN main.dart: This allows the flutter plugin to recognize it; sadly after figuring the rest out, this is what thwarted the effort.

importing library project + different projects into Android Studio from Eclipse

Looks like the time has come for me to start using Android Studio, as I need some features that unfortunately have not been ported to Eclipse :(
Fortunately Android Studio is able to nearly-flawlessly import my projects, although I'm concerned if I'm doing it correctly
My Eclipse Workspace Layout is as follows:
LIB-CODEBASE is a big library project that contains most of the application beef
APP-KINDLE is a runnable project that uses the former, and provides some additional classes and activities for the KINDLE version of the app
APP-FIRETV is the same, but targeted to Amazon FireTV devices
APP-GOOGLE is the same, but targeted to Google-Play certified devices
APP-GCAST is the same, but targeted to modern devices supporting Chromecast.
When I import into Android Studio any of the APP-XXXX projects, it creates a copy of LIB-CODEBASE inside. So for each APP-XXXX project I have a full copy of LIB-CODEBASE inside their folders.
Is there an easy way to make all APP-XXXX projects to just share, link or include the LIB-CODEBASE project?
Inside a project you can refer an external module.
Just use:
Project
|__build.gradle
|__settings.gradle
|__app (application module)
|__build.gradle
In settings.gradle:
include ':app'
include ':codeBaseLib'
project(':codeBaseLib').projectDir=new File('pathLibrary')
In app/build.gradle:
dependencies {
compile project(':codeBaseLib')
}
Pay attention to codeBaseLib.
You have to use the path of the library inside the other project, not the root of the project.
Also for your APP-XXXX projects check if you can use a single project with different flavors.

Distribute Dart framework outside of package directory as project template

I'm trying to create a Dart backend framework that developers can download as a dependancy and have the basic folder structure, Dart files and such generated for them in their own project. From what I understand, downloading a dependancy package only places files inside the package directory/ies (although, I may be wrong).
To get around this, I believe Dart can be used like a Bash script, and can place files in the project directory automatically through running the package's bin files in the terminal (illustrated in the Running a script in a dependency https://www.dartlang.org/tools/pub/cmd/pub-run.html).
Would this be the best way to achieve the desired result? Or is there an easier way to download a framework as a project template? (I'd also like to place similar scripts for generating controllers and such in the tools directory, and don't know if keeping this framework as a dependancy would be necessary after 'install').
Thank you for reading.
You can use pub global activate some_package to be able to use pub global run some_package:some_script or just some_script to allow to run a script contained in a Dart package without adding it to the dependencies.
I think this is the best way to distribute it.