Connect a Flutter Application to a WebSocket

Connect a Flutter Application to a WebSocket

Tiempo de lectura: < 1 minuto Today we are going to learn how we can connect a Flutter APP to a WebSocket quickly and simply. Step 1: Flutter Project Setup flutter create my_app Replace «my_app» with the name you want for your project. We will use the web_socket_channel library: https://pub.dev/packages/web_socket_channel To add the dependency, run: flutter pub add web_socket_channel Run flutter … Read more

Adding Audio or Sounds in Flutter

Adding Audio or Sounds in Flutter

Tiempo de lectura: 2 minutos To add audio or sounds in Flutter, we’ll use the audioplayers library. First, we install it: flutter pub add audioplayers Then, run flutter pub get in your terminal to install the dependency. If you haven’t already, organize your Flutter project so that you have a folder for assets like images and sounds. For example: – … Read more

How to Get Current Location (Latitude and Longitude) in Flutter

Tiempo de lectura: < 1 minuto To quickly and easily get the current location, follow these steps: First, make sure you have added the geolocator dependency in the pubspec.yaml file: geolocator: ^7.0.3 Then, run flutter pub get to install the dependency. Next, add the necessary permissions in the AndroidManifest.xml file: Then implement the following code, which will request location permissions, get … Read more

Create a Release-Ready APK/AAB Package with Flutter in Visual Studio Code

Create a Release-Ready APK/AAB Package with Flutter in Visual Studio Code

Tiempo de lectura: 2 minutos Today we are going to learn how we can generate an APK or AAB to distribute or publish our application to the app store using Flutter and VS Code. We have to create an application signing file with the following command: keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload Indicate … Read more

Transform Android XML Vector to SVG Using the Command Line

Transform Android XML Vector to SVG Using the Command Line

Tiempo de lectura: < 1 minuto We will learn today how to transform an Android XML vector into a vector in SVG format using the command line. With the vector in SVG, we can use it both in React, Flutter or Web. First, we will install this library (if we want to use the web version): npm install -g vector-drawable-to-svg Once … Read more

Button component using Flutter in Dart language

Button component using Flutter in Dart language

Tiempo de lectura: 2 minutos In this post, we will create a customizable button component in Flutter using the ElevatedButton widget. This component will allow us to create buttons with text, icon, and customize various aspects like color, text size, and button width. import ‘package:flutter/material.dart’; import ‘../util/constants/Colors.dart’; class Button extends StatelessWidget { final Color? color; // Now optional and can … Read more

Select Dropdown Options Widget or DropdownButton in Dart using Flutter

Select Dropdown Options Widget or DropdownButton in Dart using Flutter

Tiempo de lectura: 2 minutos Today we are going to create a custom widget called CustomDropdownButton, which is used to display a DropdownButton with selectable options. The widget accepts three parameters: import ‘package:flutter/material.dart’; import ‘../comun/Option.dart’; class CustomDropdownButton extends StatefulWidget { final Option selectedOption; final List options; final void Function(Option?) onChanged; CustomDropdownButton({ required this.selectedOption, required this.options, required this.onChanged, }); @override _CustomDropdownButtonState … Read more

Add Google Sign Auth in Flutter

Add Google Sign Auth in Flutter

Tiempo de lectura: 4 minutos Today we are going to learn how we can implement Google authentication in our Flutter app. Let’s go to Google Cloud Platform (https://cloud.google.com/) and click on Console Now select our project (if we already have it created by Firebase) or create a new one. Now search for: oauth clients Choose External: Fill in the application … Read more