Android studio 吸气剂';bodyText2';isn';t为类定义';文本主题';飘飘然

Android studio 吸气剂';bodyText2';isn';t为类定义';文本主题';飘飘然,android-studio,flutter,dart,Android Studio,Flutter,Dart,当我在我的颤振项目中导入flatter\u linkify/flatter\u linkify.dart包时,我在控制台中遇到以下错误: Launching lib\main.dart on CRO U00 in debug mode... Running Gradle task 'assembleDebug'... Compiler message: /C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_link

当我在我的颤振项目中导入
flatter\u linkify/flatter\u linkify.dart
包时,我在控制台中遇到以下错误:

Launching lib\main.dart on CRO U00 in debug mode...
Running Gradle task 'assembleDebug'...

Compiler message:
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_linkify-3.1.3/lib/flutter_linkify.dart:113:44: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/flutter/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 'bodyText2'.
        style: Theme.of(context).textTheme.bodyText2.merge(style),
                                           ^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_linkify-3.1.3/lib/flutter_linkify.dart:117:14: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/flutter/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 'bodyText2'.
            .bodyText2
             ^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_linkify-3.1.3/lib/flutter_linkify.dart:243:44: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/flutter/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 'bodyText2'.
        style: Theme.of(context).textTheme.bodyText2.merge(style),
                                           ^^^^^^^^^
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_linkify-3.1.3/lib/flutter_linkify.dart:247:14: Error: The getter 'bodyText2' isn't defined for the class 'TextTheme'.
 - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/src/flutter/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 'bodyText2'.
            .bodyText2
             ^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

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

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\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 45s
Finished with error: Gradle task assembleDebug failed with exit code 1

在我的flutter项目中导入任何包时,我都会遇到这种错误。我最近更新了我的Android studio和插件。

文本主题.bodyText2在较新版本的Flatter中可用(您使用的是较旧版本的1.12.13+修补程序.9)

您有两个选择:

  • 使用旧版本的插件,在您的情况下是

  • 将颤振升级到新版本


  • 您的颤振版本是什么?新的
    TextTheme
    属性需要颤振1.13.8或更新版本。另见。软件包应(但)为颤振SDK指定适当的最低版本。我的颤振版本为颤振1.12.13+修补程序。9@JideGuruI升级颤振,但现在有一个新问题我连接的设备未显示,颤振医生命令不起作用