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

The getter 'subhead' isn't defined for the class 'TextTheme' - Cannot Debug/Run Flutter App #150

Open
polroti opened this issue Sep 26, 2021 · 13 comments

Comments

@polroti
Copy link

polroti commented Sep 26, 2021

ERROR STACK

../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/searchable_dropdown-1.1.3/lib/searchable_dropdown.dart:371:41: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.

  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../snap/flutter/common/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'.
    ? Theme.of(context).textTheme.subhead
    ^^^^^^^

../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/searchable_dropdown-1.1.3/lib/searchable_dropdown.dart:374:16: Error: The getter 'subhead' isn't defined for the class 'TextTheme'.

  • 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('../../../snap/flutter/common/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'.
    .subhead
    ^^^^^^^
    FAILURE: Build failed with an exception.
  • Where:
    Script '/home/user/snap/flutter/common/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1005

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/home/user/snap/flutter/common/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 31s
Exception: Gradle task assembleDebug failed with exit code 1

Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.1, on Ubuntu 20.04.3 LTS 5.11.0-34-generic, locale en_GB.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run flutter doctor --android-licenses to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[!] Android Studio
✗ android-studio-dir = /snap/android-studio/current/android-studio
✗ Android Studio not found at /snap/android-studio/current/android-studio
[✓] VS Code (version 1.60.0)
[✓] Connected device (2 available)

! Doctor found issues in 2 categories.

@lcuis
Copy link
Collaborator

lcuis commented Sep 26, 2021

Thanks @Manoj997 for reporting this issue. Can you please let us know whether this also affects the search_choices plugin?

@polroti
Copy link
Author

polroti commented Sep 26, 2021

My project only uses searchable-dropdown plugin. I will have to check and let you know

@polroti
Copy link
Author

polroti commented Sep 26, 2021

Hi @lcuis

I switched from searchable_dropdown to search_choices and it works OK. Since both packages show similar functionality, should we keep this issue open?

/Manoj

@lcuis
Copy link
Collaborator

lcuis commented Sep 26, 2021

Hi @Manoj997 ,
Thanks for letting us know!

@IronHeartDan
Copy link

IronHeartDan commented Sep 30, 2021

Click CTRL + Mouse Left Go To The ".subhead" And Replace It With Subtitle1
Or Just Copy Paste This

TextStyle get _textStyle =>
widget.style ??
(_enabled && !(widget.readOnly ?? false)
? Theme.of(context).textTheme.subtitle1
: Theme.of(context)
.textTheme
.subtitle1
.copyWith(color: _disabledIconColor));

And Replace From Line 368 to 375

Hope It Solves The Issue

@Komche
Copy link

Komche commented Oct 1, 2021

Click CTRL + Mouse Left Go To The ".subhead" And Replace It With Subtitle1 Or Just Copy Paste This

TextStyle get _textStyle => widget.style ?? (_enabled && !(widget.readOnly ?? false) ? Theme.of(context).textTheme.subtitle1 : Theme.of(context) .textTheme .subtitle1 .copyWith(color: _disabledIconColor));

And Replace From Line 368 to 375

Hope It Solves The Issue

Thanks your solution solve my problem

@Aaron-Linkforce
Copy link

Go To The ".subhead" And Replace It With Subtitle1

Have also just run into this problem, unfortunately can't build without this being implemented as a fix

@lcuis
Copy link
Collaborator

lcuis commented Oct 21, 2021

Hello @Aaron-Linkforce , please see #150 (comment)

Go To The ".subhead" And Replace It With Subtitle1

Have also just run into this problem, unfortunately can't build without this being implemented as a fix

@Aaron-Linkforce
Copy link

Hello @Aaron-Linkforce , please see #150 (comment)

Ah! search_choices does work. I didn't realise this was a separate package, moving forwards using that now! Thanks.

@lcuis
Copy link
Collaborator

lcuis commented Oct 21, 2021

Hello @Aaron-Linkforce , please see #150 (comment)

Ah! search_choices does work. I didn't realise this was a separate package, moving forwards using that now! Thanks.

You’re welcome!

@azielstyle
Copy link

Click CTRL + Mouse Left Go To The ".subhead" And Replace It With Subtitle1 Or Just Copy Paste This

TextStyle get _textStyle => widget.style ?? (_enabled && !(widget.readOnly ?? false) ? Theme.of(context).textTheme.subtitle1 : Theme.of(context) .textTheme .subtitle1 .copyWith(color: _disabledIconColor));

And Replace From Line 368 to 375

Hope It Solves The Issue

I can confirm this

@lcuis
Copy link
Collaborator

lcuis commented Nov 23, 2021

Click CTRL + Mouse Left Go To The ".subhead" And Replace It With Subtitle1 Or Just Copy Paste This
TextStyle get _textStyle => widget.style ?? (_enabled && !(widget.readOnly ?? false) ? Theme.of(context).textTheme.subtitle1 : Theme.of(context) .textTheme .subtitle1 .copyWith(color: _disabledIconColor));
And Replace From Line 368 to 375
Hope It Solves The Issue

I can confirm this

You can use the search_choices plugin instead.

@novaji-introserve
Copy link

Click CTRL + Mouse Left Go To The ".subhead" And Replace It With Subtitle1 Or Just Copy Paste This

TextStyle get _textStyle => widget.style ?? (_enabled && !(widget.readOnly ?? false) ? Theme.of(context).textTheme.subtitle1 : Theme.of(context) .textTheme .subtitle1 .copyWith(color: _disabledIconColor));

And Replace From Line 368 to 375

Hope It Solves The Issue

from here replace the subhead with subtitle1 or subtitle2,

in case you get the error of the title does not exist, just replace the title with titleSmalll or titleMedium or titleLarge

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

7 participants