fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
222 stars 356 forks source link

Cannot build version 1.0.1 due to TextTheme deprecation #156

Open Wian-TMC opened 2 years ago

Wian-TMC commented 2 years ago

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!

paloe commented 2 years ago

any solution?

BhaveshTechnomads commented 2 years ago

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 commented 1 year ago

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

this worked