# Flutter

Flutter (opens new window) is an open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase.

Below is an example of a function that sends emails with some template parameters and returns true or false values based on the result. It uses the emailjs (opens new window) package for flutter.

import 'package:emailjs/emailjs.dart';

Future<bool> sendEmail(dynamic templateParams) async {
  try {
    await EmailJS.send(
      'YOUR_SERVICE_ID',
      'YOUR_TEMPLATE_ID',
      templateParams,
      const Options(
        publicKey: 'YOUR_PUBLIC_KEY',
      ),
    );
    print('SUCCESS!');
    return true;
  } catch (error) {
    if (error is EmailJSResponseStatus) {
      print('ERROR... ${error.status}: ${error.text}');
    }
    print(error.toString());
    return false;
  }
}