技術情報

Flutterでアドレス、件名、本文のあるメールアプリケーションを開く方法

今回は自分のメールアプリをFlutterの方から開く方法を紹介します。

まずは、pubspec.yamlで開く必要があるpackageを追加します。

 url_launcher: ^6.1.5

アドレス、件名、本文を指定してメールアプリを開く方法

String email = Uri.encodeComponent("mail@fluttercampus.com");
String subject = Uri.encodeComponent("Nice to meet u Flutter Team");
String body = Uri.encodeComponent("Hello!I'm Flutter Developer");
Uri mail = Uri.parse("mailto:$email?subject=$subject&body=$body");
if (await launchUrl(mail)) {
    
}else{
    
}

ボタンをタップする時、上記のことをコールます。

ElevatedButton(
  onPressed: ()async{
       //上記のことをコール
    },
child: Text("今すぐメールを送る")
);



Emmetの使用(3)

今回はHTMLマークアップを効率的に記述することができる
Emmet(エメット)を紹介したいと思います。
本記事は前回の「Emmetの使用(2)」の続きとなります。

続きを読む

A useful library for automating emails in Node JS

Today I would like to share about a library that can be used for handling email automation with Node JS. Let’s take a look.

This useful library is Candymail. Candymail is an open-source NPM library. It can trigger and send multiple email sequences with a single JSON file. This library is very easy to use and flexible for handling email processes.

You can check it out here for more details. There is also github repo.

Hope you enjoy that for today.

By Asahi



WebdriverIO

WebdriverIO is an open source test automation framework written in JavaScript and running on NodeJS. This is especially useful when testing his web apps and native mobile apps for iOS devices. It supports both behavior-driven development (BDD) and test-driven development (TDD), making it a highly preferred choice for automation testers.

What is WebdriverIO? - DEV Community 👩‍💻👨‍💻

WebdriverIO is based on NodeJS, an implementation of the JSON Wire protocol. It communicates using NodeJS, packaged on npm, open source and widely used for app development. Run automated tests using RESTful architecture.

A user writes a test script in JavaScript using his WebdriverIO library. Service requests are sent as HTTP commands via NodeJS. It uses the JSON Wire protocol and the service module forwards the request to the browser.

Upon receiving the command, the browser performs the user’s action. This proves the functionality of the application.

Credit: BrowserStack

A common reason to use WebdriverIO is to be able to test native mobile apps for iOS-enabled devices. It is very useful for QA because of its simple structure and the ability to write test scripts concisely.

WebdriverIO easily integrates with third-party test solution providers such as BrowserStack. This gives QA easy access to additional features such as recording tests, using real cloud devices and browsers, and test reports.

Yuuma



flutterでモバイル/Wifiのようなネットワーク接続を確認する方法

今回は、Flutterのインターネット接続の種類が、モバイルデート、wifi接続、Bluetooth接続、Ethernet接続のいずれであるかを確認する方法をご紹介します。

まずはpubspec.yaml ファイルにパッケージを追加する。

connectivity_plus: ^2.3.6

インターネット接続の種類を確認する方法

  checkConnection() async{
    var connectivityResult = await (Connectivity().checkConnectivity());
    if (connectivityResult == ConnectivityResult.mobile) {
      cType = "Mobile Data";
    } else if (connectivityResult == ConnectivityResult.wifi) {
      cType = "Wifi Network";
    }else if(connectivityResult == ConnectivityResult.ethernet){
      cType = "Ethernet Network";
    }else if(connectivityResult == ConnectivityResult.bluetooth){
      cType = "Blutooth Data connection";
    }else{
      cType = "none";
    }

    setState(() {
      
    });
  }

上記の機能をinitState()で呼び出します。

  void initState() {
    checkConnection();
    super.initState();
  }

表示ようコード

Scaffold(
        appBar: AppBar(
            title: const Text("Check Network Connection Type"),
            backgroundColor: Colors.blueAccent
        ),
        body: Container(
            padding: EdgeInsets.only(top:20, left:20, right:20),
            alignment: Alignment.topCenter,
            child: Column(
              children: [
                Text("Connection Type: $cType", style: TextStyle(fontSize: 20),),
              ],)
        )
    );

金曜担当 – Ami




アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム