未找到颤动火焰 FrameTiming

时间:2021-02-02 18:23:43

标签: flutter flame

我创建了空的 Flutter 应用程序并添加了依赖关系。 组装后出现错误

../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:10:8: Error: Type 'FrameTiming' not found.
  List<FrameTiming> _previousTimings = [];
       ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:31: Error: Type 'FrameTiming' not found.
  void onTimingsCallback(List<FrameTiming> timings) =>
                              ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:44: Error: The parameter 'timings' of the method 'FPSCounter.onTimingsCallback' has type 'List<invalid-type>', which does not match the corresponding type, 'List<FrameTiming>', in the overridden method, 'Game.onTimingsCallback'.
 - 'List' is from 'dart:core'.
 - 'FrameTiming' is from 'dart:ui'.
Change to a supertype of 'List<FrameTiming>', or, for a covariant parameter, a subtype.
  void onTimingsCallback(List<FrameTiming> timings) =>
                                           ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/game.dart:50:8: Context: This is the overridden method ('onTimingsCallback').
  void onTimingsCallback(List<FrameTiming> timings) {}
       ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/base_game.dart:22:7: Error: Applying the mixin 'FPSCounter' to 'Game' introduces an erroneous override of 'onTimingsCallback'.
class BaseGame extends Game with FPSCounter {
      ^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:44: Context: The parameter 'timings' of the method 'FPSCounter.onTimingsCallback' has type 'List<invalid-type>', which does not match the corresponding type, 'List<FrameTiming>', in the overridden method, 'Game.onTimingsCallback'.
 - 'List' is from 'dart:core'.
 - 'FrameTiming' is from 'dart:ui'.
Change to a supertype of 'List<FrameTiming>', or, for a covariant parameter, a subtype.
  void onTimingsCallback(List<FrameTiming> timings) =>
                                           ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/game.dart:50:8: Context: This is the overridden method ('onTimingsCallback').
  void onTimingsCallback(List<FrameTiming> timings) {}
       ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:10:8: Error: 'FrameTiming' isn't a type.
  List<FrameTiming> _previousTimings = [];
       ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:31: Error: 'FrameTiming' isn't a type.
  void onTimingsCallback(List<FrameTiming> timings) =>
                              ^^^^^^^^^^^

Compiler message:
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:10:8: Error: Type 'FrameTiming' not found.
  List<FrameTiming> _previousTimings = [];
       ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:31: Error: Type 'FrameTiming' not found.
  void onTimingsCallback(List<FrameTiming> timings) =>
                              ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:44: Error: The parameter 'timings' of the method 'FPSCounter.onTimingsCallback' has type 'List<invalid-type>', which does not match the corresponding type, 'List<FrameTiming>', in the overridden method, 'Game.onTimingsCallback'.
 - 'List' is from 'dart:core'.
 - 'FrameTiming' is from 'dart:ui'.
Change to a supertype of 'List<FrameTiming>', or, for a covariant parameter, a subtype.
  void onTimingsCallback(List<FrameTiming> timings) =>
                                           ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/game.dart:50:8: Context: This is the overridden method ('onTimingsCallback').
  void onTimingsCallback(List<FrameTiming> timings) {}
       ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/base_game.dart:22:7: Error: Applying the mixin 'FPSCounter' to 'Game' introduces an erroneous override of 'onTimingsCallback'.
class BaseGame extends Game with FPSCounter {
      ^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:44: Context: The parameter 'timings' of the method 'FPSCounter.onTimingsCallback' has type 'List<invalid-type>', which does not match the corresponding type, 'List<FrameTiming>', in the overridden method, 'Game.onTimingsCallback'.
 - 'List' is from 'dart:core'.
 - 'FrameTiming' is from 'dart:ui'.
Change to a supertype of 'List<FrameTiming>', or, for a covariant parameter, a subtype.
  void onTimingsCallback(List<FrameTiming> timings) =>
                                           ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/game/game.dart:50:8: Context: This is the overridden method ('onTimingsCallback').
  void onTimingsCallback(List<FrameTiming> timings) {}
       ^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:10:8: Error: 'FrameTiming' isn't a type.
  List<FrameTiming> _previousTimings = [];
       ^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:13:31: Error: 'FrameTiming' isn't a type.
  void onTimingsCallback(List<FrameTiming> timings) =>
                              ^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

我的代码pubspec.yaml

    environment:
      sdk: ">=2.3.0 <3.0.0"

    dependencies:
      flutter:
        sdk: flutter
      cupertino_icons: ^0.1.3
      flame: 0.28.0

    dev_dependencies:
      flutter_test:
        sdk: flutter

我尝试使用火焰 0.29 错误是一样的

1 个答案:

答案 0 :(得分:2)

1st Go to Terminal write:

code: 'ER_PARSE_ERROR',
errno: 1064,
sqlMessage: "You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use near 'SELECT s.level,s.exp,s.number FROM ( SELECT userID ,level ,exp ,(@ROW_NUMBER:...' at line 1",
sqlState: '42000',
index: 0,
sql: 'SET @ROW_NUMBER = 0; SELECT s.level,s.exp,s.number FROM ( SELECT
userID ,level ,exp ,(@ROW_NUMBER:=@ROW_NUMBER + 1 ) AS number FROM levels
ORDER BY level DESC) AS s WHERE userID = "258217948819357697";'

然后关闭应用程序并执行:

 flutter pub get 

命令。