0

空のフラッター アプリケーションを作成し、依存フレームを追加します。組み立て後、エラーが発生します

../../../../.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

flame 0.29 を使ってみました エラーは同じです

4

1 に答える 1