faithoflifedev / google_vision_workspace

Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.
MIT License
20 stars 8 forks source link

Add support for Flutter Web (Feature Request) #25

Closed xSuperMu closed 1 month ago

xSuperMu commented 1 month ago

Is it possible to add support for Flutter Web?

faithoflifedev commented 1 month ago

Hi @xSuperMu,

Actually, the google_vision packages work fine with web projects even though pub.dev does not list the package as having web platform support. In fact the example code provided with the google_vision_flutter package was primarily tested in the browser.

The problem is that the 1.x versions of the packages have a dependency on the universal_io package which further has a dependency on dart:io. The universal_io README states it's "A cross-platform dart:io that works on all platforms, including browsers", but as mentioned having a dependency in your code for dart:io means that pub.dev will not list the package as web platform compliant.

Anyway, after seeing your note here, I reviewed the code in the google_vision packages to determine the real necessity of the universal_io package. Upon review I found that the use of universal_io was minimal and so I've published v2.0 of the packages, that show in pub.dev has having web platform compatibility.

xSuperMu commented 1 month ago

Many thanks @faithoflifedev