{

Learn free flutter tutorials


Dart| Flutter How to: Read pubspec.yaml attributes (version) with examples

April 30, 2022 ·  1 min read

This tutorials explains about how to read pubspec.yaml file in example. pubspec.yaml file contains following things name: dartapp description: >- dart example application. version: 1.0.0 environment: sdk: '>=2.10.0 <3.0.0' dependencies: ini: ^2.1.0 jiffy: ^5.0.0 quiver: 3.0.1+1 yaml: ^3.1.0 yaml_writer: 1.0.1 image: any mime: any path: any package_info: any dev_dependencies: intl: any How to read pubspec.yaml file in Dart This tutorials is about to read puspect.yaml file and print the content....


How to: Check if Phone number is valid or not in Dart| Flutter By Example

April 28, 2022 ·  2 min read

This program checks how to validate the phone number validation. Dart provides a RegExp class for matching strings with regular expression. Following are the rules for valid phone numbers. phone number only contains numerical numbers and Optional symbol(+) only letters are not allowed Optional + or zero with beginning followed by digits from 1 to 9 Phone number can contain 10 or 12 digits Valid phone numbers are +9166666666666 and Invalid emails are abc, 123....


Dart| Flutter How to read an image from a disk and resize a file

April 27, 2022 ·  1 min read

Sometimes, We want to read an image from a disk folder and resize it and display the image. You can use the resized image in flutter widgets to display it This tutorial explains how to read and resize it. How to read images in dart? First import the image library as a dependency in pubspec.yaml name: dartapp description: >- dart example application. version: 1.0.0 environment: sdk: '>=2.10.0 <3.0.0' dependencies: image: any import dart:io and image package in the application create a File object with the given file path Decode the image using file object using decodeImage, and convert to a byte in synchronous operation using the readAsBytesSync() method change the image size with copyResize and returns the image object File convert image object, save the object Here is an example program for reading, resize, and outputting image...


Dart| Flutter How to get extension name and MIME type of a file with example

April 26, 2022 ·  2 min read

This tutorial explains about below program How to get the MIME type of a file How to find the extension of a given file How to get the MIME type of a file? This program explains about to get mime types of a file. mime package provides lookupMimeType function, that returns MIME type. It parses the path of a file, returns extension, extension is checked against MIME types, and returns the MIME-type...


Dart| Flutter How to: Create a private variable with example

April 25, 2022 ·  2 min read

This tutorial shows how to write and declare private variables in Dart. Dart Private Variables There is no private keyword or private variables in Dart. In dart, you can declare a variable name with an underscore(_) as a private variable. Private variables are accessed inside the same class, not outside the classes or files. In Dart, you can declare private variables in the classes class Employee { int _privateVariable = 0; int id = 11; displayMessage() { print('$_privateVariable'); // 0 print('$id'); // 11 } } void main() { Employee employee = Employee(); print(employee....


Dart| Flutter How to: multiple ways to Remove an element or object from a List with Example

April 25, 2022 ·  3 min read

This tutorial shows you multiple ways to remove elements from a list with examples in dart Dart List remove element examples List class inbuilt methods remove use remove method: List class has a remove method, that removes elements with given input elements. It decreases the size of the list. bool remove(Object? value) It accepts an element. It removes an element, returns true, if the element is removed from the list, else false is returned....


Dart| Flutter How to: Insert an element at beginning of a List with Example

April 24, 2022 ·  1 min read

This tutorial shows how to insert the data at beginning of a list with examples in dart List inserts the elements in the insertion order. In the below program, add method inserts the elements to the end of a List. void main() { List wordsList = ['one', 'two', 'three']; wordsList.add("five"); print(wordsList); } Output: [one, two, three, five] Dart List insert at the beginning with examples List insert method provides inserting an element at the index position....



How to use double dot operator- Cascade operator in Dart| Flutter

April 23, 2022 ·  2 min read

cascade operator is used to call sequence of methods on the objects using .. double dot operator. For example, you have a list object and want to call the same add method for multiple values. You will call as below List list = []; list.add(1); list.add(2); list.add(3); list.add(4); The object name list is repeatedly called to do the same operation. You can also do multiple operations on the same object. Cascade operator (....


Dart| Flutter: How to initialize a final class variable in a constructor? | Flutter By Example

April 22, 2022 ·  2 min read

This tutorial explains how to initialize the final class variable in the constructor. final variables are initialized only once, used only to initialize a variable at runtime. You can use static const for compile-time initialization values Let’s declare the final class field, and initialize the field with the value in the constructor. The below program gives Error: Final field ‘id’ is not initialized and Error: The setter ‘id’ isn’t defined for the class ‘Employee’....


Dart| Flutter How to check element exists in Array

April 20, 2022 ·  1 min read

This tutorial shows how to check element exists in array or list Dart or Flutter List In dart, Array and List stores the same type of collections, Arrays are fixed, List are dynamic in nature. Let’s see how to check an element exists in array or list How do Check value exist in a Array or List of dart/flutter? dart list provides multiple ways to check the sub list contains in the list of elements....


Multiple ways to convert String to DateTime in dart with examples| Flutter By Example

April 18, 2022 ·  2 min read

This tutorial shows how to convert the String of date and time into a DateTime class object in dart and flutter. How to convert String into DateTime in Dart For example, a String contains a date formatted string - 2022-05-20 00:00:00.000. DateTime.parse() method creates DateTime object using formatted string DateTime parse(String formattedString) formattedString is an ISO string format. Here is an example program void main() { var strDate = '2022-05-20 00:00:00....


Dart| Flutter: How to Convert timestamp string from 24 hours to 12 hour format| Flutter By Example

April 17, 2022 ·  1 min read

By Default, the DateTime object returns the date and time, time contains a 24-hour format. This tutorial shows how to convert the String of date and time into a DateTime class object in dart and flutter. How to convert time string from 24 hours to 12 hour format in Dart For example, a String contains a date formatted string - 2022-05-20 23:12:20.000. DateTime.parse() method creates DateTime object using formatted string....


Dart| Flutter: How to Convert timestamp epoch to DateTime local and UTC| Flutter By Example

April 14, 2022 ·  2 min read

Timestamp alias Epoch timestamp or Unix timestamp is a long number that represents the number of milliseconds since 1970-01-01 PST. It is a Count of milliseconds elapsed since 1970-01-01 PST. Sometimes, you need to convert timestamp to DateTime object in dart and flutter You can check how to get Current Timestamp epcho How to Convert Timestamp to DateTime in Dart and Flutter? This example converts timestamp in milli and microseconds to DateTime...


Dart| Flutter: How to check installed version| SDK version

April 12, 2022 ·  1 min read

Sometimes, We want to find the installed version of Dart and SDK version. This tutorial shows check the install version of flutter and the SDK version How to Check the installed version of Dart? Type dart --version command in terminal gives dart SDK version PS A:\work\dart> dart --version Dart SDK version: 2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "windows_x64" if you want to find the location of the dart SDK location you can type the where dart command in Linux....


How to: Check if email is valid or not in Dart| Flutter By Example

April 11, 2022 ·  2 min read

This program checks how to validate the email address. Dart provides a RegExp class for matching strings with regular expression Following are the rules for a valid email address. Email has different valid parts - sender name,@ symbol, and domain name recipient and domain names may contain lower and upper case numbers domain name contains an extension separated by a dot(.) special characters are allowed in the sender’s name sender name length is 64 characters domain name is 256 characters Valid emails are abc@ch....


Dart| Flutter How to: remove all whitespaces or trim in a string

April 9, 2022 ·  2 min read

This tutorial shows multiple ways to remove whitespace characters from a given string How to trim leading and trailing whitespace characters in dart string The dart string trim method removes the lead and trail whitespace characters. Syntax: String trim() Here is an example to remove the start and end whitespace characters from the string void main() { String name = ' Hello Welcome '; print(name); print(name.trim()); } Output: Hello Welcome Hello Welcome It removes any whitespace symbols if string contains new line (\n) or tab(\t) characters,...


Dart| Flutter How to: Multiple ways to get the First and last letter of a string

April 8, 2022 ·  2 min read

This tutorial shows you multiple ways to get the First and Last Letters of a Given input string. The string is a group of characters enclosed in single or double quotes. How to get the First Letter of a string in Dart and Flutter There are multiple ways we can get the first letter of a string. using index syntax: index in string always starts with zero and end index is a string....


How to print dollar symbol in string dart?| Flutter By Example

April 5, 2022 ·  1 min read

You can append any string with another string using the plus operator or interpolation syntax. Similarly, You can add a dollar symbol to a string in multiple ways. How to print the dollar symbol in Dart and Flutter? There are multiple ways The string contains normal text or raw text which is interpreted with interpolation syntax. interpolation syntax uses the $ symbol to print the variable value. For example, if you interpolate syntax, You can use $price to print the variable value....


How to: How to get Hostname in Dart| Flutter By Example

April 5, 2022 ·  1 min read

Sometimes, We need to get the hostname of a running application in the current environment in the dart and flutter application This post shows multiple ways to get a hostname in the dart and flutter project. How to get Hostname in dart application dart:io package provides platform class that provides information of an running environment. Platform class has a static method localHostname that returns the hostname of a system. static String get localHostname => _localHostname; Here is an example program to get hostname in dart...


Dart| Flutter How to: Convert Map to Query String with example

April 4, 2022 ·  2 min read

This tutorial, Shows you multiple ways to convert a Map of values into URL Query String and Query String into the map. This works in Flutter also. Query String is a key and value appended to URL separated by &. How to Convert Map to Query String in dart and flutter Sometimes, We have a map of keys and values in Dart var employee = {"email": "abc@abc.com", "id": "1"}; you want to output...


Dart| Flutter How to: Function Return a function

April 2, 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: Run a function repeatedly with a delay

April 2, 2022 ·  2 min read

This tutorial shows multiple ways to execute a function repeatedly with a delay timer in dart and flutter programming. How to execute function repeatedly with delay timer There are multiple ways we can execute a code function periodically with delay time. use the Timer Periodic method Timer.Periodic() method allows you to create a timer. Timer Timer.periodic(Duration duration, void Function(Timer) callback) It accepts Duration and Callback function parameters....


Dart| Flutter How to: Check sublist contains all elements in List

April 1, 2022 ·  1 min read

This tutorial shows how to check sublist exists in Dart or Flutter List How do Check sub lists exist in a list of dart/flutter? dart list provides multiple ways to check the sub list contains in the list of elements. First Convert list into set using Set.of() method Check sub list exists in Set using Set.containsAll() method Here is an example code void main() { var list = [1, 4, 5, 2, 8]; var sublist = [1, 4]; var set = Set....


Dart| Flutter How to: Find an object implements interface

April 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?...


How to: Convert Future String to String vice versa in Dart| Flutter By Example

March 31, 2022 ·  2 min read

This tutorial shows you how to Convert Future<String> to String in Dart and Flutter programming. Asynchronous programming is supported through the async and await keywords in Dart and Flutter. When retrieving data from the backend, data load it asynchronously before displaying it in the frontend. Future class uses for asynchronous operations in the Dart application. It stores the various types of values returned by async operations. Its value is always a future value that awaits the completion of the function....


How to: Generate Random String in Dart| Flutter By Example

March 31, 2022 ·  2 min read

Random Generator is used to generate a unique value for every invocation. This talks about multiple ways to generate a random string for example. Dart/Flutter Random String generate example This example generates a Random String with values. Following are steps to follow. First, create a constant Character Array of alphabets and special characters. Find the Random number between zero to character array length Create a List of random Unicode numbers using the Iterable....


Dart| Flutter How to: Convert String into an array

March 30, 2022 ·  1 min read

This tutorial shows multiple ways to convert a String into an array or list in dart and flutter programming. Since Array does not support in Dart. We will show you to convert to List onlly. Convert String int List or Array of character String. split() method split the string with the delimiter. The default delimiter is an empty character. Here is an example Convert String into a List of string characters...


Dart| Flutter How to: String replace method

March 30, 2022 ·  2 min read

The string is an immutable class. There is no method such as setCharAt() with an index like in java. We can do multiple ways to replace a character or substring in a String String replace a letter using substring in dart example This example, Replaces the one the character with a new character in a given string. str.substring(0, 2) returns the substring with the start and end index. str.substring(3): returns the substring start index to the remaining string...


Dart| Flutter How to encode and decode a string base64 with example

March 29, 2022 ·  1 min read

Sometimes, need to send the string data in base64, So we need to know how to send encode a string and decode a string. There are multiple ways we can do it. Dart provides an inbuilt dart:convert library to encode and decode various objects in UTF8 formats. How to encode a string in base64 format in dart dart:convert library provides base64 class. This example converts the string into an encoded base64 string....


Dart| Flutter How to reverse a string example

March 29, 2022 ·  2 min read

In this article, learn how to reverse a string in multiple ways. It also includes reversing a string with Unicode utf-8 characters. There are multiple ways we can do it. Dart provides an inbuilt dart:convert library to encode and decode various objects in UTF8 formats. How to do string in reverse order in dart This example takes the input string and converts the string in reverse order. First, the Given string is split into characters using the split() method....


Dart| Flutter How to calculate the collection numbers sum example

March 28, 2022 ·  3 min read

The collection is a collection of elements in dart. For example, a List is one of the collections of items to store with insertion order. Dart Collection of the sum of numbers example There are multiple ways we can do the sum for the collection of numbers. use List reduce method List. reduce() method reduces the collection of elements with the iteration of elements and applies the function....


Dart| Flutter How to calculate the collection numbers sum example

March 28, 2022 ·  2 min read

Functions in Dart return only a single value. There are multiple ways to return multiple values wrapped with the below types Array or List Create an object of a Class Set Tuple class How to return multiple values from a Function in Dart Following are multiple ways to pass multiple data from a function create a class and pass the object with values from a function In this example, the function wants to return multiples of different types, So Wrap those values in the object of a class and return from a function....


How to: Convert List to List in Dart| Flutter By Example

March 28, 2022 ·  2 min read

This tutorial shows you how to Convert Future<List> to List in Dart and Flutter programming. Dart and flutter provide async and await keywords for asynchronous. When you are retrieving the data from the backend, loaded in asynchronous and display it in frontend. Future are classes for asynchronous operations in the Dart application. It holds the values of different types returned from async operations. Its value always returns status uncompleted and completed....


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

March 26, 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 Set is one of the data structures to store the collection of elements without duplicates....


How to convert List to Set or vice-versa in Dart| Flutter By Example

March 26, 2022 ·  1 min read

This tutorial shows multiple ways to convert List to Set in Dart or flutter programming. The List is a dynamic collection of objects in Dart, elements are inserted on insertion order and allow duplicate objects. The Set is a data structure to store a collection of elements, does not allow duplicates. Both are different types in Dart or Flutter, and We have to write a code to convert from one type into another....


Dart| Flutter: Convert List of Dynamic into List of String examples

March 25, 2022 ·  2 min read

In Dart and flutter, this tutorial explains how to convert List<Dynamic> to List<String> and vice versa. A dynamic type is a primitive type that may hold any dynamic value, such as an integer, a string, or a double. Because a string is a primitive type that stores a collection of characters, automated conversion to/from dynamic is not possible. You can check on How to convert dynamic to string vice versa or vice versa in Dart and flutter....


How to convert List to Map or vice-versa in Dart| Flutter By Example

March 25, 2022 ·  2 min read

This tutorial shows multiple ways to convert List to Map in Dart or flutter programming. The List is a dynamic collection of objects in Dart. The map is a data structure to store key and value pairs. Both are different types in Dart or Flutter, and We have to write a code to convert from one type into another. How to convert List to Map in Dart or Flutter programming List....


Dart| Flutter How to: Create an Empty Set

March 24, 2022 ·  2 min read

This tutorial shows multiple ways to create an empty Set in Dart or Flutter An empty Set is a Set data structure that contains no elements, and a Set has a length of zero. In Flutter, an API or service method may return an empty set instead of null to improve null safety handling. How to create an Empty Set in Flutter or dart? An empty Set can be created in multiple ways....


Dart| Flutter How to: Check Map is or empty or not Example

March 23, 2022 ·  3 min read

This tutorial shows different ways to check whether a map is empty or not in Dart or Flutter. This post talks about the below things. How to check if a given map is null or not and length is zero Find the map is empty or blank. Check map contains no elements In dart, what is an empty map? An empty map has no elements and is blank....


Dart| Flutter How to: Create an Empty Map

March 23, 2022 ·  2 min read

This tutorial shows multiple ways to create an empty Map in Dart or Flutter An empty Map is a Map data structure that lacks a key and value pair of elements, and a Map has a length of zero. In Flutter, an API or service method may return an empty Map instead of null to improve null safety handling. How to create an Empty Map in Flutter or dart?...


Dart| Flutter: Convert List of Strings into List<int> examples

March 22, 2022 ·  2 min read

This tutorial shows multiple ways to Convert List<String> into List<int> in Dart and flutter. String and int types are different primitive and store different values, So automatic conversion are not possible. You can check on How to convert String to int or vice versa in Dart and flutter. How to Convert List of String into List of Int type in Dart This example converts a list of string into a list of int in dart and flutter....


Dart| Flutter How to: Flatten a List with examples

March 21, 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: Multiple ways to clone or copy a List with examples

March 21, 2022 ·  4 min read

A clone is a copy of an object. In general, Clone is of two types. Let’s create a list in dart. List original = [1, 2, 3]; It does the following things during list object creation. Create a variable for the list i.e. object list data is stored in memory location Object(original) has a reference to memory location Shallow Clone: In this copy process, data exists in the same memory location, but creates two references pointing to the same memory location....


Dart| Flutter How to: Check List is empty or not Example

March 20, 2022 ·  2 min read

This tutorial shows multiple ways how to find if the list is empty or not in Dart or Flutter. This post talks about the below things. How to check if a given list length is zero Find list is empty or blank. Check List contains nil elements What is an empty list in dart? An empty list is a list with no elements and is blank....


Dart| Flutter How to: Create an Empty List

March 20, 2022 ·  2 min read

This tutorial shows multiple ways to create an empty list in Dart or Flutter List An empty list is a list without an element and the size of a list is zero. Sometimes, In Flutter, API or service method returns an empty list instead of null to have better handling of null safety. How to create an Empty List in Flutter or dart? An empty list can be created in multiple....


Dart| Flutter How to: List Filter search with examples

March 19, 2022 ·  3 min read

This tutorial shows multiple examples on filtering List with some logic in Dart and flutter Dart/flutter multiple ways to filter a list or array of objects Following are multiple ways we can filter a list of objects In both the examples below, we have a list of objects, Where each object contains salary and name. Filter the list of objects based on salary conditions and output the result....


Dart| Flutter: Different ways to check differences of two lists with example

March 18, 2022 ·  2 min read

The list contains a growable collection of data. Sometimes you want to find the difference between the two lists. For example, You have two declared lists List list1 = [1,5,10,20,25,30,35]; List list2 = [1,5,7,25,29,30]; What is the difference between the above list? The difference is a common element that is repeated in both lists is called a difference of the lists. And the output This example shows you multiple ways to find the difference between two lists....


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:...


Dart| Flutter: How to check the type of an variable is list| Flutter By Example

March 17, 2022 ·  2 min read

This is a simple post to check variable is of a specific or Generic List type. Dart provides an is operator that checks the type of a variable at runtime and returns true for a given variable with a predefined type or not. How to check if a variable is a List in Dart This is operator provides a variable and List type and returns true if a given variable of type List....


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: Convert List into String examples

March 16, 2022 ·  2 min read

This tutorial shows multiple ways to create an immutable list. Sometimes, You need to Convert List<String> into a Single String. How to Convert Listto String in Dart? There are multiple ways we can do use join() method List has a join method that returns the string with an optional separator. default optional parameter is empty. It iterates each element and calls the element.toString() append the result with a separator....


Dart| Flutter: Multiple ways to create immutable List with examples

March 16, 2022 ·  2 min read

This tutorial shows multiple ways to create an immutable list. The list is a mutable list in a dart that allows adding, removing, and updating operations. Immutable lists do not allow to add or update operations and allow only read operations. Due to reading operations, Immutable List is best in performance compared with List. Sometimes, We want to return APIs or methods to return immutable List only. For example, Normal List allows adding, updating, and removing operations as given below....


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....


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

March 15, 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....


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....


Different ways to print an object in Dart and Flutter| Dart By Example

March 10, 2022 ·  3 min read

This tutorial shows multiple ways to print a class object in Dart and flutter In this post, you will learn multiple things How to print Class objects How to print Class object using toString() method How to fully dump and print object variables to console? Print object properties of an instance How to show data from a class Print object variable into JSOn format. Dart class contains properties and functions, It is a blueprint for an instance of the object created....


How to convert Double to Integer or Integer to double in Dart| Flutter By Example

March 9, 2022 ·  3 min read

This tutorial shows multiple ways to Convert Double to Int and Int to double in Dart and Flutter programming. Int is a primitive type that stores numeric numbers arbitrary-precision signed integer without decimals, Examples Int types values are 1,5. Double is a primitive type that stores IEEE-754 double-precision floating numbers. Example double type values are 1.34,1.0. Int and Double are different types and hold different values. Automatic conversion does not happen in the Dart compiler....


How to convert Double to String or String to double in Dart| Flutter By Example

March 8, 2022 ·  4 min read

This tutorial shows multiple ways to convert double to String or string to double in Dart and flutter programming language. The string is a string of numbers or characters enclosed in double quotes or single quotes. A double is a primitive type of floating-point number in Dart programming Both are of different types, Automatic conversions are not possible. So, We have to manually Convert String into double or double to String with examples...


How to convert Enum to number or integer to Enum in dart?| Flutter By Example

March 8, 2022 ·  2 min read

In these tutorials, you will learn how to convert enum to int or int to enum in dart and flutter programming. Enum is a custom class type to store the constant values. the values can be strings or numbers. Int is a predefined type in Dart or flutter that holds numeric values. Automatic conversion is not possible due to different types of data. Let’s declare Enum constants in Dart or Flutter...




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