Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问题:Logger.onLevelChanged #65

Open
JieHaoCai opened this issue Oct 20, 2023 · 4 comments
Open

问题:Logger.onLevelChanged #65

JieHaoCai opened this issue Oct 20, 2023 · 4 comments

Comments

@JieHaoCai
Copy link

Failed to build json_model:json_model:
../../AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/build_runner_core-7.2.2/lib/src/logging/build_for_input_logger.dart:13:7: Error: The non-abstract class 'BuildForInputLogger' is missing implementations for th
ese members:

  • Logger.onLevelChanged
    Try to either
  • provide an implementation,
  • inherit an implementation from a superclass or mixin,
  • mark the class as abstract, or
  • provide a 'noSuchMethod' implementation.

class BuildForInputLogger implements Logger {
^^^^^^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/logging-1.2.0/lib/src/logger.dart:162:22: Context: 'Logger.onLevelChanged' is defined here.
Stream<Level?> get onLevelChanged {
^^^^^^^^^^^^^^
../../AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/build_runner-2.1.11/lib/src/build_script_generate/bootstrap.dart:76:40: Error: Method not found: 'NullThrownError'.
final error = e[0] as Object? ?? NullThrownError();

@JieHaoCai JieHaoCai changed the title Failed to build json_model:json_model 问题:Logger.onLevelChanged Oct 20, 2023
@JieHaoCai
Copy link
Author

dev_dependencies:
flutter_lints: ^2.0.0
json_model: ^1.0.0
json_serializable: ^5.0.0

@pingia
Copy link

pingia commented Oct 28, 2023

dev_dependencies: flutter_lints: ^2.0.0 json_model: ^1.0.0 json_serializable: ^5.0.0

I resolved the same error by following the below link:
dart-lang/build#3519 (comment)

@Zhoulive
Copy link

Zhoulive commented Sep 8, 2024

Terminal Command:
1.dart pub upgrade
2.dart pub outdated
3.dart pub upgrade --major-versions
4.flutter packages pub run json_model
or (dart run json_mode)

@sayLX
Copy link

sayLX commented Sep 27, 2024

because the version of logging in your project is incompatible with the version used by json_model, you should specify the logging version.

just do it follow this:

  1. delete pubspec.lock

  2. add dependencies
    logging: ^1.0.1

  3. flutter pub get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants