Skip to content

flutter_form_builder: The getter 'XXX' isn't defined for the class 'TextTheme' #2

Description

@pablogalve

Describe the bug
Using this library doesn't let you compile. It detects getters that are not defined for the class 'TextTheme'.

Console Log

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:96:25: Error: The getter 'display1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'display1'.
        headerTextTheme.display1.copyWith(color: dayColor, height: 1.4);
                        ^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:98:25: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'subhead'.
        headerTextTheme.subhead.copyWith(color: yearColor, height: 1.4);
                        ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:455:51: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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'.
        TextStyle itemStyle = themeData.textTheme.body1;
                                                  ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:470:49: Error: The getter 'body2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'body2'.
          itemStyle = themeData.accentTextTheme.body2;
                                                ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:475:49: Error: The getter 'body2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'body2'.
          itemStyle = themeData.accentTextTheme.body2;
                                                ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:483:49: Error: The getter 'body2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'body2'.
          itemStyle = themeData.accentTextTheme.body2;
                                                ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:495:43: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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'.
          itemStyle = themeData.textTheme.body1
                                          ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:502:35: Error: The getter 'body2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'body2'.
              themeData.textTheme.body2.copyWith(color: themeData.accentColor);
                                  ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:564:46: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'subhead'.
                  style: themeData.textTheme.subhead,
                                             ^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:946:49: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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'.
    final TextStyle style = themeData.textTheme.body1;
                                                ^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/date_range_picker-1.0.7/lib/date_range_picker.dart:957:35: Error: The getter 'headline' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'headline'.
            ? themeData.textTheme.headline
                                  ^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/country_pickers-1.3.0/lib/utils/my_alert_dialog.dart:139:36: Error: Method not found: 'ButtonTheme.bar'.
      children.add(new ButtonTheme.bar(
                                   ^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/country_pickers-1.3.0/lib/utils/my_alert_dialog.dart:108:46: Error: The getter 'title' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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'.
          style: Theme.of(context).textTheme.title,
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/country_pickers-1.3.0/lib/utils/my_alert_dialog.dart:130:48: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/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 'subhead'.
            style: Theme.of(context).textTheme.subhead,
                                               ^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 35s
Running Gradle task 'assembleDebug'...                             36,6s
Exception: Gradle task assembleDebug failed with exit code 1

Flutter doctor -v

[√] Flutter (Channel stable, 2.5.2, on Microsoft Windows [Versión 10.0.19043.1237], locale es-ES)
    • Flutter version 2.5.2 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (4 days ago), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\Pablo Galve\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 2020.3)
    • Android Studio at D:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.60.2)
    • VS Code at C:\Users\Pablo Galve\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.27.0

[√] Connected device (3 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 94.0.4606.71
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 94.0.992.38

• No issues found!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions