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

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.