Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package not working in Flutter Web (dart.io) #10

Closed
flokfp opened this issue Jun 24, 2020 · 2 comments
Closed

Package not working in Flutter Web (dart.io) #10

flokfp opened this issue Jun 24, 2020 · 2 comments

Comments

@flokfp
Copy link

flokfp commented Jun 24, 2020

Due to changes in the dart.io library, it is no longer supported in flutter web. (see https://api.flutter.dev/flutter/dart-io/dart-io-library.html)

view\app.dart (https://github.com/AndriousSolutions/mvc_application/blob/master/lib/src/view/app.dart) contains
import 'dart:io' show Platform;
This leads to an error when starting flutter web.

Please change the import/platform-checks to universal ones that work on all platforms.

see
https://pub.dev/packages/universal_platform
or
https://pub.dev/packages/universal_io

@Andrious
Copy link
Member

Excellent find!
I would hope the recent changes will now allow for starting flutter web.
Indeed, the latest release (v. 5.3.1) has replaced 'dart:io' with the package, universal_platform - a Web-safe Platform class.
You will find those changes now in the source code: app.dart

As an aside, please let me know how the MVC architecture works for you on the Web platform.
I simply haven't had the opportunity to develop a Web app to any real extent.

@flokfp
Copy link
Author

flokfp commented Jun 25, 2020

Will do, just trying the default counter app for now.

It starts in web now, thanks!

@flokfp flokfp closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants