Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

[SOLVED] Flutter Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’ – place_picker.

Spread the Knowledge

Error

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/rich_suggestion.dart:35:89: Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’.
– ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’ (‘/C:/src/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 ‘body1’.
TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.body1!.color)),
^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/search_input.dart:60:65: Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’.
– ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’ (‘/C:/src/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 ‘body1’.
Icon(Icons.search, color: Theme.of(context).textTheme.body1!.color),

^^^^^

FAILURE: Build failed with an exception.

* Where:
Script ‘C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle’ line: 1005

* What went wrong:
Execution failed for task ‘:app:compileFlutterBuildDebug’.
> Process ‘command ‘C:\src\flutter\bin\flutter.bat” finished with non-zero exit v alue 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 42s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

SOLUTION

Here is what I found on StackOverflow

Source (Stackoverflow):- https://stackoverflow.com/questions/69312392/how-to-resolve-error-the-getter-body1-isnt-defined-for-the-class-texttheme

To fix this issue you have to make some changes to Two files

  1. C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/rich_suggestion.dart

2. C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/place_picker-0.9.19-nullsafety/lib/widgets/search_input.dart

Changes to Done

Edit the lines in the dart package like below and it will work. Of course, the author should do this, but you can edit it yourself as well 🙂

rich_suggestion.dart
Original: TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.body1!.color)),

New: TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.bodyText1!.color)),

search_input.dart
Original: Icon(Icons.search, color: Theme.of(context).textTheme.body1!.color),

New: Icon(Icons.search, color: Theme.of(context).textTheme.bodyText1!.color),

Ticket Source (Github):- https://github.com/blackmann/locationpicker/issues/63