fayeed / flutter_mentions

A simple flutter input widget to add @ mentions functionality to your app
MIT License
107 stars 122 forks source link

AnnotationEditingController crash when upgrade to flutter 2 #44

Closed letungcntt closed 3 years ago

letungcntt commented 3 years ago

I can't build my app because this error : ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mentions-2.0.0-nullsafety/lib/src/annotation_editing_controller.dart:58:12: Error: The method 'AnnotationEditingController.buildTextSpan' has fewer named arguments than those of overridden method 'TextEditingController.buildTextSpan'. TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) { ^ ../../flutter/packages/flutter/lib/src/widgets/editable_text.dart:192:12: Context: This is the overridden method ('buildTextSpan'). TextSpan buildTextSpan({required BuildContext context, TextStyle? style , required bool withComposing}) { ^ ../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mentions-2.0.0-nullsafety/lib/src/annotation_editing_controller.dart:58:12: Error: The method 'AnnotationEditingController.buildTextSpan' doesn't have the named parameter 'context' of overridden method 'TextEditingController.buildTextSpan'. TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) { ^ ../../flutter/packages/flutter/lib/src/widgets/editable_text.dart:192:12: Context: This is the overridden method ('buildTextSpan'). TextSpan buildTextSpan({required BuildContext context, TextStyle? style , required bool withComposing}) {

loic-hamdi commented 3 years ago

@letungcntt Having the same issue, did you find a solution ?

letungcntt commented 3 years ago

yes, t have a solution but you need fork this Project because, if upgrade to flutter channel Master, buildTextSpan(context, a, b) but with global buildTextSpan(a, b)

loic-hamdi commented 3 years ago

yes, t have a solution but you need fork this Project

Sure, please let me know what to change in the fork!

letungcntt commented 3 years ago

yes, t have a solution but you need fork this Project

Sure, please let me know what to change in the fork!

pls check

loic-hamdi commented 3 years ago

yes, t have a solution but you need fork this Project because, if upgrade to flutter channel Master, buildTextSpan(context, a, b) but with master buildTextSpan(a, b)

I will try that Thank you for your help and reactivity!

loic-hamdi commented 3 years ago

yes, t have a solution but you need fork this Project because, if upgrade to flutter channel Master, buildTextSpan(context, a, b) but with global buildTextSpan(a, b)

In flutter_mentions: ^2.0.0-nullsafety

In annotation_editing_controller.dart I already have :

TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) {...}

I see in your fork that you also have kep the same code https://github.com/letungcntt/flutter_mentions/blob/master/lib/src/annotation_editing_controller.dart

Did you stay on flutter channel master ?

letungcntt commented 3 years ago

yes, t have a solution but you need fork this Project because, if upgrade to flutter channel Master, buildTextSpan(context, a, b) but with global buildTextSpan(a, b)

In flutter_mentions: ^2.0.0-nullsafety

In annotation_editing_controller.dart I already have :

TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) {...}

I see in your fork that you also have kep the same code https://github.com/letungcntt/flutter_mentions/blob/master/lib/src/annotation_editing_controller.dart

Did you stay on flutter channel master ? yes, i'm using channel master

loic-hamdi commented 3 years ago

@letungcntt

On channel master, is it correct to have TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) {...} ?

letungcntt commented 3 years ago

@zzterrozz on channel master they using TextSpan buildTextSpan({required BuildContext context, TextStyle? style , required bool withComposing}) {...} but pub-get with stable and using TextSpan buildTextSpan({TextStyle? style, bool? withComposing}) {...}

loic-hamdi commented 3 years ago

@letungcntt I just switched back to flutter channel stable to fix it for the moment Thank you for your help

gadearaujo commented 3 years ago

flutter channel stable

Unfortunately it didn't work for me, any other suggestions?

letungcntt commented 3 years ago

flutter channel stable

Unfortunately it didn't work for me, any other suggestions?

Stable version ?