Login with Huawei Account Kit Huawei StoryApp [Flutter]

Shiddalingeshwar M S
3 min readFeb 11, 2022

--

Introduction

In this article, we will be integrating Account Kit in Huawei StoryApp. Flutter plugin provides simple and convenient way to experience authorization of users. Flutter Account Plugin allows users to connect to the Huawei ecosystem using their Huawei IDs from the different devices such as mobiles phones and tablets, added users can login quickly and conveniently sign in to apps with their Huawei IDs after granting initial access permission.

Development Overview

You need to install Flutter and Dart plugin in IDE and I assume that you have prior knowledge about the Flutter and Dart.

Hardware Requirements

· A computer (desktop or laptop) running Windows 10.

· A Huawei phone (with the USB cable), which is used for debugging.

Software Requirements

· Java JDK 1.7 or later.

· Android studio software or Visual Studio or Code installed.

· HMS Core (APK) 4.X or later.

Integration process

Step 1: Create flutter project.

Select flutter and correct sdk path
Add project name and package name and project location

Step 2: Add the App level gradle dependencies. Choose inside project Android > app > build.gradle.

Root level gradle dependencies

Step 3: Add the below permissions in Android Manifest file.

Step 4: Download flutter plugins

Flutter plugin for Account kit

Step 5: Add downloaded file into parent directory of the project. Declare plugin path in pubspec.yaml file under dependencies.

Add path location for asset image.

Add images and enable in yaml file
add required dependencies in yaml file

Let’s start coding

Provides LoginScreen UI for user
Main page of the StoryApp
Define your custom Icons
Provides list data like arrays, url

Result

Output of the Huawei StoryApp with Huwei ID login

Tricks and Tips

  • Make sure that downloaded plugin is unzipped in parent directory of project.
  • Makes sure that agconnect-services.json file added.
  • Make sure dependencies are added yaml file.
  • Run flutter pug get after adding dependencies.
  • Make sure that service is enabled in agc.
  • Makes sure images are defined in yaml file.

Conclusion

In this article, we have learnt how to integrate Account Kit into Huawei StoryApp for flutter. Once Account kit integrated, users can login quickly and conveniently sign in to apps with their Huawei IDs after granting initial access permission.

Thank you so much for reading, I hope this article helps you to understand the Huawei Account kit in flutter.

Reference

Account Kit

Checkout in forum

--

--

No responses yet