flutter_glove_box icon indicating copy to clipboard operation
flutter_glove_box copied to clipboard

Introduce support for `TargetPlatform`

Open jogboms opened this issue 1 year ago • 6 comments

Description

Introduce support for overriding TargetPlatform using the debugDefaultTargetPlatformOverride.

Proposal

Introduce a non-required platform(TargetPlatform) property in Device.

jogboms avatar Jul 29 '22 08:07 jogboms

IGNORE THIS MESSAGE ... I misunderstood the original one

~~I wonder if the "platform" should just be part of Device ?~~

~~https://github.com/eBay/flutter_glove_box/blob/master/packages/golden_toolkit/lib/src/device.dart~~

~~i.e. when you say on which device you want to run your test, that device might be a iOS or Android device, and therefore we want the app to behave accordingly ?~~

tsimbalar avatar Aug 01 '22 06:08 tsimbalar

@tsimbalar if I understand you correctly, we are indeed saying the same thing right?

jogboms avatar Aug 01 '22 07:08 jogboms

@jogboms oh, my bad I didn't read properly the second part of the message ... I went too fast 🏃 . Yes we are saying the same thing ... will update (or delete?) my comment

tsimbalar avatar Aug 01 '22 07:08 tsimbalar

@jogboms can you elaborate more on your expected/desired behavior?

I believe we could make something like this work for multiScreenGolden, but I don't think it's possible for some of the APIs, such as deviceBuilder.

coreysprague avatar Aug 23 '22 15:08 coreysprague

Hey @coreysprague

Sorry for the delay, missed the notification.

Indeed, it would be more appropriate with the multiScreenGolden API

jogboms avatar Aug 31 '22 13:08 jogboms

I would like to use this feature to generate screenshots for the app store. In the current release (0.15.0) every screenshot uses the Android platform adaptations in a MaterialApp. I would like some Devices to use the iOS platform adaptations instead (BackButton has a different icon, and AppBar puts the label in the centre of the screen rather than aligning to the left).

This would be used with the multiScreenGolden function.

A new TargetPlatform platform parameter on Device sounds ideal.

maBarabas avatar Jun 27 '23 15:06 maBarabas