santa112358 / hashtagable

Widgets and functions to implement hashTag decorated text.
https://pub.dev/packages/hashtagable
MIT License
30 stars 50 forks source link

ERROR: The getter 'primaryColorBrightness' isn't defined for the type 'ThemeData'. #112

Open SenayGebre opened 11 months ago

askankit commented 11 months ago
./../.pub-cache/hosted/pub.dev/hashtagable-2.3.0+1/lib/widgets/hashtag_text_field.dart:1202:44: Error: The getter 'primaryColorBrightness' isn't defined for the class 'ThemeData'.
 - 'ThemeData' is from 'package:flutter/src/material/theme_data.dart' ('../../Downloads/flutter/packages/flutter/lib/src/material/theme_data.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'primaryColorBrightness'.
        widget.keyboardAppearance ?? theme.primaryColorBrightness;
                                           ^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script '/Users/parasmac/Downloads/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1297

This Is what I get My Flutter version- Flutter (Channel stable, 3.13.6, on macOS 14.0 23A344 darwin-arm64, locale en-IN)

margorski commented 10 months ago

With Flutter 3.10 ThemeData.primaryColorBrightness was removed. An easy fix is to change it to ThemeData.brightness.

I've created a pull request with the fix. I hope the author will pull that and prepare a new version with fix. If not I'll fork this repository for further usage.

Here is PR: https://github.com/santa112358/hashtagable/pull/115 Until author release new version you may use fixed version from my repository: https://github.com/margorski/hashtagable As this library is not published in pub.dev you need to point in your pubspec.yaml directly to repository.

It should looks like this in your pubspec.yaml: hashtagable: git: url: https://github.com/margorski/hashtagable.git ref: 69ae9bbf7985c3dfd9b0617767fe4b09e7bb0664