pub package

A Flutter plugin to get details from aadhaar xml on Android and iOS

. Supports iOS, Android.


To use this plugin, add flutter_aadhaar_xml_sdk as a dependency in your pubspec.yaml file.



Add following in AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Add following in build.gradle

        minSdkVersion 18
        targetSdkVersion 29

Add following in styles.xml

<?xml version="1.0" encoding="utf-8"?>

    <!-- Theme applied to the Android Window while the process is starting -->
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             Flutter draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
    <!-- Theme applied to the Android Window as soon as the process has started.
         This theme determines the color of the Android Window while your
         Flutter UI initializes, as well as behind your Flutter UI while its
         This Theme is only used starting with V2 of Flutter's Android embedding. -->
    <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <item name="android:windowBackground">@android:color/white</item>

Replace activity theme with following



Add following in Podfile

source 'https://github.com/CocoaPods/Specs.git'

source 'https://bitbucket.org/ios-external/podspecs.git'

target '${OfflineKYCExample}' do


  pod 'OfflineAadhaar'


Add following in Info.plist.



import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'dart:io';
import 'package:flutter_aadhaar_xml_sdk/AndroidAadhaarModel.dart';
import 'package:flutter_aadhaar_xml_sdk/IosAadhaarModel.dart';
import 'package:flutter_aadhaar_xml_sdk/flutter_aadhaar_xml_sdk.dart';

void main() {

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  String _xmlData = 'Unknown';

  void initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    // HashMap map1 = new HashMap<dynamic, dynamic>();

    // String platformVersion;
    // Object deviceObject;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      String token =
      String env = "test";
      String client = "";
      AndroidAadhaarModel androidMap;
      String finalVal = "";
      IosAadhaarModel iosMap;
      if (Platform.isAndroid) {
        androidMap = await FlutterAadhaarXmlSdk.startSdk(token, env, client);
        String name = androidMap.name;
        String dob = androidMap.dob;
        print("name is ${name} and dob is ${dob}");
        finalVal = "name is ${name} and dob is ${dob}";
      } else if (Platform.isIOS) {
        iosMap = await FlutterAadhaarXmlSdk.startSdk(token, env, client);
        String name = iosMap.name;
        String dob = iosMap.dob;
        print("name is ${name} and dob is ${dob}");
        finalVal = "name is ${name} and dob is ${dob}";

      setState(() {
        _xmlData = finalVal;
      // return map1;
    } on PlatformException {
      // platformVersion = 'Failed to get platform version.';

      // If the widget was removed from the tree while the asynchronous platform
      // message was in flight, we want to discard the reply rather than calling
      // setState to update our non-existent appearance.
      if (!mounted) return;

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        body: Center(
          child: Text('$_xmlData\n'),

enum EnumEnv { prod, beta, test }

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.