Dart: Get Host, Path, and Query Params from a URL
In Dart, you can extract useful information from a given URL string by following the steps below: 1. Construct a Uri object from your URL string: 2. Now, you can get what you want through various…
Using GetX to make GET/POST requests in Flutter
GetX is a massively functional and open-source Flutter library that is the most popular these days, with over 10,000 likes on pub.dev. Although GetX provides a wide range of features, each feature is contained in a…
React: Create a Reusable Switch/Toggle Component
In web and mobile apps, a switch or a toggle lets users choose between a pair of opposing states, like ON and OFF, LIGHT and DARK, ACTIVE and INACTIVE, using a different appearance to indicate each…
React: Removing Items from a List (Full Example)
When developing web apps with React, there are innumerable cases where we have to render a list of things, such as a list of users, a list of tasks, a list of products, etc. In these…
React: Programmatically Scroll to Bottom/Top of a Div
This concise and practical article shows you how to programmatically scroll to the bottom or to the top of a scrollable div element in React. The TL;DR Here is the process that we will go through:…
React: Update Arrays and Objects with the useState Hook
This practical and straight-to-the-point article shows you how to update objects and arrays in the state in React correctly. We’ll use the useState hook and functional components. Without any further ado, let’s get started. The TLDR…
React: Changing Button Text on Click
The example below shows you how to change the text of a button after it gets clicked in React. We’ll use the useState hook to get the job done. App Preview The Code Explanation 1. Store…
React Router: 3 Ways to Disable/Inactivate a Link
This succinct, practical article shows you 3 different ways to disable/inactivate a Link in a React application that uses React Router 6 (the latest version). We will explore the fundamentals and then apply them in a…
Flutter: Adding a Border to an Elevated Button
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: In case you need to create a rounded border,…
Flutter: Adding a Border to an Icon Button (2 Approaches)
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…
React Router: How to Create a Custom Back Button
This practical article shows you how to implement a custom back button in a React application that uses React Router 6 (the latest version). Besides the browser’s back button, our custom back button will add convenience…
React: Show an element when hovering over another element
Let’s say we’re developing a React app, and we want to programmatically show a red box named box B when the mouse cursor is hovering over another box called box A. To achieve the goal, we…