Skip to content

Instantly share code, notes, and snippets.

@tomaszpolanski
Created November 7, 2021 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomaszpolanski/91ce947955111e5bf34593cb037d95d2 to your computer and use it in GitHub Desktop.
Save tomaszpolanski/91ce947955111e5bf34593cb037d95d2 to your computer and use it in GitHub Desktop.
Not null safe code
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