easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

A member named 'tr' is defined in extensions

Open JAICHANGPARK opened this issue 4 years ago • 8 comments

https://dart.dev/tools/diagnostic-messages#ambiguous_extension_member_access

JAICHANGPARK avatar Sep 06 '21 01:09 JAICHANGPARK

A member named 'tr' is defined in extensions 'StringTranslateExtension' and 'Trans', and none are more specific. (Documentation)

JAICHANGPARK avatar Sep 06 '21 02:09 JAICHANGPARK

I think it conflict with get x package

JAICHANGPARK avatar Sep 06 '21 02:09 JAICHANGPARK

Yep, i had the same issue. Fixed with this code. Basically, you need to hide the Trans extension in GetX

import 'package:get/get.dart' hide Trans;

weichaist avatar Nov 07 '21 13:11 weichaist

@weichaist You saved my life. Greatly appreciate.

actumn avatar Dec 04 '21 15:12 actumn

it doesn't work to me :(

umitmutluu avatar Feb 16 '22 20:02 umitmutluu

@weichaist you just saved the day!! @umitmutluu did you try with "your text".tr()? & import 'package:easy_localization/easy_localization.dart';?

taqi92 avatar Mar 28 '22 17:03 taqi92

it doesn't work to me :(

if you imported 'package:get/get.dart' hide Trans; & 'package:get/get.dart'; together its not working. Try with only

import 'package:get/get.dart' hide Trans;

ataknakbulut avatar Apr 16 '22 17:04 ataknakbulut

Yep, I had the same issue. Fixed with this code. Basically, you need to hide the Trans extension in GetX

import 'package:get/get.dart' hide Trans;

really appreciated

sohaibjameelkhan avatar Aug 24 '22 15:08 sohaibjameelkhan

Still not working in any sence

JabbarKakar avatar Jan 25 '23 12:01 JabbarKakar

use import 'package:easy_localization/easy_localization.dart' hide StringTranslateExtension;

asimolpiq avatar Mar 03 '23 20:03 asimolpiq

solved by @weichaist

bw-flagship avatar May 14 '23 11:05 bw-flagship