Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: The getter 'subtitle1' isn't defined for the class 'TextTheme' #260

Open
AmolPatil-Git opened this issue May 30, 2024 · 0 comments · May be fixed by #262
Open

Error: The getter 'subtitle1' isn't defined for the class 'TextTheme' #260

AmolPatil-Git opened this issue May 30, 2024 · 0 comments · May be fixed by #262

Comments

@AmolPatil-Git
Copy link

pub.dev/dropdown_button2-1.9.4/lib/dropdown_button2.dart:1667:51: Error: The getter 'subtitle1' isn't defined for the class 'TextTheme'.

This appears to be due to changes in the Flutter SDK where subtitle1 has been renamed or deprecated.

To Reproduce
Steps to reproduce the behavior:

  1. Use Flutter version 3.0.0 (or the latest version as of this writing).
  2. Add dropdown_button2: ^1.9.4 to pubspec.yaml.
  3. Run the project.
  4. See the error in the console output.

Expected Behavior
The package should use the updated TextTheme properties compatible with the latest Flutter SDK. Specifically, the subtitle1 should be replaced with titleMedium or another appropriate property.

Proposed Solution
Update the code in dropdown_button2.dart as follows:

// Original code
style: Theme.of(context).textTheme.subtitle1,

// Updated code
style: Theme.of(context).textTheme.titleMedium,
<img width="702" alt="Screenshot 2024-05-30 at 7 27 38 PM" src="https://github.com/fluttercommunity/flutter_uploader/assets/163115830/33d34469-dbb2-4064-857e-d6be36940402">


Could you please update the package to be compatible with the latest Flutter SDK? This would greatly help the community and avoid similar issues in the future.

@orestesgaolin orestesgaolin linked a pull request Jun 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant