How To: Add flutter screen from one flutter app to another? - flutter

I See this:
Add different routes/screens to Flutter app
but not the same thing.
So. I have several Flutter "TEMPLATE" apps, not real code, just the views not hooked up to the backend.
I am using Flutter Template A as the base with its screens.
Now I want to grab some Screens from Flutter Template B and Add/Import them into Flutter Template A
Again, I want to grab some Screens from Flutter Template C and Add/Import them into Flutter Template A
I am new to Flutter - but have over 35 development experiences in a broad range of languages.
Which files needed to move "A Screen" over and add to the router?
If anyone has done this, please help.

It needs what it needs. There are view, model, and controller classes, perhaps all in one file, or spread out across multiple directories. So many ways of doing it that your question is unanswerable without looking at the code. If you got these "templates" from a vendor, hopefully the vendor documented some of that.

Related

How to find the input form in the Flutter mobile program structure?

I have a task to solve a bug for an application form update on an application that uses Flutter when it is built. However, this is my first time using Flutter, and the program structure is a bit confusing. Can you tell me the easiest way to find the form structure in a Flutter program?
Start with exploring the screens available in your project to know which screen is being displayed that you need to debug. Then have a look at the widgets which this screen is composed of to point to the one that is causing the bug.

Which is the better way to white-label a flutter app

I have one project that I have to sell to another clients, so I wanna found a way to unify the code to, when I release some updates, I have to manipulate only one code (and, of course, keeping the specificities from each one)
I found an article HERE which the guy creates a new folder named 'config' and set some variables there to be used in the parent project. I tried this but find out that would be very tough to do because the first app was developed specifically by one client, and with it I would need so much time to make all the aspects dynamic... Another problem is firebase, in first app I used firebase but in the second i won't. How to make it possible?
And in this article they say about 'flavours' that can be used to do something similar.
Someone knows about this approaches or there is another to reach my goal? With flavours I will have less re-factor than with config?
I appreciate any help
A third way to do this with no client specific app configuration is to make an api call to get back your client specific theme, and then set the flutter theme based on this.
If you need web support see below:
First update your assets in index.html that aren't white labeled, leaving stubs in their place that we'll fill in later. i.e.
Next show a nice loading indicator while flutter loads. To do this, just put the html for it in the body element of the index.html file.
Finally update the webpage title and favicon using javascript inside Flutter. I used package
universal_html: 2.0.8
https://pub.dev/packages/universal_html
then you can update the favicon
import 'package:universal_html/html.dart';
var favicon = document.getElementById('favicon');
favicon?.setAttribute('href','insertLinkToYourImage');
Updating the title can be accomplished in various normal ways like just setting the title attribute of a MaterialApp widget.

how to build multiple apps with slightly different UI from one project in flutter

My query is how can we build multiple apps with different UI's from one project.
Example:
HomePage has (home1, home2, home3) 3 different Ui's , i want to add home1 for one app, home2 for other app and so on.
So that i can create similar apps with slightly different UI.
How can we configure the same in flutter?
Any help would be appreciated.
You can use flavors for it. In few words, you should create a project with common features and separate it by packages (because Google Play doesn't support apps with the same package name). Your features and different screens (and icons and other app specific resources) separated in flavors, and when you build specific flavor - you build separated app (in your case). In code you can split features by flavor type (find more in this question).

Flutter: Is flavor the best way to make multiple apps with the same codebase?

I'm going to make 10-50 different apps with the same codebase. So I'll probably have to use flavors. But is there a simpler way?
The only thing that's going to be different in the apps is the title, logo, maybe background, MP3 files and some text in the apps. Everything else will be the same.
What's the most straightforward way to do this? Can someone send some ressources I can learn from?
In my experience, I wrote multiple main.dart files. instead of having one lib/main.dart, we can have more e.g lib/main-us.dart, lib/main-uk.dart, lib/main-ge.dart.
in those files, we can put some parameters within MyApp using either Dependency Injection or Inherited Widget, therefore all children widgets can display correspondingly to its flavor
YES!
you can have :
Multiple configs so you can have some of this in flutter code base. [ apiBaseUrl , OnseSignalId , etc..
Flavors in both platform so you can have multiple apps ( applciation id in android and bundle id in ios ) and multiple folder for resources like Google-Service.json...

Simplest Way To Create Custom Builds of the Same App, Different Assets

I'm building an iPhone app that will be branded for several different companies. Each company will get their own app. The code base is the same. Really, the only thing that will be different between them are the app name, app icon, default image, and a few images used inside the app. Is there a best practice to automate this? I am pursuing scripting everything and have some preliminary scripts somewhat working, but it occurred to me there may be a simpler way with Xcode 4.
Any suggestions?
Thanks.
You'll need to create a new workspace and add a new project for every own app. You won't need to create all classes for every project. Just create a "core" project with your code base and add his files by reference to the custom projects.
i have same scenario , in which we maintain a global-config File which contain all UI Elements like NavBar , Buttons everything , as we have same layout for all clients , so we maintain a same layout with different color Theme the client choose,.
so for distribution , we change the settings in global file , then add the Client Provision ,& will send for review.
Hope this Helps