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
74 stars 48 forks source link

Still having build problem with version 3.0.0 #33

Closed higorlapacw closed 2 years ago

higorlapacw commented 3 years ago

The closed issues #32 #31 are still happing in pub.dev 3.0.0 version.

7:7: Error: The non-abstract class 'CustomStyle' is missing implementations for these members:
 - TextStyle.overflow
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class CustomStyle with Diagnosticable implements TextStyle {
      ^^^^^^^^^^^
andyduke commented 3 years ago

@higorlapacw Please show the output of the command flutter doctor -v

higorlapacw commented 3 years ago
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.0, on Mac OS X 10.15.4 19E266 darwin-x64, locale pt-BR)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.56.2)
[✓] Connected device (3 available)
andyduke commented 3 years ago

@higorlapacw I have not been able to reproduce this problem, please provide a minimum code that reproduces this problem.

aprimault commented 3 years ago

I have the same issue with the example code.

Launching lib/main.dart on iPad in debug mode... Automatically signing iOS for device deployment using specified development team in Xcode project: PLHZFY3YJD Running Xcode build... Xcode build done. 16.0s Failed to build iOS app Error output from Xcode build: ↳ BUILD FAILED

Xcode's output: ↳ ../../flutter/.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.0/lib/custom_style.dart:8:7: Error: The non-abstract class 'CustomStyle' is missing implementations for these members:

[✓] Flutter (Channel dev, 2.3.0-0.1.pre, on macOS 11.3 20E232 darwin-x64, locale en-FR)
    • Flutter version 2.3.0-0.1.pre at /Users/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d72bfb8d07 (4 weeks ago), 2021-04-26 06:05:55 -0700
    • Engine revision de6e1adf97
    • Dart version 2.14.0 (build 2.14.0-18.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/local/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/local/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5, Build version 12E262
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/local/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/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 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
    • IntelliJ at /Users/local/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • 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

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
    • IntelliJ at /Users/local/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/IntelliJ IDEA.app
    • Flutter plugin version 56.0.5
    • Dart plugin version 211.7233

[✓] Connected device (3 available)
    • iPad (mobile)   • 00008027-001448E62E40402E • ios            • iOS 14.4.2
    • macOS (desktop) • macos                     • darwin-x64     • macOS 11.3 20E232 darwin-x64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 90.0.4430.212

Widget rightPage = Container(
        child: Padding(
          padding: EdgeInsets.all(50.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              LimitedBox(
                child: StyledText(
                  text: 'Test: <bold>bold</bold> text.',
                  tags: {
                    'bold': StyledTextTag(style: TextStyle(fontWeight: FontWeight.bold)),
                  },
                )
              ),
            ],
          ),
        ));
andyduke commented 3 years ago

@aprimault Do you have the same problem in the stable version of Flutter 2.2.0?

andyduke commented 3 years ago

@higorlapacw @aprimault According to documentation and source code of stable Flutter version there is no overflow property in the TextStyle class. It is only available in the master channel. Use the stable version of Flutter, by the time the next stable version of Flutter is released - I will add support for all changes.

higorlapacw commented 3 years ago

Hi, @andyduke, as my flutter doctor answer shows, I am in the stable channel. I will try to get more info about this issue.

Channel stable

andyduke commented 3 years ago

@higorlapacw Please show the output of the extended "flutter doctor -v" command.

brunoPetrim commented 3 years ago

This error disturbed me for a few days, so I decided to fork it to solve this problem with the new version of the flutter: styled_text: git: url: https://github.com/brunoPetrim/styled_text_package.git ref: master path: styled_text

higorlapacw commented 3 years ago

@brunoPetrim, could you consider opening a PR, please?

andyduke commented 3 years ago

@brunoPetrim @higorlapacw I do not add support for this property until a stable version of Flutter is released with this property, so as not to break compatibility with the current stable version of Flutter.

rmtmckenzie commented 3 years ago

@andyduke Some people have to live on the dev/master/etc branches for other reasons. If @brunoPetrim would consider doing a PR, would you consider releasing the fix as a preview version (https://dart.dev/tools/pub/publishing#publishing-previews)?

That way when it hits stable, the preview version will automatically become the release version.

deepak786 commented 3 years ago

I also forked the repo and solved the issue for dev channel:

styled_text:
    git:
      url: https://github.com/deepak786/styled_text_package
      path: styled_text

But the better solution will be to delete the style classes such as custom_style.dart as it is already deprecated.

rodion-m commented 3 years ago

@andyduke Thanks for a great library, but now it's not working in beta channel too.

andyduke commented 3 years ago

@rodion-m The package only works with the stable version of Flutter. For the beta channel, use the forks given in the comments above.

rodion-m commented 3 years ago

@rodion-m The package only works with the stable version of Flutter. For the beta channel, use the forks given in the comments above.

Yes, but perhaps it costs to create a pre-release of this package to pub for beta and dev channel?

andyduke commented 3 years ago

@rodion-m I can't do two different pre-releases for the dev and beta channels.

deepak786 commented 2 years ago

@andyduke then please remove the classcustom_style.dart. This class is deprecated already in the package and this is the class that is conflicting between stable and other flutter channels.

andyduke commented 2 years ago

@deepak786 I am not removing this class yet, because it is possible that not all users have switched to the new version of the StyledText package yet.

deepak786 commented 2 years ago

So then they can use the older version of styled_package.

DenisGL commented 2 years ago

Hello, I have the same error:

Error: The non-abstract class 'CustomStyle' is missing implementations for these members:
 - TextStyle.overflow

after upgrading to Flutter 2.5 stable version.

With styled_text 3.0.1 and 3.0.2

andyduke commented 2 years ago

@DenisGL @deepak786 @rmtmckenzie @rodion-m In the next few days, I will update StyledText to be compatible with Flutter 2.5.

andyduke commented 2 years ago

A new version of StyledText 3.0.3 (compatible with Flutter 2.5) is already available on pub.dev.

DenisGL commented 2 years ago

Thanks a lot!