flutter-webrtc / dart-sip-ua

A dart-lang version of the SIP UA stack.
MIT License
338 stars 261 forks source link

The getter 'this' isn't defined for the class 'AnsiColor'. #347

Closed abdulhannan123 closed 1 year ago

abdulhannan123 commented 1 year ago

Hi, I am trying to run the example code, but I am unable to run it as it throws the following error:

Error /C:/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sip_ua-0.5.4/lib/src/logger.dart:133:16: Error: The getter 'this' isn't defined for the class 'AnsiColor'.

Any help will be appreciated.

Version Infomation Flutter version: 3.0.5 Dart SDK version: 2.17.6

DimaKuznietsov commented 1 year ago

Got same issue

`../../../.pub-cache/hosted/pub.dartlang.org/sip_ua-0.5.5/lib/src/logger.dart:133:16: Error: The getter 'this' isn't defined for the class 'AnsiColor'.

DimaKuznietsov commented 1 year ago

Does someone find solution?

FeleConvo commented 1 year ago

@Perondas This was introduced here: https://github.com/flutter-webrtc/dart-sip-ua/commit/88b83170bec550c4d6326dcb7fce24554751965a#diff-91837690ce0e2d558853d09d7cde1f9648cca326751fe2c437789882c0acfb67R133

Perondas commented 1 year ago

Oh, thanks @FeleConvo. Seems that that flew under the radar. Ill fix it it soon and push out a hotfix

Perondas commented 1 year ago

After some testing it seems that this is a issue that only occurs on older versions of flutter. On any more recent version (i tested with 3.5.0) this code compile just fine, as it should. For some reason the older versions fail to correctly compile the interpolated string. Interpolation is however the preferred way to construct such strings. Therefore this is not an issue with dart-sip-ua.