Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[null-safety] enable null safety #69440

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

Merged

Conversation

jonahwilliams
Copy link
Member

Description

Roll to null-safe by default Dart

@flutter-dashboard flutter-dashboard bot added the engine flutter/engine repository. See also e: labels. label Oct 30, 2020
@google-cla google-cla bot added the cla: yes label Oct 30, 2020
@jonahwilliams
Copy link
Member Author

mac_build_tests has passed but not phoned home yet, landing

@jonahwilliams jonahwilliams merged commit 324b78e into flutter:master Oct 30, 2020
@jonahwilliams jonahwilliams deleted the roll_to_null_Safety_12371212783 branch October 30, 2020 22:26
@amirh
Copy link
Contributor

amirh commented Oct 31, 2020

This broke the CI for flutter/plugins (as not all plugins are migrated to null safety yet), how should we go about it?

(example of broken CI task: https://github.com/flutter/plugins/pull/3238/checks?check_run_id=1334613813 )

@leafpetersen
Copy link
Contributor

I don't understand that log at the moment. It looks to me as if the plugins are correctly opted out, and should see no new errors. What is the exact command that is running (including the exact paths)?

@amirh
Copy link
Contributor

amirh commented Oct 31, 2020

I can reproduce the errors locally by running flutter analyze from the packages/video_player/video_player folder in the flutter/plugins repository (with flutter synced to this commit or later). This is what I get:

Analyzing video_player...                                               

  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:15:24 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:23:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:25:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:26:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:27:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:28:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:33:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:35:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:38:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:39:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:44:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:46:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:48:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:52:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:55:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:57:13 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:58:39 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:62:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The non-nullable local variable '_controller' must be assigned before it can be used • example/integration_test/video_player_test.dart:63:14 •
         not_assigned_potentially_non_nullable_local_variable
  error • The parameter 'key' can't have a value of 'null' because of its type, and no non-null default value is provided • example/lib/main.dart:111:27 •
         missing_default_value_for_parameter
  error • The parameter 'title' can't have a value of 'null' because of its type, and no non-null default value is provided • example/lib/main.dart:111:37 •
         missing_default_value_for_parameter
  error • Non-nullable instance field '_controller' must be initialized • example/lib/main.dart:153:25 • not_initialized_non_nullable_instance_field
  error • Non-nullable instance field '_controller' must be initialized • example/lib/main.dart:209:25 • not_initialized_non_nullable_instance_field
  error • The parameter 'key' can't have a value of 'null' because of its type, and no non-null default value is provided • example/lib/main.dart:268:31 •
         missing_default_value_for_parameter
  error • The parameter 'controller' can't have a value of 'null' because of its type, and no non-null default value is provided • example/lib/main.dart:268:41 •
         missing_default_value_for_parameter
  error • Non-nullable instance field '_videoPlayerController' must be initialized • example/lib/main.dart:348:25 • not_initialized_non_nullable_instance_field

26 issues found. (ran in 1.7s)

@leafpetersen
Copy link
Contributor

@amirh does a .dart_tool/package_config.json file exist in that directory? If so, what are the contents? If not, did you/can you run pub get (or flutter packages get, I think it may be for flutter)?

@leafpetersen
Copy link
Contributor

@zanderso found the issue - the example directory has its own pubspec.yaml, which has no missing sdk constraint.

@amirh
Copy link
Contributor

amirh commented Oct 31, 2020

Thanks!

Should we be worried about the ecosystem taking a similar hit with the next flutter release?
One thing we can do is send out a dart_lsc to make sure example apps have the same sdk constraints as the plugin for all plugins.

@amirh
Copy link
Contributor

amirh commented Oct 31, 2020

I ran some stats and filed dart-lang/sdk#44013 for a follow-up discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants