[connectivity][connectvity_platform_interface] migrate to nnbd#3176
[connectivity][connectvity_platform_interface] migrate to nnbd#3176cyanglaz merged 13 commits intoflutter:nnbdfrom
Conversation
| _singleton = Connectivity._(); | ||
| } | ||
| return _singleton; | ||
| return _singleton!; |
There was a problem hiding this comment.
Interesting. In some cases the analyzer is smart enough to figure out that _singleton cannot be null at this point, so ! isn't required.
There was a problem hiding this comment.
Got an error trying to remove !
./lib/connectivity.dart:25:12: Error: A value of type 'Connectivity?' can't be returned from a function with return type 'Connectivity'.
- 'Connectivity' is from 'package:connectivity/connectivity.dart' ('../lib/connectivity.dart').
return _singleton;```
| @@ -1,3 +1,7 @@ | |||
| ## 1.1.0-nullsafety | |||
There was a problem hiding this comment.
I saw that other platform_interfaces are only bumping minor version. Are we going to break platform_interface as well?
|
|
||
| /// Convert a String to a LocationAuthorizationStatus value. | ||
| LocationAuthorizationStatus parseLocationAuthorizationStatus(String result) { | ||
| LocationAuthorizationStatus parseLocationAuthorizationStatus(String? result) { |
There was a problem hiding this comment.
looks like result could be non-null, right?
|
|
||
| /// Convert a String to a ConnectivityResult value. | ||
| ConnectivityResult parseConnectivityResult(String state) { | ||
| ConnectivityResult parseConnectivityResult(String? state) { |
There was a problem hiding this comment.
looks like state could be non-null, right?
| @@ -1,3 +1,7 @@ | |||
| ## 1.1.0-nullsafety | |||
There was a problem hiding this comment.
I saw that other platform_interfaces are only bumping minor version. Are we going to break platform_interface as well?
|
|
||
| /// Convert a String to a ConnectivityResult value. | ||
| ConnectivityResult parseConnectivityResult(String state) { | ||
| ConnectivityResult parseConnectivityResult(String? state) { |
|
|
||
| /// Convert a String to a LocationAuthorizationStatus value. | ||
| LocationAuthorizationStatus parseLocationAuthorizationStatus(String result) { | ||
| LocationAuthorizationStatus parseLocationAuthorizationStatus(String? result) { |
| _singleton = Connectivity._(); | ||
| } | ||
| return _singleton; | ||
| return _singleton!; |
There was a problem hiding this comment.
Got an error trying to remove !
./lib/connectivity.dart:25:12: Error: A value of type 'Connectivity?' can't be returned from a function with return type 'Connectivity'.
- 'Connectivity' is from 'package:connectivity/connectivity.dart' ('../lib/connectivity.dart').
return _singleton;```
Since connectivity_web has not migrated, temporarily un-endorse the web plugin.
All the deps are path deps for now, will submit another PR to update them to git dep after landing this.