I am trying to customize the starter template for a Flutter app. For projects that I work on I follow a very specific structure with my Themes, Blocs, Listeners, etc. I would love it if I could customize the starter template for Flutter so that I have everything all laid out and ready to use on doing something like flutter create .
I am aware of where the template is located. I was able to go to [flutter_dir]/packages/flutter_tools/templates/app/lib/main.dart.tmpl and customize the template.
But I am not able to figure out how I can add a new file/directory there. Let's say if I create a new file called config.dart.tmpl in the same directory as above, it does not get generated when I do flutter create
Any ideas how to get this to work or where I should be looking?
NOTE
I have already tried out other options like Mason. It works fine for me, but I am more interested in doing it with default flutter tooling.
Already seen https://stackoverflow.com/a/61974852/6891637 and IDE file templates is not what I am looking for.
Currently there's no easy way to create a template similar to skeleton, package, and plugin. There's an open issue ticket for this feature. However, if you really need to create one. You can explore how skeleton was added as a template on this pull request.
Or as a workaround, you can just create a Flutter project template on your repo and fork it when starting a project.
This is the current issue about this topic : https://github.com/flutter/flutter/issues/77104
As Felix Angelov said, Mason and VeryGoodCLI are the best alternatives right now.
Related
I am using this code: https://github.com/pradeepramakrishna/Lightning-Experience/tree/master/aura-components to compile on my org.
I have got one components as eventLib.lib and interactive.js in eventLib folder. I have put this folder in c:MyDevOrg\force-app\main\default\aura folder in the local machine and tried to deploy in the org using VSCode but it didn't work.
I tried creating folder in the Files tab and added the interactive.js in the folder but that is also not seeming to work with the Aura components.
How can I deploy this lib into the org as it is being used in some Aura components.
We don't know what you're trying to achieve. You asked a very technical question to which the answer is "you're probably doing it wrong". Instead try to write what business functionality you are trying to achieve and you might get better answers.
You shouldn't have to import ui:eventLib. It's supposed to be part of core Salesforce's Aura components framework. But.
You've referenced a repo that wasn't updated in a while, no promises this still compiles / is best way to do X.
This repo seems to rely on open source Aura framework which is well... dead in the water.
You might be able to reuse something from this repo in your app using SF's built-in tags - but whole ui: library has been deprecated. Announced in Winter'20 = almost 2 years ago, finally dead in May 2021.
I don't think eventLib was ever exposed, might be something needed just in open source version which complicates the matter more. The answer would be to not work with the really "decompiled" tags but with their higher abstracted versions like ui:inputDate.
So, back to my question. What exactly are you trying to achieve.
You want to build something on pure SF platform (use pure Aura/LWC).
Want to have an app written in Angular, React etc, pure JS, connecting to SF data via API? (build it, upload as static resourcethen import using lightning:container)
want to prettify an existing Java/PHP/.NET app, make it look more Lightning-ish and embed it as iframe? (look into https://www.lightningdesignsystem.com/ and connected apps + "canvas")
want to expose piece of SF as reusable element that can be embedded in another website but could even be an Outlook plugin? (search for "lightning out")
want to look at modern equivalent of that old open source Aura repo and decide what to do next? Check https://lwc.dev/ out.
How can I remove the web component part of a Flutter project? I have a project that when it was created was automatically created with web support. Now I am 100% certain the app won't be used for web and I just want to remove support for it. Is there a command in the terminal to help me do that?
I tried checking through the other questions but the others were asking how to disable web support altogether. I just want to remove web support on one project.
In order to fix this, I followed this link. The reason why I can't recreate the project easily is that the project has grown so much that it would be a big hassle to move it into another project. This happened after we updated all of our libraries to their latest versions respectively.
FirestoreWeb caused our project to stop compiling but since we aren't using Flutter web and we don't plan to use it for this project, it wouldn't make sense for us to implement it.
This answer was posted as an edit to the question Remove Web Part from Existing Flutter Project by the OP kobowo under CC BY-SA 4.0.
I'm new at programming using flutter and I'd like to develop a small project containing a few screens: Login, Home, Settings, User, PurchaseHistory, etc.
I need to organize the code inside packages so that it can readable easily.
If I develop an Android App, I'd create some packages: model, activity, fragment, util, etc. If I create a LoginActivty, I'd put it inside activity package. If I create a User model, I'd put it inside model package. And so on.
So If I develop a flutter project, where am I supposed to put all of the files I create so far?
For now I've created only model package.
First of all, in Flutter we don't deal with activities or fragments directly, that is a naming convention from Android itself.
There are many options to architect your app and organize your folders. I wouldn't say that there is a holy grail solution. So you have to try some of them and see the best fit for you.
At the end of this article, I show an option to a folder structure when working with flavors, like this:
But there are plenty of others, so I recommend you to see how some of the GitHub projects are organized, a good way to start is having a look at the projects from this repository. Especially the 'Open Source Apps' section.
I'm currently working on a project that follows an approach like you described.
I don't know if it's the better structure, but it works really nice for me.
\lib
\-model
\-api
\-bloc
\-widgets (commom components)
\-exceptions
\-config (config classes/files like routes, theme, specific settings for each environment - dev, production, test)
\-views
\-login
\-home
\-user_profile
\-...
\-main.dart
----- EDITED -----
After work for almost a year with Flutter, I've tested some different structures, and there's one in particular that's really nice and provides an amazing organization...
Take a look at slidy, the following image represents the kind of organization it provides. More details in the package description.
I have installed the color picker package provided here!
Also I have developed another plugin based on this for different functionality but I am not able to use both at same time. Individually both are working fine. One overrides other if they both installed.
Any way or link will be helpful.
Solved by integrating files in one.
I have a NetBeans javascript project with several included paths for plugins. I do not want to include the plugins in my core repository, so I have created separate, external folders for each and am including them via an include path. Because I test across many devices, I need my changes to upload on save and this works fine for the main code base, however, I would like to be able to edit a plugin via the include path and see those changes auto uploaded as well. Is this possible?
As of right now, the only alternative I see is to create separate projects for each plugin, which I am willing to do if this is the only option. The single project workflow is very preferable to me and I might be willing to switch IDE's if this is possible in another environment.
I would be happy to elaborate if my intentions are unclear.
I don't think it's possible. What about creating one single "umbrella" project for all plugins and simply manage it the same way you do the main project?
Personal note: What you have is basically several projects and the uploading is focused always on single project. So what you want is like "I want to treat them as projects but not to at the same time" :) Btw, how do you edit a plugin? I guess open it as a project in NetBeans or use some text editor. So again you basically treat it as a project.