GM-Consult-Pty-Ltd / dictosaurus

Extensions on String that provides dictionary and thesaurus functions
Other
4 stars 0 forks source link

Not able to use dictosaurus library with Flutter #1

Closed Shuo-Li closed 1 year ago

Shuo-Li commented 1 year ago

I'm building an English learning app and I'm able to use oxford_dictionaries in a pure Dart project. However, when I try to do a "flutter pub get" this library in a Flutter project, I keep getting the following message:

" Because every version of flutter from sdk depends on collection 1.16.0 and dictosaurus >=0.0.23 depends on collection ^1.17.0, flutter from sdk is incompatible with dictosaurus >=0.0.23.

And because oxford_dictionaries >=1.0.0 depends on dictosaurus ^1.0.0, flutter from sdk is incompatible with oxford_dictionaries >=1.0.0.

So, because flutter_oxford_dict depends on both flutter from sdk and oxford_dictionaries ^1.0.0, version solving failed.

pub get failed (1; So, because flutter_oxford_dict depends on both flutter from sdk and oxford_dictionaries ^1.0.0, version solving failed.) "

I'm using Dart 2.18.6, Flutter 3.3.10.

It seems to me Flutter SDK uses "collection 1.16.0" but your dictosaurus library depends on "collection 1.17.0". Is it possible you could make your dictosaurus library use "collection 1.16.0" so your dictosaurus and oxford_dictionaries libraries are compatible with Flutter?

GerhardMalan commented 1 year ago

Hmmm, interesting. This library was built with the intention of using it in one of our Flutter apps, but so far it has only been tested in DART.

We are currently all taking a break till the end of January, after which we will be able to pick this up again. If it was just a case of changing it in the one library I'd do it, but I'm a bit reluctant to make a change if I don't have the time/resources to test it properly.

If that's time frame does not work for you then you might have to clone the library and its dependencies and work your way back to collection. It's a bit of a process because there's a few parent dependencies.

Gerhard

Shuo-Li commented 1 year ago

No problem and thanks for your quick reply! Upon further looking into the Oxford Dictionary API, I realize the API (not your library) has some issues, especially with verbal and non-verbal phrases. I've raised the issue to Oxford Dictionary team but haven't heard back from them. This issue is not Dart/Flutter related, but in case it might help you, here's the issue I raised with them:


Hi Oxford Dictionaries Team,

My name is Shuo Li. I'm developing an app to help Chinese and Latinos to master English. While trying your excellent dictionary API, I found out that certain phrases have English definitions but lack the translations of Chinese and Spanish.

For example, some common verbal phrases such as "break even", "take for granted", as well as common non-verbal phrases such as "on one's own", "a dime a dozen" etc. (source_lang="en-us"), have English definitions but have neither Chinese nor Spanish translations (target_lang_translate="zh" or "es").

However, other common verbal phrases such as "pick up", non-verbal phrases such as "under the weather", do have English, Chinese, and Spanish definitions and translations.

In addition, I also found some common phrases such as "so far so good" have British English definitions (source_lang="en-gb"), but don't have American English definitions (source_lang="en-us").

You have an excellent dictionary API. I think it could be better if you can make the definitions of common phrases available across the board.

By the way, the phrase "across the board" has English definitions, but no Chinese translation, and has only its example sentences translated into Spanish, but the definition of "across the board" hasn't yet been translated into Spanish.

Hopefully you will make the definitions of phrases more consistently available throughout all your product offerings.


Due to the API's problems with phrases and the fact I cannot customize Oxford Dictionary to suit my needs, I decide not to use its API and am looking for other dictionary sources.