i'm starting a flutter project with target android/ios/web, is there a way to write same lib code for mobile and web platform ? Didn't found solution like conditional import or something like that.
In my project, i have created a file 'global_import.dart' with all imports specifics for web and mobile like this:
//mobile packages
/*
export 'package:flutter/material.dart';
*/
//web packages
///*
export 'package:flutter_web/material.dart';
//*/
Instead of import immediatly flutter or flutter_web packages in my widget files, i import this file and comment/uncomment mobile/web packages as needed.
I found only this solution at the moment, looking for better one.