【发布时间】:2021-06-18 19:06:26
【问题描述】:
如何解决这个问题。我是新用户颤振,请任何人帮助我。
lib/screens/main.dart:93:26: Error: The argument type 'Padding' can't be assigned to the p
arameter type 'String'.
- 'Padding' is from 'package:flutter/src/widgets/basic.dart' ('/C:/src/flutter/packages/f
lutter/lib/src/widgets/basic.dart').
label: Padding(
^
lib/screens/main.dart:108:26: Error: The argument type 'Padding' can't be assigned to the
parameter type 'String'.
- 'Padding' is from 'package:flutter/src/widgets/basic.dart' ('/C:/src/flutter/packages/f
lutter/lib/src/widgets/basic.dart').
label: Padding(
^
lib/screens/main.dart:120:24: Error: The argument type 'Text' can't be assigned to the par
ameter type 'String'.
- 'Text' is from 'package:flutter/src/widgets/text.dart' ('/C:/src/flutter/packages/flutt
er/lib/src/widgets/text.dart').
label: Text(""),
^
lib/screens/main.dart:130:26: Error: The argument type 'Padding' can't be assigned to the
parameter type 'String'.
- 'Padding' is from 'package:flutter/src/widgets/basic.dart' ('/C:/src/flutter/packages/f
lutter/lib/src/widgets/basic.dart').
label: Padding(
^
lib/screens/main.dart:145:26: Error: The argument type 'Padding' can't be assigned to the
parameter type 'String'.
- 'Padding' is from 'package:flutter/src/widgets/basic.dart' ('/C:/src/flutter/packages/f
lutter/lib/src/widgets/basic.dart').
label: Padding(
^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dar
t:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'Bu
ildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_pla
yer.dart:101:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the cl
ass 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/p
ackages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inh
eritFromWidgetOfExactType'.
context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\src\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 1m 16s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 77.7s
Gradle task assembleRelease failed with exit code 1
【问题讨论】:
-
嗨 Mehedi Hasan,如果您觉得我的回答有帮助,请接受我的回答