fix potential call on null (#14731)

* fix potential call on null

* review
This commit is contained in:
Alexandre Ardhuin
2018-02-16 22:37:07 +01:00
committed by GitHub
parent 1686b6d56d
commit 297fd9431f
2 changed files with 2 additions and 2 deletions

View File

@@ -143,7 +143,7 @@ class _CupertinoPickerState extends State<CupertinoPicker> {
/// the lens and partially grayed out around it.
Widget _buildMagnifierScreen() {
final Color foreground = widget.backgroundColor?.withAlpha(
(widget.backgroundColor?.alpha * _kForegroundScreenOpacityFraction).toInt()
(widget.backgroundColor.alpha * _kForegroundScreenOpacityFraction).toInt()
);
return new IgnorePointer(

View File

@@ -124,7 +124,7 @@ void main() {
final GlobalKey<FormState> formKey = new GlobalKey<FormState>();
final GlobalKey<FormFieldState<String>> fieldKey = new GlobalKey<FormFieldState<String>>();
// Input 2's validator depends on a input 1's value.
String errorText(String input) => fieldKey.currentState.value?.toString() + '/error';
String errorText(String input) => '${fieldKey.currentState.value}/error';
Widget builder() {
return new Directionality(