Launching lib/main.dart on macOS in debug mode...
Compiler message:
lib/pages/spaceDetails.dart:2:8: Error: Not found: 'dart:html'
import 'dart:html' as h;
--
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-desktop-embedding-dev/1c9d6108-e3e3-4edd-b5b8-0a9dfa9791c8%40googlegroups.com.
You can do that with conditional imports: https://dart.dev/guides/libraries/create-library-packages#conditionally-importing-and-exporting-library-files
On Wed, Mar 18, 2020 at 9:38 AM Tom Verbeek <techn...@gmail.com> wrote:
We are building cross-platform applications with Flutter. Is there a preferred way to keep a common code base for platform dependent code.--For instance we use dart:html for web specific code, but when compiling the code on macOS it fails with a lot of messages like
Launching lib/main.dart on macOS in debug mode...
Compiler message:
lib/pages/spaceDetails.dart:2:8: Error: Not found: 'dart:html'
import 'dart:html' as h;I understand that dart:html is not available on macOS but how do I maintain a common codebase?Are there ways to make import statements platform dependent?Thx,Tom.
You received this message because you are subscribed to the Google Groups "Desktop Embedding for Flutter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-desktop-embedding-dev+unsub...@googlegroups.com.