1
votes

https://github.com/parse-community/Parse-SDK-Flutter

I am trying to use the parse-server Dart/Flutter SDK in DART. on the github page it literally says: 'A Dart or Flutter plugin for Parse Server... Enjoy!' \

When I try to import the dependency and run the simple snipped from the github page I am getting the following dependency error in vscode:

[test_parsie] pub get
Resolving dependencies...
Because every version of parse_server_sdk depends on flutter any from sdk which is forbidden, parse_server_sdk is forbidden.
So, because test_parsie depends on parse_server_sdk ^1.0.26, version solving failed.

I prefer not having my small cli DART program rely on flutter but if I have to... so tried the 'flutter pub get' instead of pub get which give me this error when i tried to run the simple code snippet:

/C:/src/flutter/packages/flutter/lib/src/services/binary_messenger.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/C:/src/flutter/packages/flutter/lib/src/services/binding.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/C:/src/flutter/packages/flutter/lib/src/services/font_loader.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui';
       ^
/C:/src/flutter/packages/flutter/lib/src/services/platform_messages.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui' as ui;
       ^
/C:/src/flutter/packages/flutter/lib/src/services/platform_views.dart:9:8: Error: Not found: 'dart:ui'
import 'dart:ui';
       ^

I spent a long time setting up the parse server (was new to the whole docker thing) and really bummed i can't use the SDK. I just want to know if it is or isn't possible to use this package in DART, and if so, what I am doing wrong, or that it is a bug?

2
The problem is that that package uses several flutter specific dependencies, like connectivity. Clone the source, remove those flutter specific dependencies and fix any resulting errors. (For example, there would presumably be no need for you to monitor connectivity when server-side, so just stub that code out.) The community might appreciate your contribution. Also, check out this pure Dart client: pub.dev/packages/flutter_parseRichard Heap

2 Answers

1
votes

We are working on dart support in the branch release/1.0.28. The dart package is located at packages/dart. Please create an issue if you run in problems.

0
votes

It is not possible to have an import to dart:ui and run with the dart command on the command line. The cli Dart VM does not contain any of the flutter or web specific SDK libraries, so those imports are disallowed even if at runtime you don't have any branches that would use that code.

If you want to use some code from a non-flutter app, you'll need to ask the author to refactor it into a separate library that does not import dart:ui.