flutter_tagging
flutter_tagging copied to clipboard
dynamic function cant be assigned to Widget functions
while deploying on android i get a gradle error
error:
../../.pub-cache/hosted/pub.dartlang.org/flutter_tagging-3.0.0/lib/src/tagging.dart:222:37: Error: The argument type 'dynamic Function(BuildContext, Widget, AnimationController?)?' can't be assigned to the parameter type 'Widget Function(BuildContext, Widget, AnimationController?)?'.
doctor:
Flutter (Channel stable, 2.2.0, on macOS 11.4 20F71 darwin-x64, locale it-IT) • Flutter version 2.2.0 at /Users/marco/fvm/versions/2.2.0 • Framework revision b22742018b (4 months ago), 2021-05-14 19:12:57 -0700 • Engine revision a9d88a4d18 • Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/marco/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.10.1
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] VS Code (version 1.60.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.24.0
Did you resolve this issue..?
I am facing this on iOS Build.
i just made a new pull request to solve this: https://github.com/sarbagyastha/flutter_tagging/pull/33 if it didn't got merged soon you could simply point to it in your pubspec file like this:
flutter_tagging:
git:
url: https://github.com/mejdi14/flutter_tagging
or do just modify the package by yourself like this: External libraries > flutter_tagging-3.0.0 > src > tagging.dart => replace dynamic by Widget in line 73
Thanks for this I am able to get rid of the error that I am facing..
@mejdi14 thanks man this worked
@mejdi14 I am getting this
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:flutter_tagging
- package:flutter_typeahead_web
@kamalbanga the package supports null safety, are you using the 3.0.0 versoin?
Yes, I was using 3.0.0
and was getting the transition builder error; then I tried your PR
flutter_tagging: ^3.0.0
git:
url: https://github.com/mejdi14/flutter_tagging
And I started getting this issue 👇🏽
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:flutter_tagging
- package:flutter_typeahead_web
It's quite confusing to me though, why I am getting this issue since yours is a PR on top of 3.0.0.
which supports null safety.
Yeah i just got the same problem now, that's weird, well you can try the second option in this case and update the library directly from your project till i can look into this
I am thinking of using the Autocomplete
widget introduced in Flutter 2.0. It's the typeahead
's alternative which package is used in this package. The whole tagging functionality will have to built on this and that's some work. The benefit could be desktop support.
One problem is its optionsBuilder
(findSuggestions
alternative) is sync and the usual real life use case is of course async.
@mejdi14 Hey, I just noticed that there is no commit in this repo for the null safety release as in the pub.dev. That must be the reason, we are facing the cannot run with sound null safety
issue.
I made https://github.com/bradintheusa/flutter_tagging with the above fix and merged in the null changes from pub.dev.
@mejdi14 and @bradintheusa great work! IOU1
@mejdi14 @bradintheusa Guys I created this standalone tagging field class. It doesn't depend on any library, just Flutter 2.0's RawAutoComplete
; it therefore would also work on desktop.
Link to TagField
gist


@mejdi14 thank you bro this worked perfectly
Thanks @mejdi14 and @bradintheusa. I used the following in my pubspec.yaml
to tag the specific commit I needed.
flutter_tagging:
git:
url: https://github.com/bradintheusa/flutter_tagging
ref: 6a7d9dea5fff4f7de6f2142c667de6e5d9e61cec
@mejdi14 Thanks you so much for your share, That's work for me
@mejdi14 or @bradintheusa, would it incur too much of a maintenance overhead to publish either of your versions as a new package (or create an org with a few maintainers)? This package no longer seems actively maintained. I'm willing to help out.
@mejdi14 or @bradintheusa, would it incur too much of a maintenance overhead to publish either of your versions as a new package (or create an org with a few maintainers)? This package no longer seems actively maintained. I'm willing to help out.
Yeah. I can do that. I should be able to do it today or tomorrow.
It's live here: https://pub.dev/packages/flutter_tagging_plus
@bradintheusa that's awesome, well done