Detecting and Fetching Bank Card Details using Huawei ML Kit in Flutter

Shiddalingeshwar M S
4 min readDec 3, 2021

In this article, we will be integrating Huawei ML kit feature to recognise and fetch the Bank Card details, it is time consuming and difficult to read and enter the Bank Card details in the application, Huawei makes this very easy and simple to implement. We will see how to integrate and implement Huawei ML kit Bank Card feature in this sample. And also we will see the Flutter latest feature like URL Launcher in this sample.

Introduction

In this article, we will be integrating Huawei ML kit feature to recognise and fetch the Bank Card details, it is time consuming and difficult to read and enter the Bank Card details in the application, Huawei makes this very easy and simple to implement. We will see how to integrate and implement Huawei ML kit Bank Card feature in this sample. And also we will see the Flutter latest feature like URL Launcher in this sample.

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 or Visual Studio or Code installed.
  • HMS Core (APK) 4.X or later.

Integration process

Step 1: Create flutter project

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 Huawei ML Kit

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

Step 6: Generating and Adding SHA-265 key

Use following cmd in Terminal navigate to your project inside android directory like

D:\AndroidStudioProjects\yourproject\android>gradlew signingReport

Add generated SHA-256 key in ag-connect

Let’s start coding

How do I check required permissions status?

How do I choose image for bank card?

How do I scan bank card directly from camera?

How do I use URL Launcher feature?

Result

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 gradle file.
  • Run flutter pug get after adding plugin.
  • Make sure that service is enabled in agc.
  • Make sure that you have upgraded to latest versions of Flutter and Dart.

Conclusion

In this article, we have learnt to integrate Huawei ML Kit in Flutter 2mg.in. Huawei Mobile Services provides very simple and convenient way to integrate ML kit as we can see above sample, we are able to get desired result, steps are very easy and it makes developer life very easy and helps build application very quickly.

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

Reference

Huawei ML Kit Services

Checkout in forum

--

--