Flutter Community
Published in

Flutter Community

Exceptions, Errors and asserts in Dart

What’s the difference?

Photo by Sarah Kilian on Unsplash

Background

  • In Dart an Exception is for an expected bad state that may happen at runtime. Because these exceptions are expected, you should catch them and handle them appropriately.
  • An Error, on the other hand, is for developers who are using your code. You throw an Error to let them know that they are using your code…

--

--

--

Articles and Stories from the Flutter Community

Recommended from Medium

3 classic automation mistakes, why we make them, and how to avoid them

XKCD comic depicting on diner building a system for passing salt and other condiments to the other

What’s on Your Programming Reading List?

Fun with Calculation Groups

How to get free domain using eu.org website and upload your picturized resume

Program Better in Ten-Mode

REST API Vs GraphQL: Fetch What You Want!

Fixed: UniFi Network Application Not Starting After Firmware Upgrade

How to Estimate Big, Scary User Stories

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Suragch

Suragch

Flutter and Dart developer. Twitter: @suragch1

More from Medium

Why is Flutter Fast? — Part 1: Sublinear Building

Dart asynchronous programming: Streams

Relative vs package imports in Flutter and Dart

Comparison Of Saving Methods In Flutter

A hard drive