{

Welcome to my blog !


Dart| Flutter How to: get First and Last Element from a List with Example

December 1, 2022 ·  3 min read

This tutorial shows how to get the first and last element from a Dart or Flutter List dart programming provides multiple ways to retrieve the first and last element from a list. How to get the First element in dart/flutter? dart list provides multiple ways to retrieve the first element. List.first property Returns the first element from a given list, if the list is not empty. if the list is empty, It throws an error Uncaught Error: Bad state: No element import 'dart:async'; void main() async { List list = []; print(list);//[] print(list....

Dart| Flutter How to: Function Return a function

December 1, 2022 ·  2 min read

This tutorial shows multiple ways to execute a function repeatedly with a delay timer in dart and flutter programming. Functions declare a return type and return values. In Dart Function also returns functions, which means Function is also typing like primitive type. And type is Function. How to Return a function in Dart The below examples show that Functions return the Function type. Function Declaration contains Return type as Function....

Dart| Flutter How to: Flatten a List with examples

December 1, 2022 ·  2 min read

List contains a list of sub lists or a Map i.e two dimensions list. Flatten list is to output a single list from a two-dimension list. Let’s create a list of sub-list or two-dimensional lists in dart. var list = [ [1, 2, 3], [4, 5, 6], [7, 8] ]; A two-dimensional list contains the list of elements, where each element is again a list. After flatting the list, the result is...

Dart| Flutter How to: Find Set is Empty or not

December 1, 2022 ·  3 min read

This tutorial shows different ways to determine whether or not a set is empty in Dart or Flutter. This post talks about the below things. How to test whether a given Set is null or not and whether its length is zero. Determine whether the Set is empty or blank. Verify that the Set contains Zero elements A set is one of the data structures to store the collection of elements without duplicates....

Dart| Flutter How to: Find an object implements interface

December 1, 2022 ·  2 min read

In Dart, Class extends only one parent class and implements multiple interfaces. Below are operators to check a class of a given object. is checks a given object implements or extends interface or class, It checks parent class hierarchy and returns true if it follows inheritance. runtimeType: Returns the class of an object and gives the only current class of an object not the inheritance tree class checking if an object implements interface in dart?...

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