Skip to content
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

Anyway to hook up platform detection to Android Studio's "Toggle Platform Mode" #19

Closed
firsthour opened this issue Dec 14, 2018 · 3 comments

Comments

@firsthour
Copy link

Android Studio has a button in the Flutter Inspector to toggle the platform between Android and iOS in the same emulator. Just seems to trigger a page rebuild which changes the result of Theme.of(context).platform between TargetPlatform.android and TargetPlatform.iOS.

It seems like your platform.dart triggers off a lower level check against sky_engine/lib/io/platform.dart's Platform. Between isAndroid and isIOS.

I know you have nice methods changeToMaterialPlatform and changeToCupertinoPlatform, but is there any way to tie the auto detection into the Theme's platform so that when I toggled the platform in Android Studio it also toggled the widgets provided by this package?

Thanks.

@aqwert
Copy link
Collaborator

aqwert commented Dec 15, 2018

Was thinking of having a Widget that can call the changeTo* depending on what the theme does. I will see what I can do in the next couple of days

@stefanrusek
Copy link
Contributor

My PR #76 fixes this.

@aqwert
Copy link
Collaborator

aqwert commented Oct 14, 2019

The changes to PlatformProvider should allow for this now

@aqwert aqwert closed this as completed Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants