Fix exception when running on the web #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you run the
![image](https://private-user-images.githubusercontent.com/1719665/297147559-b6447b3f-8e98-4136-a593-3daf58cc5710.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyOTYxMDIsIm5iZiI6MTczOTI5NTgwMiwicGF0aCI6Ii8xNzE5NjY1LzI5NzE0NzU1OS1iNjQ0N2IzZi04ZTk4LTQxMzYtYTU5My0zZGFmNThjYzU3MTAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMTc0MzIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDQ0MDMzYWE3M2QyN2U2MDRiNDNmMmE0NzA2ZjFkZjY3YmY5MTRmNzg0YTI2NThhZTkxNDk1Yzc1N2Y1ZDBlOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.89oR9DxH6Bf3n6iLcSKF_XJPdVgVo57d6lwoExutTeM)
example/lib/main.dart
on the web, you get:This is due to
drag_target.dart
blindly checking thePlatform
, which doesn't work on web. This PR fixes the issue by checking forkIsWeb
first.