Adding a POST Request in Flutter (Dart)

Adding a POST Request in Flutter (Dart)

Tiempo de lectura: 4 minutos Reading Time: 2 minutes Hello, today we are going to learn how to make a POST request with Flutter using Dart. With this request, we will be able to make remote calls to our server-side resources using a REST API. We will use the http package to perform the network request. Step 1: Add Dependencies … Read more

Flutter en contenedor Docker Compose para ejecutar en navegador web

Flutter en contenedor Docker Compose para ejecutar en navegador web

Tiempo de lectura: 3 minutos Reading Time: < 1 minute Hello, today we are going to see how we can use Docker Compose to run Flutter in the web browser of the host machine where Docker is running. The first thing we are going to do is create the docker-compose.yml file and add the following content: version: "3.1" services: flutter: ... Read more

Docker Compose Container for Running Flutter on ARM64

Docker Compose Container for Running Flutter on ARM64

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Hello, today we are going to see how we can run the Flutter environment on an ARM64 processor using Docker Compose. First, let’s create a docker-compose.yml: version: "3.1" services: flutter: build: context: ./Dockerfile dockerfile: flutter_arm restart: unless-stopped container_name: flutter volumes: - ./app_path:/home/mobiledevops/app networks: - docker-network networks: docker-network: driver: bridge external: ... Read more

Customize a Loader in Flutter – Dart

Customize a Loader in Flutter – Dart

Tiempo de lectura: 2 minutos Reading time: 2 minutes I’m going to show you an example of how to customize a loader to appear when we need to load data in our application. The loader element is as follows: class Loader extends StatelessWidget { @override Widget build(BuildContext context) { return Center( child: Container( padding: EdgeInsets.all(16.0), decoration: BoxDecoration( color: Colors.white, borderRadius: … Read more

Change Flutter App Theme from Light to Dark

Tiempo de lectura: < 1 minuto Reading time: < 1 minute First, we need to add the provider dependency inside the pubspec.yaml file. dependencies: flutter: sdk: flutter provider: ^5.0.0 To modify the theme of an application, I’ll show an example below: import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; void main() { runApp( ChangeNotifierProvider( create: (context) => ThemeProvider(), child: MyApp(), ), ); } class ThemeProvider … Read more

Search Bar and Filter in Flutter Dart

Tiempo de lectura: < 1 minuto Reading Time: < 1 minute To create a search bar and filter a list, follow these simple steps: The list of elements we will display and filter is as follows: List<dynamic> tutorsData = [ { “name”: “Maria”, “email”: “example1_devcodelight@email.com”, “phone”: “1234567890” }, { “name”: “Laura”, “email”: “example2_devcodelight@email.com”, “phone”: “1234567890” }, { “name”: “Isma”, “email”: “example3_devcodelight@email.com”, … Read more

Create Flutter Environment with Docker Compose to Generate Web/Android/Linux Builds

Create Flutter Environment with Docker Compose to Generate Web/Android/Linux Builds

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Hello everyone, today we are going to see how we can create a Flutter environment using Docker containers that will allow us to generate a build of our project. This environment will allow us to both develop and generate an APK or web with our Flutter project. The first thing ... Read more

Fix Target dart2js failed error: Exception: Warning: The ‘dart2js’ entrypoint script is deprecated, please use ‘dart compile js’ instead. In Flutter

Fix Target dart2js failed error: Exception: Warning: The ‘dart2js’ entrypoint script is deprecated, please use ‘dart compile js’ instead. In Flutter

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Today we’re going to see how to solve the following error: Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead. Error: Cannot run with sound null safety, because the following dependencies don't support null safety: - package:http - package:http_parser This error is ... Read more

UTF-8 Encoding Solution when Receiving Data by Making a GET Request Using Flutter – Dart

UTF-8 Encoding Solution when Receiving Data by Making a GET Request Using Flutter – Dart

Tiempo de lectura: < 1 minuto Reading time: < 1 minute When making a GET request using Flutter and the Dart programming language, I encountered an error while trying to display certain data. The encoding error occurs when receiving information with some characters, and when displaying them in the user interface, they are not shown correctly. To fix the error shown ... Read more

Creating a Simple List in Flutter – Dart

Creating a Simple List in Flutter – Dart

Tiempo de lectura: 3 minutos Reading time: 3 minutes To create an example list where we can add an element, update the list, and also remove elements, follow these steps: First, we create the main Widget that we call from main, where we display the .dart class with the designed view. void main() => runApp(MyApp()); class MyApp extends StatelessWidget { … Read more