In the futter/examples folder there are lot examples of applications. How to build and run them on Android for instance? I tried to open projects using the IntelliJ IDEA framework, but I did not succeed. I.e. the project is being opened, but it's impossible to build it because of undecidable dependences.
run
flutter update-packages
then in the directory of the example
flutter run
Related
I have downloaded a flutter project from google drive. And when i opened it, packages are missing. Is there any command like 'npm i' in flutter to install the dependencies?
run flutter pub get in the project root directory.
make sure to have a good internet connection, it may take a while if the project has a lot of dependencies.
Running flutter pub get should do the trick.
Run flutter pub get in the project root directory.
Should internet connection.
Be sure in project root directory
My requirement is to use linters in my base package from Flutter stable as well as from pedantic in analysis_options.yaml file and I will use the analysis_options.yaml file in my other packages which are dependent on my base package. But while referring both (in my base project) linters, in the Dart Analysis tab of android studio or PROBLEMS tab of visual studio code I didn't see any error. While using flutter analyze command, I'm facing the below issue.
I have created a simple projects to replicate this issue which can be found below.
MyProjects
With the above attachment, I have two projects (Project1 and Project2). In my machine, while using flutter analyze command in both projects, the Project1 doesn't show any issues and Project2 will show the above error (file_not_found). The difference between those projects is, in Project1, I will have analysis_options.yaml file under example folder and in Project2 I won't have analysis_options.yaml file under example folder.
But while testing these two projects with different machines (I have tested around more than 10 machines) I'm facing below scenarios.
No issues with both project
File not found issues with two projects
No issue with Project1 and File not found issue only with Project2.
Since the issue is inconsistent with different machine, I can't resolve this.
I have tested this with Flutter stable channel and in the beta channel.
Note: If I remove the example folder I don't see any errors, but I need to have that example folder in my packages.
Replication Steps:
Extract the attachment
Move to the terminal from the projects and give flutter analyze command.
Flutter installed info:
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.
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.
Once I create my Phonegap project through the CLI with:
cordova create hello com.example.hello "HelloWorld"
add the android platform and import the project to my Eclipse, every time I run a cordova build android command, it undo/reverts the code that I changed on Eclipse, looks like it always gets reverted to the original project structure created by Cordova CLI, maybe I missed something in the documentation... any ideas?
UPDATE
Ok.. So the plan will be, I will develop my app using the root files, i.e., within hello/www/* (instead of the files within hello/platforms/android/assets/www/*) because Phonegap will override any changes to the ones for specific platforms as part of its build process. My development workflow then involves TextMate to edit HMTL/CSS/JS and then running cordova prepare under the project's folder in order to update the files in my Eclipse project.
Anyway.. just sharing my solution workaround to the cumbersome development process for Phonegap + Android because, IMHO, the documentation around this technology sucks...