Welcome to my blog !

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

December 1, 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: Check List is empty or not Example

December 1, 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 reverse a string example

December 1, 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 read an image from a disk and resize a file

December 1, 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 File name and extension with example

December 1, 2022 ·  1 min read

The post is about how to get the name of the file in dart programming. Dart gets filename and extension There are multiple ways to get the name of the file using path package basename Import path/path.dart package into your code. Path package provides basename and basenameWithoutExtension properties to get name and extension. First, Create a file object. Pass file.path to those methods. Here is an example import 'dart:io'; import 'package:path/path....

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