Coder Social home page Coder Social logo

Comments (12)

getBoolean avatar getBoolean commented on June 5, 2024 1

It also does this for files from Filza (jailbreak app).

from flutternativedraganddrop.

getBoolean avatar getBoolean commented on June 5, 2024 1

I'm curious what happens when text is disabled in this scenario

At least for images on web and files from Filza File Manager, when both URL and Text is disabled it sends as the image/file. If either url or text is enabled, it gets received as text

Edit: I've confirmed its the same for iMessage

We should be able to fix this by checking if its a URL second to last, then checking if its a plain text very last.

URL is also incorrectly given DropDataType.text instead of url

else if (d['url'] != null) {
  //add url
  var url = d['url'] as String;
  var dropData = DropData(type: DropDataType.text, dropText: url);
  dropDataList.add(dropData);
} 

Also, currently we are checking if text or url is allowed before performing the drop. We should not check that, we should only be checking for subtypes of files.

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

image

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

I think when a string is detected it should check if it starts with file:///var and then try and get the data from that file

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

Might need to check if a drop item is a uiimage to fix this https://www.appcoda.com/drag-and-drop/

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

I'm curious what happens when text is disabled in this scenario

from flutternativedraganddrop.

getBoolean avatar getBoolean commented on June 5, 2024

I think when a string is detected it should check if it starts with file:///var and then try and get the data from that file

I believe there is a file url UTI, maybe we can test if it is that type

from flutternativedraganddrop.

getBoolean avatar getBoolean commented on June 5, 2024

I'm curious what happens when text is disabled in this scenario

At least for images on web and files from Filza File Manager, when both URL and Text is disabled it sends as the image/file. If either url or text is enabled, it gets received as text

Edit: I've confirmed its the same for iMessage

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

@getBoolean I fixed setting the url dropdatatype to url and switched around the url and Plain text to be the last ones. regarding your last comment, why shouldn't we check for text or url? If they only allow text or url why wouldn't we check for that?

from flutternativedraganddrop.

getBoolean avatar getBoolean commented on June 5, 2024

@getBoolean I fixed setting the url dropdatatype to url and switched around the url and Plain text to be the last ones. regarding your last comment, why shouldn't we check for text or url? If they only allow text or url why wouldn't we check for that?

We already have the is allowed boolean flag so we don't need to check again. Having those additional checks will mean it will won't be received when receive non allowed items is enabled.

I don't like it being sent as a text or url based on the position of the if else, maybe we can find a better solution for that. (Of course that's only the case if urls count as text to iOS, which idk)

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

Right now having the file, then url, and then the text check has fixed the image issue completely

from flutternativedraganddrop.

alexrabin avatar alexrabin commented on June 5, 2024

I'll get rid of the shouldAllow text and urls

from flutternativedraganddrop.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.