andyduke / styled_text_package

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.
https://pub.dev/packages/styled_text
BSD 3-Clause "New" or "Revised" License
75 stars 48 forks source link

Error: Member not found: 'MediaQuery.boldTextOf'. #73

Closed Abolfazl-MI closed 1 year ago

Abolfazl-MI commented 1 year ago

hello I just get started to use package I first add that to my project , then I apply tag on translation text which I take help from getx like this

class LanguageConstant {
  LanguageConstant._();
  static const String shareYourFelling = 'share_your_felling';
}

class LanguageController extends Translations {
  @override
  Map<String, Map<String, String>> get keys => {
        "fa-IR": {
          LanguageConstant.shareYourFelling:
              "احساسات خودت با <color>پارتنرت<color>به اشتراک بزار"
        },
        "en-US": {
          LanguageConstant.shareYourFelling:
              "Share your feeling with your <color>partner<color>"
        },
      };
}

then i come over to my ui and start using the widget as document say

StyledText(
              text: LanguageConstant.shareYourFelling.tr,
              tags: {
                'color': StyledTextTag(
                  style: AppTextStyle.kHeadlineLarge.copyWith(
                    fontSize: 21,
                    color: themeData.primaryColor,
                  ),
                )
              },
            )

when im running the app i got that error

Abolfazl-MI commented 1 year ago

since I add package I could not able to build project I keep getting this error even I didnt use the package widgets

andyduke commented 1 year ago

What version of Flutter are you using? Can you provide the output of the "flutter doctor -v" command?

Abolfazl-MI commented 1 year ago
╭─abolfazl@abolfazl ~ 
╰─$ flutter doctor -v                                                      64 ↵
[✓] Flutter (Channel stable, 3.7.8, on Ubuntu 22.04.2 LTS 5.19.0-50-generic,
    locale en_US.UTF-8)
    • Flutter version 3.7.8 on channel stable at
      /home/abolfazl/dev/flutter_linux_3.7.8-stable/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 90c64ed42b (4 months ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1
andyduke commented 1 year ago

You need to upgrade to Flutter version 3.10.

Abolfazl-MI commented 1 year ago

is there other way ? I had developed my project with this version

andyduke commented 1 year ago

Downgrade StyledText in pubspec.yaml to 7.0.0.