Flutter conditionnal import mobile vs desktop

Viewed 561

Importing on web vs native is easy

import '../wrappers/platform/platform_none.dart'
    if (dart.library.io) '../wrappers/platform/platform_io.dart'
    if (dart.library.js) '../wrappers/platform/platform_web.dart';

What if I want to import a different package depending on whether I am on mobile (iOS/Android) vs on desktop (Linux/MacOS/Windows)?

If there is no way with conditional import, how can you achieve that any other way?

1 Answers
Related