skip to Main Content

../../../.pub-cache/hosted/pub.dev/getwidget-2.1.1/lib/components/avatar/gf_avatar.dart:89:51: Error: The getter ‘subtitle1’ isn’t defined for the class ‘TextTheme’.

  • ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’ (‘/Library/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 ‘subtitle1’.
    TextStyle? textStyle = theme.primaryTextTheme.subtitle1?.copyWith(
    ^^^^^^^^^
    Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

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

Process ‘command ‘/Library/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.

BUILD FAILED in 13s
Error: Gradle task assembleDebug failed with exit code 1

I don’t know what to do.

2

Answers


  1. As far as i remember, its been deprecated as of Flutter version 3.19.3. If you have flutter with version more than this consider checking the updated docs.

    TextStyle? subtitle1,
        @Deprecated(
          'Use titleSmall instead. '
          'This feature was deprecated after v3.1.0-0.0.pre.',
        )
    
    Login or Signup to reply.
  2. The subtitle1 has been deprecated and will not work with the latest flutter versions. So you should replace it with new typography. Please learn about the new typography here: https://api.flutter.dev/flutter/material/TextTheme-class.html

    You should migrate to new typography to resolve this issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search