Aggregation Operations in TypeORM (Sum, Avg, Min, Max, Count)
Updated: Sep 04, 2022
This short and straightforward article shows you how to perform aggregation operations in TypeORM. We’ll use a query builder and aggregate functions to calculate the following: Sum: The sum of the valuesAvg: The average......
TypeORM: Check Whether a Row Exists or Not
Updated: Sep 01, 2022
The 2 examples below demonstrate how to check if a record exists or not by using TypeORM findOne() method and query builder, respectively. Using the findOne() method Suppose we need to find a product named KatherineCode.com, we......
Adding a Border to Text in Flutter
Updated: Aug 19, 2022
The example below shows you how to add a border (a stroke) to text in Flutter. Screenshot: The code: Scaffold( appBar: AppBar( title: const Text('KindaCode.com'), ), body: Center( child:......
Flutter: Reading Bytes from a Network Image
Updated: Aug 19, 2022
The example below shows you how to read bytes from a network image in Flutter. The code: // main.dart import 'dart:typed_data'; import 'package:flutter/services.dart'; // Reading bytes from a network image Future<Int8List>......
Flutter: Adding a Border to an Elevated Button
Updated: Aug 18, 2022
In Flutter, you can add a border (and customize its thickness and color as well) to an elevated button by using the ElevatedButton.styleFrom() static method like this: ElevatedButton( style: ElevatedButton.styleFrom( ......
Flutter: Adding a Border to an Icon Button (2 Approaches)
Updated: Aug 17, 2022
This quick article shows you a couple of different ways to create an icon button with a border in Flutter. Using IconButton and Container What you need to do is simply wrap an IconButton widget within a circle Container widget and......
Flutter: Turn an Image into a Base64 String and Vice Versa
Updated: Aug 10, 2022
In Flutter, you can encode a local or network image (or another kind of file) to a base64 string like this: import 'dart:io'; import 'dart:convert'; import 'dart:typed_data'; /* ...*/ //Create a file object from a local image......
Flutter: How to Add a Border to a ListTile
Updated: Aug 08, 2022
In order to add a border to a ListTile widget in Flutter, you can assign its shape property to RoundedRectangleBorder, BeveledRectangleBorder, or StadiumBorder. You have control over the thickness, color, and radius of the border.......
Flutter: Uploading Files with GetConnect (GetX)
Updated: Jul 25, 2022
At the time of writing, GetX (aka Get) is the most-liked Flutter package (9.7k+ likes). This multi-purpose library provides a bunch of features, including state management, navigation & routing. You can also upload files to a......
Flutter: Rendering an Image from Byte Buffer/Int8List
Updated: Jul 14, 2022
In Flutter, you can render an image from an Int8List of bytes by using the Image.memory constructor like so: Image.memory(Uint8List.fromList(myBytes)); If what you have are byte buffers, use......
Flutter: Make a Widget Fill Remaining Space of Row/Column
Updated: Jul 10, 2022
In Flutter, you can make a widget fill up the remaining space of a Row or Column by wrapping it inside an Expanded or a Flexible widget. Example Preview: In this example, the amber box will occupy all of the free space of its......
TypeORM: Selecting Rows Between 2 Dates
Updated: May 03, 2022
The examples below show you how to select records between two given dates in TypeORM. The first one uses the find() function and the second uses query builder. Here’s the user entity that will have a place in both examples: //......