Created
November 7, 2021 11:11
-
-
Save tomaszpolanski/91ce947955111e5bf34593cb037d95d2 to your computer and use it in GitHub Desktop.
Not null safe code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String? text; | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
children: [ | |
if (text != null) Text(text!), // Won't compile without `!` in `text!` | |
], | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment