krokyze / flutter_seo

Flutter package for SEO support on Web.
MIT License
48 stars 5 forks source link

Cross platform use #28

Closed polarby closed 1 year ago

polarby commented 1 year ago

This may not only be plugin related, but having a cross platform app (android, iOS, and web) importing this plugin is impossible, as html plugin is not supported on mobile.

@krokyze Are there any options that you have come across to target such a situation? How to use SEO for web for an app targeted for more than just web?

krokyze commented 1 year ago

There shouldn't be any issues with cross platform as long as you import only import 'package:seo/seo.dart'; as you can see https://github.com/krokyze/flutter_seo/blob/main/lib/seo.dart it does have different imports for specific plaforms.

polarby commented 1 year ago

True that works! Great thanks!

It's weird though that the other paths are exposed for client import. Is that on purpose? When auto-importing (via android studio) it will NOT import seo.dart but each file individually (import 'package:seo/html/seo_controller.dart') - in my case the html controller. Is it possible to exclusively force import package:seo/seo.dart and thus ensure proper platform selection?

krokyze commented 1 year ago

It's weird though that the other paths are exposed for client import. Is that on purpose? When auto-importing (via android studio) it will NOT import seo.dart but each file individually (import 'package:seo/html/seo_controller.dart') - in my case the html controller. Is it possible to exclusively force import package:seo/seo.dart and thus ensure proper platform selection?

As far as I know the only proper solution would be splitting up the library into mini libraries seo_web, seo_etc.. but for now I don't have time for that.

Happy to hear that it's working for you, if you experience any more issues feel free to reopen this issue.