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

Cannot build version 1.0.1 due to TextTheme deprecation #156

Open
Wian-TMC opened this issue Nov 23, 2021 · 3 comments
Open

Cannot build version 1.0.1 due to TextTheme deprecation #156

Wian-TMC opened this issue Nov 23, 2021 · 3 comments

Comments

@Wian-TMC
Copy link

Describe the bug
I am getting the build error

../../../../../Development/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_place_picker-1.0.1/lib/src/components/prediction_tile.dart:29:51: Error: The getter 'title' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../../../Development/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'title'.
    final textColor = Theme.of(context).textTheme.title.color;
                                                  ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script '/Users/wiansnyman/Development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/Users/wiansnyman/Development/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 39s 

To Reproduce
Steps to reproduce the behavior:
Import the package and try to build on Android with targetSdkVersion and compileSdkVersion set to 30
Expected behavior
A successful build

Flutter Doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.5.2 20G95 darwin-x64, locale en-ZA)
• Flutter version 2.5.3 at /Users/wiansnyman/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (6 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/wiansnyman/Library/Android/sdk
• Platform android-31, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.11.2

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

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.62.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.28.0

[✓] Connected device (2 available)
• iPhone 11 Pro (mobile) • 361FD73C-1A6F-4F2F-AFBA-F1596DFBEF5E • ios •
com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome
96.0.4664.55

• No issues found!

@Wian-TMC Wian-TMC changed the title Cannot build Cannot build version 1.0.1 due to TextTheme deprecation Nov 23, 2021
@paloe
Copy link

paloe commented Dec 21, 2021

any solution?

@BhaveshTechnomads
Copy link

Project -> External Libraries - > Dart libraries - > google_map_place_picker -> src -> component -> prediction_tile.

inside the prediction file.

Use
final textColor = Theme.of(context).textTheme.bodyText1.color;
instead of
final textColor = Theme.of(context).textTheme.title.color

@ishane96
Copy link

ishane96 commented Aug 6, 2022

final textColor = Theme.of(context).textTheme.bodyText1.color;

this worked

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

No branches or pull requests

4 participants