humanid_flutter_sdk 0.0.5
humanid_flutter_sdk: ^0.0.5 copied to clipboard
Human ID Flutter SDK
HumanID Flutter SDK
General Documentation • Contributing • Gallery • FAQ
Meet humanID - An anonymous online identity, enabling platforms to offer the speed and comfort of social logins, while guaranteeing absolute privacy and protecting our communities by permanently blocking bots, spams, and trolls.
Requirements #
- Dart
- Flutter SDK
Please update to the latest stable SDK!
Installation #
pubspec.yaml
dependencies:
humanid_flutter_sdk: ^0.0.5
Credentials Access #
Create an account and an app at our developer console.
How to use #
Init HumanId SDK
void main() {
initHumanIdSdk();
runApp(const MyApp());
}
Configure HumanId SDK
Put HumanId SDK on the page you want to implement, and dont forget to set client id and client secret from your account
import 'package:flutter/material.dart';
import 'package:humanid_flutter_sdk/di/injector.dart';
import 'package:humanid_flutter_sdk/presentation/humanid_flutter_sdk.dart';
import 'package:humanid_flutter_sdk/values/country_code.dart';
import 'package:humanid_flutter_sdk/values/supported_language.dart';
HumanIDSdk(
language: SupportedLanguage.ENGLISH_US,
priorityCountry: [
CountryCode.UNITED_STATES,
CountryCode.INDONESIA,
CountryCode.JAPAN,
],
clientId: 'PUT_YOUR_CLIENT_ID',
clientSecret: 'PUT_YOUR_CLIENT_SECRET',
wrapperWidget: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0),
color: const Color(0xFF075070),
),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 12),
child: const Text(
'Continue with HumanID',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.w700),
),
),
onLoginSuccessfully: (exchangedToken) {
setState(() {
token = exchangedToken;
});
},
),
Set Language
There are several language lists from the SDK, and you can set language for the SDK
HumanIDSdk(
language: SupportedLanguage.ENGLISH_US,
)
Set Priority Country
There are several country lists from the SDK, and you can set your priority countries for the SDK
HumanIDSdk(
priorityCountry: [
CountryCode.UNITED_STATES,
CountryCode.INDONESIA,
CountryCode.JAPAN,
],
)
Get exchanged token
You can get a exchanged token from this callback
onLoginSuccessfully: (exchangedToken) {
setState(() {
token = exchangedToken;
});
},
You're set! #
Now you can integrate your Flutter app to humanID. See the full sample here to learn more.
License #
Copyright 2019-2020 Bluenumber Foundation Licensed under the GNU General Public License v3.0