What is Flutter?
Flutter is an open-source UI software development kit introduced by Google. With Flutter you can use one programming language and a single codebase to create multiple applications for different platforms (e.g iOS and Android).
Flutter consists of two important parts:
- SDK (Software development kit): A collection of tools that helps you develop applications. It contains elements that turn the code into native machine code (which is also suitable for Android and iOS).
- Framework (based on UI library modules): A collection of reusable interface elements (buttons, text input, sliders, and more) that can be customized to suit your own needs.
What are the features of the Flutter app and why to use it?
First of all, Flutter is a modern system which is using Dart language (object-oriented programming language), and it can run on almost any device. Furthermore, Flutter is allowing "hot reload" – which means you change your code and see the results in real-time.
Here are additional benefits of using Flutter:
- Great UI
- Easy to learn and use
- Low cost development
- A growing community
- A variety of widgets
- Ideal for start-up ideas
Ensure you do the steps below to follow along with this tutorial:
- Create a 46elks account.
- Download the project's source code.
- Set up Flutter.
Install Flutter and choose if you want to use the Android setup or the iOS setup (you only need one).
Configure the app
Before sending an SMS, we need to do some small configurations to our app.
Open up the source code you downloaded, in your editor of choice.
Open the file
/lib/main.dartand change the variables
passwordto your own API credentials for the 46elks API (this is crucial to be able to send SMS).
Run the app
Now when the configuration is done we are going to run our Flutter app in a virtual device to try it out.
Depending on what setup you use, the process of running the app differs. Choose one of the alternatives below and follow the corresponding steps.
iOS (Mac terminal)
- Open the terminal and navigate to the project you downloaded:
- Open an iOS simulator:
open -a Simulator
- Run your flutter application:
Android (Android studio)
Open the Android Emulator.
Run the sample.
Your app should now have opened up in a virtual device on your screen. Let's continue to the next step on sending an SMS.
Send an SMS
With the app open on your screen, you will see two fields and a submit button.
- In the first field, enter the phone number to which you would like to send the SMS. Remember to write the phone number in the E.164 format.
- In the second field enter the message you would like to send.
- Once you filled in the information you can click on the submit button.
After submitting, you will receive the status of your message from the 46elks API. It will be show at the bottom of the virtual device. The owner of the phone number you entered, will receive the actual SMS to their physical device.
Now that you have successfully sent your first SMS via your Flutter app, let's have a look at additional benefits of using Flutter with 46elks:
- You can easily send SMS from a tablet or a phone without a SIM card.
- Flutter is compatible with mobile platforms as well as web and desktop apps.
- On your next trip abroad, sending SMS from your own Flutter app with 46elks could be a cheaper option than via your phone carrier.
- You can develop a single application for various purposes – just be creative!
In our documentation you will find more information on what you can do with SMS. Have fun with exploring the many possibilities with Flutter and 46elks.