-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Reduce friction encountered when adding Flutter to existing apps #14821
Comments
Hello, Any news about the documentation explaining how to embed flutter views in native apps ? Thank you very much. |
Sorry, no, not yet |
@mit-mit My scenario is a variation of the above, aimed at enterprise apps that use .NET (Core): I would like to evaluate whether Flutter can be combined with 'classic' Xamarin.iOS and Xamarin.Android. Flutter would be used for the UI layer (screens including image resources + navigation); Xamarin for logic, models and services. This could be a more productive alternative to Xamarin Forms. This should be possible; Flutter can be embedded as a native iOS/Android component and Xamarin can interop with such components through bindings. Would the Flutter team consider this use case relevant? In case anyone would like to give feedback (much appreciated!), this is my idea: Create a single UI component in Flutter, containing all screens, static image resources, navigation and design data for an app. This component is developed and tested with high productivity in standard Flutter toolchain; and then embedded in the Xamarin apps. The complete app build & publishing would be with Xamarin toolchain. |
@VincentH-Net Please file a extra ticket for Xamarin interop. This issue is about integrating Flutter in an native iOS/Android app. |
I would like to know how to embed Flutter into a native Android project. Do I have to create a Flutter project within the Android project folder and then bind everything ? Or do I have to create a Flutter project, change the android folder with my Android project folder and then bind everything ? Thank you |
goes as well for adding flutter lib project to existing flutter app |
#15556 I hava an app which most pages written by native code. Now I want to integrate flutter, in order to write new pages. I have read flutter doc, for example:
this activity run with many thanks. |
I think you should in your native side keep only one FlutterActivity and send for example a string that correspond to the name of the view that you want to display to your main.dart using the channel. In the flutter side I think you should implement Routes first and then get the string and use a switch to push the view that corresponds to the string. |
I have been implementing flutter into my existing android project and am having an issue with FlutterActivity crashing in onCreate.
This seems similar if not the same to #14423 but I was unsure on the fix. Any help would be greatly appreciated. |
Could you provide us a plug-in on android studio, to let us simply integration flutter into exist android project. @mit-mit |
Still there is no explanation how to integrate in an existing iOS or Android project... Do you need a new Flutter project and move existing iOS project swift files into the iOS folder and build from Flutter? We have a big app and want to start with Flutter in that existing app or the best solution is to start over and create a brand new version 100% Flutter project |
I have a similar case as @FredvanRijswijk. With a large project with multiple contributors, it is a big hassle to change the project structure. Is there a possibility to specify somewhere (e.g. Currently, the alternative is (at least for Android) to move all the files to |
We are currently experimenting with approaches that would invert that dependency, so that your existing project would include the Flutter project in some form (say, as an Android Activity). We're writing up our experiments and findings as we go along. I'll provide a link here once we have a draft wiki page. |
@mravn-google Nice |
/cc @floitschG |
Thanks @mravn-google. I've already tried to integrate your solution (with small modifications, had to add |
I am trying to integrate flutter module inside existing iOS and Android app. For the Android, it is working fine. I am following steps from https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps. But for iOS app When I try to push FlutterViewController I get the following error. Logs
Following is the code that I am using to push flutter view controller
an output of running
Please let me know If I am missing anything. And also please update the doc for integrating flutter into existing I have also created an issue for this #20777 . |
I'm going to close this ticket because it doesn't have a clear delivery artifact. For bugs and feature requests related to adding Flutter to an existing Android or iOS app, please file bugs against the following project: Also, if any comments in this thread require their own issues, please file those against the above project as well. |
@tomaszpolanski could you share the experience for how to uses the "Flutter driver" to test the hybrid app? |
@Wanghuayin I don't want to spam this issue. Just find me on twitter and I will be happy to share |
Hello, Can I use google map in IOS? Now I just can be able to use it on Android App |
@matthew-carroll For example, the goods list of the native page jumps to the goods details of Flutter, and the goodsID is the parameter that the page needs to load the data. Unfortunately, the Flutter page does not have this parameter when it is render. Should I wait for a channelMessage (include a goodsID) from my native page? This seems unreasonable Can can help me? |
@walterFeng you could just add the Id in the route name, just like a get parameter in a URL? E.g. "/goods/(Id)" or "/goods?id=(id)". |
@jonasbark It works for me, thank you |
Add Flutter to existing apps is an awesome resource. When invoking Flutter from within iOS/Android, what is the best way to send data to the Flutter world and then get something back once the Flutter view is dismissed? I don't see any arguments or return values to/from Writing custom platform-specific code would do it, but that seems relatively cumbersome. We would have to write a bunch of asynchronous messages between the two worlds, including verifications that the data is ready for the Flutter or native views before they're shown. |
@pejalo would you mind filing a dedicated ticket for your use-case? Then we can address your use-case, specifically. In that ticket, please provide any surrounding details about why you need those particular signals so that we can factor that information into any API changes. |
@matthew-carroll thanks for your response! I just created this ticket: #24080 |
can you provide whole example, please? :) |
Is there a way to get it to work with 'normal' emulator as well, or do you have to use the slow emulators? tanks |
Does this work in iOS? It was not working for me... |
hi @jonasbark could you please share the any code to implement it for iOS. I have no idea how to open different flutter pages with some parameter in existing iOS app. I can able to open flutter page, but donot know to open different pages on the basis of app requirements. |
Hi |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Flutter's templates, tooling, and runtime are currently primarily optimized for the use case of creating a new mobile application from scratch. However, several developers have expressed an interest in making it easier to add one or more Flutter "screens" to existing Android and iOS apps.
The present bug tracks reduction of general friction developers encounter when trying to accomplish this integration of Flutter into existing apps.
The detailed work for this effort is tracked in a number of more detailed issues:
https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+label%3A%22a%3A+existing-apps%22
The initial documentation for the preview support is available on our Wiki:
https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps
The text was updated successfully, but these errors were encountered: