Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.25 KB

File metadata and controls

47 lines (33 loc) · 1.25 KB

Conditional Imports for Web/Native APIs

Did you know?

If you try to access a web-specific API on native platforms, your app will crash. 💥

To prevent this, hide your API behind an "umbrella" file using conditional imports. ✅

Here's an example showing how to check if the app is using the CanvasKit renderer. 👇


Previous Next
Use defaultTargetPlatform and kIsWeb Find Unused Dart Files (VSCode Extension)