Skip to content

Instantly share code, notes, and snippets.

@tomaszpolanski
Created November 7, 2021 11:11
Show Gist options
  • Select an option

  • Save tomaszpolanski/91ce947955111e5bf34593cb037d95d2 to your computer and use it in GitHub Desktop.

Select an option

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