ML Kit and Text Recognition in Flutter

ML Kit and Text Recognition in Flutter


All in one Flutter Resource: https://flatteredwithflutter.com/ml-kit-and-text-recognition-in-flutter/

ML Kit demo

ML (Machine Learning) Kit was one of the key highlights in Google I/O 2018. This kit is comprised of

  1. Image Labeling
  2. Text- Recognition
  3. Face- Detection
  4. Barcode- scanning
  5. Landmark- detection
Image for post
Image for post
From google site…

I decided to explore more about it and utilize the power of ML Kit in Flutter. Programmers have started working on this kit globally.

One of the efficient flutter packages, I came across was from azihsoyn

mlkit 0.4.1 — A Flutter plugin to use the Firebase ML Kit.

We simply need to import this package in our pubspec.yaml file as

Image for post
Image for post
Ml Kit package

ML kit is built to work with firebase. So, we create a project in firebase console

Please note that the name of your app should be same in the Firebase, your project’s manifest.xml (if playing in android) and in the app-level build.gradle (if playing in android).

Image for post
Image for post
app-level build.gradle
Image for post
Image for post
manifest.xml
Image for post
Image for post
Firebase console

Include the google-services.json in the app directory of android. (one of the steps in Firebase project setup).

There is a example given by azihsoyn for how to use this package for building flutter app @

https://pub.dartlang.org/packages/mlkit#-example-tab-

One additional package, we needed to install for getting images from gallery.

Image for post
Image for post
Final pubspec.yaml

import ‘package:image_picker/image_picker.dart’;

Finally, you can go ahead and run your flutter app.

Image for post
Image for post
App Screen

Click on the floating button and it opens gallery. You select some image and it recognizes the text from that image..

Great work by Mr. azihsoyn……..



The Flutter Pub is a medium publication to bring you the latest and amazing resources such as articles, videos, codes, podcasts etc. about this great technology to teach you how to build beautiful apps with it. You can find us on Facebook, Twitter, and Medium or learn more about us here. We’d love to connect! And if you are a writer interested in writing for us, then you can do so through these guidelines.

Image for post
Image for post

Written by

Founder of Flatteredwithflutter.com | YouTuber | Writer at FlutterPub, FlutterCommunity | Experimenting FlutterWeb

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store