Posts

Showing posts with the label package

[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...

[Flutter tip] Package to simulate different devices to run your app

Image
  If sometimes you get crazy trying to test your Flutter application on different devices, like on an iPhone or any other Android devices, I have a pretty simple and convenient way to figure it out ! Use the following package, there are many options that will make you gain a lot of time! Like choosing between all different kind of devices, setting dark or light theme dynamically and much more.You should give a try to the following package:  Package on pub.dev : device_preview https://pub.dev/packages/device_preview Enjoy!

[Flutter] Get some special directories path

Image
I'm sure, if you are a Flutter's developer, that you will need one day to get specific paths, for instance to store files, generate temporary files etc... Path_provider package For that I use the 'path_provider' package that has some helpers methods. For example: Future < Directory >   getApplicationDocumentsDirectory ( ) returns the documents directory. How to use it ? Directory tempDir = await getTemporaryDirectory(); String tempPath = tempDir.path; Directory appDocDir = await getApplicationDocumentsDirectory(); String appDocPath = appDocDir.path; Follow the links: Package:  https://pub.dev/packages/path_provider Package's documentation:  https://pub.dev/documentation/path_provider/latest/index.html

[Flutter] Translations, internationalisation with GetX package

Image
As applications are actually spread around the world, a common task to implement when developing your app (mobile, web or desktop), is to setup a multi-language option .  In Flutter, it can be done easily with the GetX Package (a useful package that provides a lot more services ! You should take a look if you don't know this package:  GetX package on pub.dev . The implementation steps are the following: 1-Add GetX package to your solution You can do it the traditional way you like. For instance with "Pub Assist" extension: Shift+CMD+P > Pub asssist: add/upgrade > get 2-Use a GetMaterialApp Important step, do not forget to use the GetMaterialApp classe instead of Flutter's MaterialApp: @ override Widget build ( BuildContext context ) { return GetMaterialApp ( 3-Add a translation file Next you have to add a class that will embed all your strings declaration / translations. This class must extends the GetX's Translation class. Here is an example: ...

[Fast&Furious guide] Setup a continuous integration process with TFS2013

Image
The goal of this post is to present you ( very quickly ) how to set up a TFS server (give you the steps) in order to get a continuous build integration environment. We will also talk about continuous deployement. For all the details, please take a look at the bottom of this post for the reference links... To summarize, the continuous integration process will help your team to merge their working copies  of your application code and to discover faster when a build fails. The reasons why a build fail can be multiple: - errors in code - a test fails - code analysis fails... We will take a look at the following points: - Configure the TFS Server - Create a new build definition - Insert tests in your build process - Manage team project's check-in policies - Deal with NuGet packages - Automatically deploy your project with MsDeploy. Setup your TFS 2013 server First you need to have a server that will manage and build your code. Install a TFS server and configu...