Table of Contents
Project: Send SMS Application in Flutter
About the App:
This is an application that has a Flutter Plugin for sending SMS and MMS on Android and iOS. If you send to more than one person it will send as MMS. On the iOS if the number is an iPhone and iMessage is enabled it will send as an iMessage.
How To Use
You can send multiple ways:
- Message and No People
- People and No Message
- Message and People
This will populate the correct fields.
Example
Make sure to Install and Import the Package.
import 'package:flutter_sms/flutter_sms.dart';
Create a function for sending messages.
void _sendSMS(String message, List<String> recipents) async { String _result = await sendSMS(message: message, recipients: recipents) .catchError((onError) { print(onError); }); print(_result); }
You can quickly send the message with this function.
String message = "This is a test message!"; List<String> recipents = ["1234567890", "5556787676"]; _sendSMS(message, recipents);
Output Screenshots:
android send sms flutter
Requirements:
- Download the last version of Android Studio SDK
- Download and Install Flutter SDK
- Install the plugin Flutter and Dart for VS Code or Flutter in Android Studio
Run on the project folder:
- Check if the branch is origin/develop.
- Then run in terminal flutter packages get.
- If you don’t want to emulate the SDK on your computer, you need to connect your mobile phone.
- After that run with F5 if you use Visual studio code or run with the button play in Android Studio.
Online Demo Here: https://fluttercommunity.github.io/flutter_sms/
Download Here