Dart type you have NEVER used

Dart type system goes: never say never…

Mangirdas Kazlauskas
Flutter Community

--

First of all, the title of this article could seem like just another clickbait but let me explain. Sure, there is a chance that you have used this type, but for the sake of a pun (and I REALLY enjoy them), I had to do it - oh well, here we are now. The thing is, the type I am going to talk about in this article is actually called Never.

Note: all the information provided in this article is based on the official Dart language documentation.

Update 2022–09–15: I moved this blog to my personal website. For a better reading experience, up to date articles, interactive code examples and some extra content FOR FREE, check kazlauskas.dev.

Table of Contents

  • Dart type system before and after null safety
  • When should I use “Never” in my code?
  • Your contribution

Dart type system before and after null safety

Dart type system before (left) and after (right) null safety

To understand the concept of the type Never, first, we must understand the difference between the Dart type system before and…

--

--

Mangirdas Kazlauskas
Flutter Community

Google Developer Expert for Flutter & Dart | Read the blog for free on kazlauskas.dev | Let's stay in touch - https://twitter.com/mkobuolys