Create a Select (Picker) Component in React Native

Create a Select (Picker) Component in React Native

Tiempo de lectura: 2 minutos Reading time: 2 minutes In today’s React tutorial, I will show you how to create a select (combo or picker) where you can choose different options. The first thing we need to do is import the library we are going to use (react-native-picker-select): npm install react-native-picker-select Once imported, let’s create the component. First, we import … Read more

Error when loading an image with svg extension (Flutter-Dart): Failed to detect image file format using the file header – Invalid image data.

Error when loading an image with svg extension (Flutter-Dart): Failed to detect image file format using the file header – Invalid image data.

Tiempo de lectura: 2 minutos Reading time: 2 minutes When trying to display an image with the svg extension, I encountered the following error: @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(“WELCOME to DevCodeLight”), Container( width: 200.0, height: 200.0, child: Image.asset(‘lib/images/android/splahs_android.svg’)), ], ), ), ); } I solved it by adding the … Read more

Adding Location Permissions in React Native

Adding Location Permissions in React Native

Tiempo de lectura: 2 minutos Reading time: 2 minutes Good afternoon, In today’s tutorial, I’m going to show you how to enable location permissions on your device. Let’s get started First, we import the API import * as Location from ‘expo-location’; Inside our component, we add the following function that will be responsible for enabling location permissions. const [errorMsg, setErrorMsg] … Read more

Adding color to a BodyComponent element using Flame in Flutter

Adding color to a BodyComponent element using Flame in Flutter

Tiempo de lectura: 2 minutos Reading time: 2 minutes In this tutorial, I’m going to explain how you can add colors to BodyComponent elements in Flame Engine (https://examples.flame-engine.org). In this example, I’m going to add a BodyComponent representing a blue bar. class BlueBar extends BodyComponent { // Passed parameters final double positionX; final double positionY; final double angularVelocity; // Constructor … Read more

Send an Email or Make a Phone Call from Your React Native App

Send an Email or Make a Phone Call from Your React Native App

Tiempo de lectura: < 1 minuto Reading time: < 1 minute Today I’m going to show you how to send an email or make a phone call from React Native. To use this function, we’ll import the Linking library from React Native: https://reactnative.dev/docs/linking import { Linking } from "react-native"; To implement a phone call, we’ll use the same syntax as in ... Read more

Remove accents in a Javascript string

Remove accents in a Javascript string

Tiempo de lectura: < 1 minuto Reading time: < 1 minute To remove accents (diacritics) from a String using Javascript, follow these steps: We have the following String: var text = "Camión"; To remove punctuation marks, we need to use the following function (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize): function stripAccents(s) { return s.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } This way, when using the function, we can remove the ... Read more

Flutter Project in VSCode

Flutter Project in VSCode

Tiempo de lectura: 3 minutos Reading Time: 4 minutes Today I’m going to show you how to open a Flutter project in VSCode to work in this environment. First, let’s install the Flutter SDK on our PC: Go to the official website https://docs.flutter.dev/get-started/install/windows Choose the corresponding installation: Next, extract the flutter folder to the directory where you want to install … Read more

Issue: react-native-paper CheckBox not displaying on iOS but works on Android

Issue: react-native-paper CheckBox not displaying on iOS but works on Android

Tiempo de lectura: 2 minutos Reading time: 2 minutes When implementing a checkbox from the React Native Paper library Checkbox React Native Paper on Android, the element appears correctly, but on iOS, the checkbox box is not displayed: iOS Display: Android Display: If we look at the documentation (Checkbox React Native Paper), it indicates that the boxes appear on Android, … Read more