Home > Mobile >  Flutter sdk errors
Flutter sdk errors

Time:10-06

I tried downloading the latest version of flutter sdk and it made errors in the code and got worse. this is the error:

/C:/fluttersdk/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' ('/C:/fluttersdk/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 'C:\fluttersdk\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\fluttersdk\flutter\bin\flutter.bat'' 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 13s
Exception: Gradle task assembleDebug failed with exit code 1

CodePudding user response:

It looks like your package google_maps_place_picker is deprecated. Update it and try again.

CodePudding user response:

Try to run pub upgrade then run these commands:

flutter clean 
flutter pub get 

CodePudding user response:

i removed Theme.of(context).textTheme.title.color and added Colors.black instead. final textColor = Colors.black;

  • Related