parse-community / Parse-SDK-Flutter

The Dart/Flutter SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
575 stars 194 forks source link

Support `XFile` #989

Closed mbfakourii closed 7 months ago

mbfakourii commented 8 months ago

New Feature / Enhancement Checklist

Current Limitation

When we want to use the file both on the web and the normal file in the project, we face problems in Parse projects. For this reason, I suggest to merge ParseWebFile and ParseFile together.

Feature / Enhancement Description

I suggest using XFile to solve this problem. With this function, we support both normal File and Uint8List.

Example Use Case

n/a

Alternatives / Workarounds

There is no use of both types of files in Parse when we register the file.

parse-github-assistant[bot] commented 8 months ago

Thanks for opening this issue!

mtrezza commented 8 months ago

Does this SDK already have a ParseFile class like other Parse SDKs, and if yes, will it be replaced by ParseXFile?

mbfakourii commented 8 months ago

Does this SDK already have a ParseFile class like other Parse SDKs, and if yes, will it be replaced by ParseXFile?

In Parse SDK Flutter, we use two types of ParseWebFile to support Flutter Web and ParseFile for other platforms.

In large projects that require the output of all platforms from Flutter, including the web, it is necessary to use both ParseWebFile and ParseFile. This is where we run into conflict problems. XFile is a type of file created by the Flutter team and tries to Solve the file problem in platforms and web. Therefore, I suggest that this item be added to Parse SDK Flutter.

Your suggestion for replaced with ParseFile is also very good, but it is better for ParseXFile to be tested and evaluated more and in the future to be merged with ParseFile with a breaking change.

mtrezza commented 8 months ago

So there will be a ParseFile, ParseWebFile, ParseXFile for now, and in the future ParseWebFile and ParseXFile will be merged into ParseFile? Sounds like a good plan.

mbfakourii commented 8 months ago

So there will be a ParseFile, ParseWebFile, ParseXFile for now, and in the future ParseWebFile and ParseXFile will be merged into ParseFile? Sounds like a good plan.

Yes, this is the best plan.