Welcome to my blog !

Dart/Flutter:How to Compare two Sets for equal Example

March 27, 2022 ·  3 min read

This tutorial shows multiple examples of how to compare two Sets in Dart and Flutter programming. Two sets are equal if it matches below criteria Length of two sets are equal Order of elements is not important If element is an object, The key and values of an objects in both sets should matched. Check if two sets are equal or not In dart, quiver package a library for collection utility reusable functions...

Dart| Flutter: How to check the variable type is a String or not| Flutter By Example

March 18, 2022 ·  1 min read

This is a simple post to check variable is of a String type. The ‘is’ operator in Dart checks the type of a variable at runtime and returns true or false depending on whether the variable has a predefined type. String data in dart can be created with variables of type String or dynamic type. stringvariable is String returns true if the variable is a string. How to check given variable type is a String in Dart/Flutter void main() { var str = "abc"; print(str is String); //true if (str is String) { print(str); //eric } } Output:...

Flutter/Dart How to: Different ways to iterate a list of elements

March 17, 2022 ·  2 min read

List in a dart programming is the growable list of elements. It is a data structure, that adds, removes and iterates the list of elements in the insertion order. This post shows you multiple ways of iterating a list of objects in Dart and flutter programming. Dart List Iteration examples There are multiple ways to iterate a List in Dart. For loop with index This is a basic normal for loop, which every programming language provides....

Dart| Flutter How to: Check strings are equal or not Example

March 15, 2022 ·  2 min read

This tutorial shows how to compare two strings are equal or not Dart or Flutter. Dart does not provide the isEquals (java) method to compare methods for equality. `String equals compare the same characters in the order of both strings are equal. Since, String are immutable objects, Once you create a string object, does not allow you to modify the string, However, if you append to an existing string, it creates a new string with result, the Original string also exists in memory....

Flutter/Dart Difference between the const and final keyword in Dart?

March 13, 2022 ·  3 min read

final and final are keywords applied to variables. Dart and Flutter provide constant values assigned to variables using final and const keywords. const variables know the value at compile time. final variables know the value at Run time. let’s see the sample example of usage of this. const date=“2021-01-01” // compile time constants final date=CalculateDateFunction();// Runtime time constants Let’s see more comparisons with examples Compile-time vs runtime constants Both const and final values are assigned only once....

You'll get a notification every time a post gets published here.