Posts

Showing posts with the label tips

[Flutter tips] Easily send an email from your iOS and Android app (code included)

Image
When you design a mobile application, at some point, you will always need to propose the user a way to contact your or your support team. You can use different services or back-end, the most easy and fast way to achieve this functionality is to propose to the user to send you directly an email. Here are the steps to send an email. 1. Add package url_launcher In your yaml file: dependencies:   url_launcher: ^6.1.9 2. Use a correctly formatted link to send email In your controller, format your address like that, providing: - the recipient email address - and optionally a subject and a body    mailto :target@example.com? subject =Sujet& body =Contenu   3. Sample code import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; class EmailExample extends StatelessWidget { final String email = 'destinataire@example.com'; final String subject = 'Mon Sujet PrĂ©-rempli'; final String body = 'Bonjour, voici un exempl...

[GODOT for beginner tips] Global app's variables, states...

Image
While trying to develop my first game, I was wondering how to manage my game's "CONTEXT". Like maybe the current level, the global player's score or any other "GLOBAL" variables. GLOBAL variables (static in C#) can be used from any script. 1- Create a "global" script This is the script containing global variables and methods that will be accessible from every other script. Below here is an example of a global script called "App.cs": ==> you can see a static variable called "MainScene". This is the scene that can be accessible from everywhere (like a MENU scene for instance). 2- Make your script global In your project settings, find the "AutoLoad" tab and ACTIVATE the script "Global variable" parameter. Then you will be abble to access the script from everywhere. 3- Example of accessing the global variables In my mainscene script, I instantiate the app's (app.cs script) global variable by accessing it ...