Basic Utils

A dart package for many helper methods fitting different situations.

Table of Contents

  1. Install
  2. Import
  3. Usage
  4. Changelog
  5. Copyright and license

Install

pubspec.yaml

Update pubspec.yaml and add the following line to your dependencies.

dependencies:
  flutter_id4me_login: ^0.3.0

Import

Import the package with :

import 'package:flutter_id4me_login/flutter_id4me_login.dart';

Usage

To integrate the Id4me login into your app, add the Id4meLoginButton inside your app.

Id4meLoginButton(
  properties,
  claimsParameters,
  "assets/img/id4meloginbtn.png",
  (Map<String, dynamic> userInfo) => Navigator.push(context,MaterialPageRoute(builder: (context) => Home(userInfo))),
  () => print("Error while login")
)

The tap on the button will trigger a small dialog/modal with a input field for the id4me login data. The tap on the "Login" button will then trigger the id4me login flow.

Button parameters

NameTypeRequiredDescription
propertiesMap<String,dynamic>XThe Id4me properties
claimsParametersMap<String,dynamic>XThe Id4me claimsparameters
imageLocationStringXThe location of the image for the button
onSuccessFunction(Map<String,dynamic>)XFunction to call after successfull login
onErrorFunction()XFunction to call after failed login
heightdoubleThe height of the button. Default = 45
inputDecorationInputDecorationThe InputDecoration for domain input widget
loginBtnTextStringThe text for the login button. Default = Login
cancelBtnTextStringThe text for the cancel button. Default = Cancel
modalHintTextStringAn additional hint text, displayed in the modal

Changelog

For a detailed changelog, see the CHANGELOG.md file

View LICENSE

Libraries

flutter_id4me_login