stealth_id 0.0.8 copy "stealth_id: ^0.0.8" to clipboard
stealth_id: ^0.0.8 copied to clipboard

A new flutter plugin project.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:stealth_id/stealth_id.dart';
import 'package:stealth_id_example/components/AuthExample.dart';
import 'package:stealth_id_example/components/CredentialExample.dart';
import 'package:stealth_id_example/components/DocumentExample.dart';
import 'package:stealth_id_example/components/EnrollExample.dart';

void main() {
  runApp(MyApp());
}

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

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

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      platformVersion = await StealthId.platformVersion;
    } 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;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: DefaultTabController(
      length: 4,
      child: Scaffold(
        appBar: AppBar(
          bottom: TabBar(
            tabs: [
              Tab(icon: Icon(Icons.verified_user)),
              Tab(icon: Icon(Icons.camera)),
              Tab(icon: Icon(Icons.account_box_outlined)),
              Tab(icon: Icon(Icons.vpn_key))
            ],
          ),
          title: const Text('Carespace Stealth Id Example App'),
        ),
        body: Container(
          child: Column(
            children: [
              Expanded(
                flex: 3,
                child: TabBarView(
                  children: [
                    AuthExample(),
                    EnrollExample(),
                    DocumentExample(),
                    CredentialExample()
                  ],
                ),
              ),
              Expanded(
                flex: 1,
                child: Center(
                  child: Text('Running on: $_platformVersion\n'),
                ),
              )
            ],
          ),
        ),
      ),
    ));
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on stealth_id