Dart string replaceAll example

Dart String replaceAll method

Introduction : replaceAll is a dart string method that replaces part of a string defined by a pattern with a given value. It creates the new string and returns it.   Syntax : replaceAll is defined as below : String replaceAll(Pattern from, String replace) Here, from : Pattern to replace Read more…

dart throw exception

How to throw an exception in Dart

How to throw an exception in Dart : We can throw an exception manually in Dart. Dart has a couple of predefined Exceptions and these are thrown automatically on any unexpected result. You can raise predefined exceptions, custom exceptions or arbitrary objects. In this post, I will quickly show you Read more…

Dart switch case with example

Switch case in dart : Switch is used to avoid if-else ladder in dart. The switch block takes one expression and each switch block takes n different case blocks. Based on the expression result, it moves to a specific case block. Dart switch block supports integer, string, compile-time constant and Read more…