Skip to content

Conversation

@DanTup
Copy link
Contributor

@DanTup DanTup commented Nov 8, 2023

For each unique platform type in the set of unsupported devices, this adds a new row ("Enable web for this project"). Clicking it triggers the same flow as VS Code (which currently involves a toast in the corner to confirm we can run flutter create).

In future we might want to change this prompt to be in the sidebar (so it's less likely you'll miss it).

Related PR for Dart-Code is at Dart-Code/Dart-Code#4831

See Dart-Code/Dart-Code#4820
See #6563

enable-platform-type.mp4

@DanTup DanTup force-pushed the add-sidebar-platform-enablers branch 2 times, most recently from c6a9a36 to f053298 Compare November 9, 2023 11:21
…sidebar

For each unique platform type in the set of unsupported devices, this adds a new row ("Enable web for this project"). Clicking it triggers the same flow as VS Code (which currently involves a toast in the corner to confirm we can run `flutter create`).

In future we might want to change this prompt to be in the sidebar (so it's less likely you'll miss it).

Related PR for Dart-Code is at Dart-Code/Dart-Code#4831

See Dart-Code/Dart-Code#4820
See flutter#6563
@DanTup DanTup force-pushed the add-sidebar-platform-enablers branch from f053298 to 4762233 Compare November 9, 2023 12:32
@DanTup DanTup marked this pull request as ready for review November 9, 2023 14:07
@DanTup DanTup requested a review from a team as a code owner November 9, 2023 14:07
@DanTup DanTup requested review from bkonyi and removed request for a team November 9, 2023 14:07

/// Analytics event that is sent when a platform type is selected to be enable
/// from the list of devices in the sidebar.
enablePlatformType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we record the platform type that is enabled here?
String enablePlatformType(String platformType) => 'enablePlatformType-$platformType';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Comment on lines 27 to +28
final List<VsCodeDevice> devices;
final List<VsCodeDevice> unsupportedDevices;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: what about a single list of devices with a boolean field 'supported' so that we don't have to maintain two lists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be slightly more complicated because we'd need DevTools to tell VS Code that it knows to check the flag (otherwise, new VS Code would include unsupported devices to old DevTools, and users would see "broken" devices in the list because the old Sidebar didn't filter them out).

We don't currently have capabilities in this direction (for VS Code to know what DevTools supports), but adding support for it might not be a bad idea (we're probably going to want it in future for other things).

(we could also base it on an SDK version number, but that's a little more awkward because we'd have to land the DevTools changes before we have a version number to code into VS Code)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Keeping two lists sgtm then.

@DanTup DanTup merged commit 27e55f7 into flutter:master Nov 14, 2023
@DanTup DanTup deleted the add-sidebar-platform-enablers branch November 14, 2023 09:53
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

Successfully merging this pull request may close these issues.

2 participants