Fidev-io / framy

A convenient code generator for app styleguide, gallery, wireframes and/or storyboard.
https://framy.dev
GNU Lesser General Public License v3.0
148 stars 16 forks source link

Null-safety support #160

Open spixy opened 3 years ago

spixy commented 3 years ago

Running the generator with flutter pub run --no-sound-null-safety build_runner build produces:

[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart. This is likely caused by a misconfigured builder definition. [SEVERE] .dart_tool/build/entrypoint/build.dart:52:3: Warning: Operand of null-aware operation '?.' has type 'SendPort' which excludes null. - 'SendPort' is from 'dart:isolate'. sendPort?.send(result); ^Error: Cannot run with sound null safety, because the following dependenciesdon't support null safety: - package:build_runner_core - package:framy_generator - package:json_serializable - package:mobx_codegen - package:source_gen - package:build_config - package:build_runner - package:build - package:json_annotation - package:glob - package:crypto - package:logging - package:watcher - package:build_resolvers - package:timing - package:graphs - package:package_config - package:yaml - package:analyzer - package:framy_annotation - package:dart_style - package:checked_yaml - package:pubspec_parse - package:build_daemon - package:args - package:io - package:convert - package:pub_semver - package:_fe_analyzer_shared - package:mobx - package:http_multi_server - package:shelf - package:stream_transform - package:http_parser - package:mime - package:shelf_web_socket - package:web_socket_channel - package:cli_utilFor solutions, see https://dart.dev/go/unsound-null-safety. dart_tool/build/entrypoint/build.dart:50:44: Error: The parameter 'sendPort' can't have a value of 'null' because of its type 'SendPort', but the implicit default value is 'null'. - 'SendPort' is from 'dart:isolate'.Try adding either an explicit non-'null' default value or the 'required' modifier.void main(List args, [_i7.SendPort sendPort]) async { pub finished with exit code 78

[√] Flutter (Channel beta, 1.26.0-17.6.pre, on Microsoft Windows [Version 10.0.19042.804])
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Android Studio (version 4.1.0)
[√] VS Code, 64-bit edition (version 1.53.2)
[√] Connected device (1 available)

• No issues found!

Edit: This is issue in build_runner and was fixed in 1.10.4 ( https://github.com/dart-lang/build/issues/2966 ) which Framy does not use (yet).

spixy commented 3 years ago

I made it working with this for now, but preset generating doesnt work (Error running PresetResolver).

dependency_overrides:
  build_runner: 1.10.4
  build_resolvers: "1.3.11"
  build: ">=1.3.0 <1.4.0"
  analyzer: ^0.40.0