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

Support inlining Android/iOS views #19030

Open
amirh opened this Issue Jul 3, 2018 · 36 comments

Comments

Projects
None yet
@amirh
Contributor

amirh commented Jul 3, 2018

A generic solution for embedding any Android/iOS view as part of the Flutter widget hierarchy would enable some highly desired features including Google Maps (#73) and WebView (#730).

@rolurq

This comment has been minimized.

Show comment
Hide comment
@rolurq

rolurq Jul 9, 2018

Also on this matter, this would be useful when embedding camera stream in an application.

rolurq commented Jul 9, 2018

Also on this matter, this would be useful when embedding camera stream in an application.

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Jul 9, 2018

Contributor

For a camera stream you probably want to use a Texture widget directly.
The camera plugin is doing that for the device's cameras: https://pub.dartlang.org/packages/camera

Contributor

amirh commented Jul 9, 2018

For a camera stream you probably want to use a Texture widget directly.
The camera plugin is doing that for the device's cameras: https://pub.dartlang.org/packages/camera

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 11, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to amirh/engine that referenced this issue Jul 13, 2018

Implement PlatformViewsController.
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030

amirh added a commit to flutter/engine that referenced this issue Jul 13, 2018

Implement PlatformViewsController. (#5722)
Each platform view created (by a plugin supplied factory) is attached to
a virtual display.
The virtual displays are controlled by VirtualDisplayController objects.
The PlatformViewsController maintains a mapping from a platform view's
id to its VirtualDisplayController, which allows it to operate on the
virtual display for a given platform view ID when asked so over the
method channel.

This is using API level 20 APIs, on lower API levels all platform views
method channel calls are noops.
We can make this work on API 19 with some refactoring to the
TextureRegistry (allow the engine Java code to recycle a texture entry
id).

This CL also adds a platform view id parameter to the
PlatformViewFactory#create() method. This allows plugins to route
platform channel messages to specific instances of a platform view.

TBD in future CLs:
  * Forward touch events to the platform views.
  * Support accessibility for platform views.

flutter/flutter#19030
@benbucksch

This comment has been minimized.

Show comment
Hide comment
@benbucksch

benbucksch Jul 20, 2018

Do you guys need help here, in development?

benbucksch commented Jul 20, 2018

Do you guys need help here, in development?

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Jul 20, 2018

Contributor

@benbucksch contributions are welcomed, here are 2 issues you can look at: #19417 #19418.

Thanks!

Contributor

amirh commented Jul 20, 2018

@benbucksch contributions are welcomed, here are 2 issues you can look at: #19417 #19418.

Thanks!

@yohom

This comment has been minimized.

Show comment
Hide comment
@yohom

yohom Jul 28, 2018

So far I've only found AndroidView, is there an IOSView? Thanks. @amirh

yohom commented Jul 28, 2018

So far I've only found AndroidView, is there an IOSView? Thanks. @amirh

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Jul 28, 2018

Contributor

@yohom this is still work in progress, I started with the Android support.
I wouldn't even use AndroidView yet as it is incomplete and unstable.

Contributor

amirh commented Jul 28, 2018

@yohom this is still work in progress, I started with the Android support.
I wouldn't even use AndroidView yet as it is incomplete and unstable.

@morad00

This comment has been minimized.

Show comment
Hide comment
@morad00

morad00 Jul 31, 2018

Looks good! hope much support from flutter team

morad00 commented Jul 31, 2018

Looks good! hope much support from flutter team

@newbie-gk

This comment has been minimized.

Show comment
Hide comment
@newbie-gk

newbie-gk Aug 9, 2018

Would absolutely love this feature :)
Any plans on when will this be available?

newbie-gk commented Aug 9, 2018

Would absolutely love this feature :)
Any plans on when will this be available?

@tiagofalves

This comment has been minimized.

Show comment
Hide comment
@tiagofalves

tiagofalves Aug 9, 2018

Hi @amirh, first of all, a big thank you. If you need help with testing the features i can help.

tiagofalves commented Aug 9, 2018

Hi @amirh, first of all, a big thank you. If you need help with testing the features i can help.

@Hixie Hixie added this to the bucket10 milestone Aug 21, 2018

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Aug 27, 2018

Contributor

Basic support for embedding Android views has landed in master, the API shouldn't be considered stable yet.
There are still open issues, notably no keyboard support(#19718).

Note that Flutter widgets should be preferred over embedded Android views when possible.

Contributor

amirh commented Aug 27, 2018

Basic support for embedding Android views has landed in master, the API shouldn't be considered stable yet.
There are still open issues, notably no keyboard support(#19718).

Note that Flutter widgets should be preferred over embedded Android views when possible.

@levrik

This comment has been minimized.

Show comment
Hide comment
@levrik

levrik Aug 28, 2018

Contributor

@amirh Where can I find documentation? I would like to play with it a bit.

Contributor

levrik commented Aug 28, 2018

@amirh Where can I find documentation? I would like to play with it a bit.

@amirh

This comment has been minimized.

Show comment
Hide comment
Contributor

amirh commented Aug 28, 2018

@rolurq

This comment has been minimized.

Show comment
Hide comment
@rolurq

rolurq Aug 28, 2018

@amirh Any report on iOS progress will be great

rolurq commented Aug 28, 2018

@amirh Any report on iOS progress will be great

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Aug 28, 2018

Contributor

We're working on it, don't have any time estimates...

Contributor

amirh commented Aug 28, 2018

We're working on it, don't have any time estimates...

@tiagofalves

This comment has been minimized.

Show comment
Hide comment
@tiagofalves

tiagofalves Aug 28, 2018

@amirh Any instructions on how to use this to actually display the inline map?

tiagofalves commented Aug 28, 2018

@amirh Any instructions on how to use this to actually display the inline map?

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Aug 28, 2018

Contributor

There's a PR up for review (flutter/plugins#743) that ports google_maps_flutter to use an embedded Android view.

All of this is very experimental at this stage.

Contributor

amirh commented Aug 28, 2018

There's a PR up for review (flutter/plugins#743) that ports google_maps_flutter to use an embedded Android view.

All of this is very experimental at this stage.

@yohom

This comment has been minimized.

Show comment
Hide comment
@yohom

yohom Aug 29, 2018

How to respond to events at the dart end, for example, with the zoom in and zoom out buttons in a MapView? I tried AndroidView with some MapView(native view) and it looks like a static image right now, unable to respond to native view events. @amirh

yohom commented Aug 29, 2018

How to respond to events at the dart end, for example, with the zoom in and zoom out buttons in a MapView? I tried AndroidView with some MapView(native view) and it looks like a static image right now, unable to respond to native view events. @amirh

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Aug 29, 2018

Contributor

Communication with the dart code can be done over method channels or message channels. You can check flutter/plugins#743 for an example.

Contributor

amirh commented Aug 29, 2018

Communication with the dart code can be done over method channels or message channels. You can check flutter/plugins#743 for an example.

@kbz066

This comment has been minimized.

Show comment
Hide comment
@kbz066

kbz066 Aug 31, 2018

To what extent? @amirh

kbz066 commented Aug 31, 2018

To what extent? @amirh

@amirh

This comment has been minimized.

Show comment
Hide comment
@amirh

amirh Aug 31, 2018

Contributor
Contributor

amirh commented Aug 31, 2018

@felangel

This comment has been minimized.

Show comment
Hide comment
@felangel

felangel Sep 8, 2018

For anyone who is looking for a simple example, I wrote a short article on how to use AndroidView at https://medium.com/@felangelov/flutter-platformview-how-to-create-flutter-widgets-from-native-views-366e378115b6

felangel commented Sep 8, 2018

For anyone who is looking for a simple example, I wrote a short article on how to use AndroidView at https://medium.com/@felangelov/flutter-platformview-how-to-create-flutter-widgets-from-native-views-366e378115b6

@romatroskin

This comment has been minimized.

Show comment
Hide comment
@romatroskin

romatroskin Sep 16, 2018

really waiting for this feature to inline YouTube player :)

romatroskin commented Sep 16, 2018

really waiting for this feature to inline YouTube player :)

@cosminstoinescu

This comment has been minimized.

Show comment
Hide comment
@cosminstoinescu

cosminstoinescu Sep 17, 2018

I want to use the inline map on an Android device(Samsung S4). Because my Google Play service is not up to date, on the screen appeared the Update button. When clicking it the following error is thrown:

W/GooglePlayServicesUtil( 8663): Google Play services out of date. Requires 12451000 but found 11975238
D/ViewRootImpl( 8663): ViewPostImeInputStage ACTION_DOWN
D/AndroidRuntime( 8663): Shutting down VM
E/AndroidRuntime( 8663): FATAL EXCEPTION: main
E/AndroidRuntime( 8663): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/AndroidRuntime( 8663): at android.app.ContextImpl.startActivity(ContextImpl.java:1610)
E/AndroidRuntime( 8663): at android.app.ContextImpl.startActivity(ContextImpl.java:1597)
E/AndroidRuntime( 8663): at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
E/AndroidRuntime( 8663): at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
E/AndroidRuntime( 8663): at com.google.android.gms.dynamic.zze.onClick(Unknown Source)
E/AndroidRuntime( 8663): at android.view.View.performClick(View.java:5197)
E/AndroidRuntime( 8663): at android.view.View$PerformClick.run(View.java:20926)
E/AndroidRuntime( 8663): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 8663): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 8663): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime( 8663): at android.app.ActivityThread.main(ActivityThread.java:5951)
E/AndroidRuntime( 8663): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8663): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 8663): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
E/AndroidRuntime( 8663): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

cosminstoinescu commented Sep 17, 2018

I want to use the inline map on an Android device(Samsung S4). Because my Google Play service is not up to date, on the screen appeared the Update button. When clicking it the following error is thrown:

W/GooglePlayServicesUtil( 8663): Google Play services out of date. Requires 12451000 but found 11975238
D/ViewRootImpl( 8663): ViewPostImeInputStage ACTION_DOWN
D/AndroidRuntime( 8663): Shutting down VM
E/AndroidRuntime( 8663): FATAL EXCEPTION: main
E/AndroidRuntime( 8663): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/AndroidRuntime( 8663): at android.app.ContextImpl.startActivity(ContextImpl.java:1610)
E/AndroidRuntime( 8663): at android.app.ContextImpl.startActivity(ContextImpl.java:1597)
E/AndroidRuntime( 8663): at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
E/AndroidRuntime( 8663): at android.content.ContextWrapper.startActivity(ContextWrapper.java:337)
E/AndroidRuntime( 8663): at com.google.android.gms.dynamic.zze.onClick(Unknown Source)
E/AndroidRuntime( 8663): at android.view.View.performClick(View.java:5197)
E/AndroidRuntime( 8663): at android.view.View$PerformClick.run(View.java:20926)
E/AndroidRuntime( 8663): at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 8663): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 8663): at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime( 8663): at android.app.ActivityThread.main(ActivityThread.java:5951)
E/AndroidRuntime( 8663): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 8663): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 8663): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
E/AndroidRuntime( 8663): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)

@v7lin

This comment has been minimized.

Show comment
Hide comment
@v7lin

v7lin Sep 29, 2018

I don't think this is a good solution.If you open 10 WebView, the memory will reach 1Gb.

v7lin commented Sep 29, 2018

I don't think this is a good solution.If you open 10 WebView, the memory will reach 1Gb.

@benbucksch

This comment has been minimized.

Show comment
Hide comment
@benbucksch

benbucksch Sep 29, 2018

@v7lin : If you know a better solution, please feel free to go ahead, file a new ticket, describe it there, and implement it yourself.

I think amirh deserves a lot of thanks for implementing this at all. And even for free.

benbucksch commented Sep 29, 2018

@v7lin : If you know a better solution, please feel free to go ahead, file a new ticket, describe it there, and implement it yourself.

I think amirh deserves a lot of thanks for implementing this at all. And even for free.

@v7lin

This comment has been minimized.

Show comment
Hide comment
@v7lin

v7lin Sep 29, 2018

@benbucksch Sorry! I'not good at english.
对于上述评论,我表示歉意,我并无指责之意,那是我用了翻译工具翻译的英文。事实上,我也一直在研究如何在Flutter里内联WebView,一个多月的时间内,尝试了很多方案,然而却无法解决WebView内存消耗问题。而且我很佩服 @amirh ,他居然能想到用 Presentation 和 Texture 解决视图内联功能。

translate.google.com

I apologize for the above comments. I have no blame. It is English that I translated using translation tools. In fact, I have been researching how to inline WebView in Flutter. I have tried many solutions in a month, but I can't solve the WebView memory consumption problem. And I admire @amirh, he can actually think of using the Presentation and Texture to solve the view inline function.

v7lin commented Sep 29, 2018

@benbucksch Sorry! I'not good at english.
对于上述评论,我表示歉意,我并无指责之意,那是我用了翻译工具翻译的英文。事实上,我也一直在研究如何在Flutter里内联WebView,一个多月的时间内,尝试了很多方案,然而却无法解决WebView内存消耗问题。而且我很佩服 @amirh ,他居然能想到用 Presentation 和 Texture 解决视图内联功能。

translate.google.com

I apologize for the above comments. I have no blame. It is English that I translated using translation tools. In fact, I have been researching how to inline WebView in Flutter. I have tried many solutions in a month, but I can't solve the WebView memory consumption problem. And I admire @amirh, he can actually think of using the Presentation and Texture to solve the view inline function.

@benbucksch

This comment has been minimized.

Show comment
Hide comment
@benbucksch

benbucksch commented Oct 1, 2018

@v7lin: Thanks :)

@JTorrus

This comment has been minimized.

Show comment
Hide comment
@JTorrus

JTorrus Oct 3, 2018

Is there any progress with Google Maps on iOs?

JTorrus commented Oct 3, 2018

Is there any progress with Google Maps on iOs?

@behinenet

This comment has been minimized.

Show comment
Hide comment
@behinenet

behinenet Oct 6, 2018

We all need Google Maps on iOs too, please consider

behinenet commented Oct 6, 2018

We all need Google Maps on iOs too, please consider

@phuongdt8x

This comment has been minimized.

Show comment
Hide comment
@phuongdt8x

phuongdt8x Oct 8, 2018

Thank for bring Google Map inline on Android. I'm waiting on iOS too for production application. Right now I still use old version of library to run-able Google Map on iOS, however it will be develop on two different branches. So is there any progress would be so great.

phuongdt8x commented Oct 8, 2018

Thank for bring Google Map inline on Android. I'm waiting on iOS too for production application. Right now I still use old version of library to run-able Google Map on iOS, however it will be develop on two different branches. So is there any progress would be so great.

@JTorrus

This comment has been minimized.

Show comment
Hide comment
@JTorrus

JTorrus Oct 8, 2018

I'm in a similar situation, I'm working on an app and it needs to display a Google Map on both platforms. I had to change a bit the structure and use another Maps library to make it work on iOs. I hope we have good news soon because I don't like the idea of using different libraries to accomplish this functionality.

JTorrus commented Oct 8, 2018

I'm in a similar situation, I'm working on an app and it needs to display a Google Map on both platforms. I had to change a bit the structure and use another Maps library to make it work on iOs. I hope we have good news soon because I don't like the idea of using different libraries to accomplish this functionality.

@Conghdos

This comment has been minimized.

Show comment
Hide comment
@Conghdos

Conghdos Oct 9, 2018

Tôi đang ở trong tình huống tương tự, tôi đang làm việc trên một ứng dụng và nó cần hiển thị Google Map trên cả hai nền tảng. Tôi đã phải thay đổi một chút cấu trúc và sử dụng một thư viện Maps khác để làm cho nó hoạt động trên iOs. Tôi hy vọng chúng tôi có tin tốt sớm vì tôi không thích ý tưởng sử dụng các thư viện khác nhau để thực hiện chức năng này.

@JTorrus
I also have the same problem as you.
Can you tell me the solution on your IOS?
Thank you!

Conghdos commented Oct 9, 2018

Tôi đang ở trong tình huống tương tự, tôi đang làm việc trên một ứng dụng và nó cần hiển thị Google Map trên cả hai nền tảng. Tôi đã phải thay đổi một chút cấu trúc và sử dụng một thư viện Maps khác để làm cho nó hoạt động trên iOs. Tôi hy vọng chúng tôi có tin tốt sớm vì tôi không thích ý tưởng sử dụng các thư viện khác nhau để thực hiện chức năng này.

@JTorrus
I also have the same problem as you.
Can you tell me the solution on your IOS?
Thank you!

@JTorrus

This comment has been minimized.

Show comment
Hide comment
@JTorrus

JTorrus Oct 9, 2018

Tôi đang ở trong tình huống tương tự, tôi đang làm việc trên một ứng dụng và nó cần hiển thị Google Map trên cả hai nền tảng. Tôi đã phải thay đổi một chút cấu trúc và sử dụng một thư viện Maps khác để làm cho nó hoạt động trên iOs. Tôi hy vọng chúng tôi có tin tốt sớm vì tôi không thích ý tưởng sử dụng các thư viện khác nhau để thực hiện chức năng này.

@JTorrus
I also have the same problem as you.
Can you tell me the solution on your IOS?
Thank you!

My app has a TabBar with two pages: One displays the Google Map and the other one displays a ListView. Google Maps for Flutter supports the Widget hierarchy so you can put it inside a Scaffold or whatever Widget you want.

For iOs I had to use Map_View, works Ok but does not respect the Widget hierarchy of Flutter. You have to call a function for displaying the map when an event happens (e.g. onTap parameter in a button). Then my decision was to delete the TabBar and show just a ListView with a FloatingActionButton that displays the map in fullscreen when pressed.

JTorrus commented Oct 9, 2018

Tôi đang ở trong tình huống tương tự, tôi đang làm việc trên một ứng dụng và nó cần hiển thị Google Map trên cả hai nền tảng. Tôi đã phải thay đổi một chút cấu trúc và sử dụng một thư viện Maps khác để làm cho nó hoạt động trên iOs. Tôi hy vọng chúng tôi có tin tốt sớm vì tôi không thích ý tưởng sử dụng các thư viện khác nhau để thực hiện chức năng này.

@JTorrus
I also have the same problem as you.
Can you tell me the solution on your IOS?
Thank you!

My app has a TabBar with two pages: One displays the Google Map and the other one displays a ListView. Google Maps for Flutter supports the Widget hierarchy so you can put it inside a Scaffold or whatever Widget you want.

For iOs I had to use Map_View, works Ok but does not respect the Widget hierarchy of Flutter. You have to call a function for displaying the map when an event happens (e.g. onTap parameter in a button). Then my decision was to delete the TabBar and show just a ListView with a FloatingActionButton that displays the map in fullscreen when pressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment