mtrust_sec_kit 1.0.0-dev.1 mtrust_sec_kit: ^1.0.0-dev.1 copied to clipboard
A comprehensive SDK for interfacing with the MTrust SEC Readers. Including an example to get you started as fast as possible.
SEC Kit #
Overview #
The SEC Kit simplifies the integration of the M-Trust SEC-Reader into your Flutter application, providing secure and efficient communication capabilities.
Prerequisites #
- Flutter SDK installed on your machine.
- Familiarity with Flutter development.
- Access to the M-Trust SEC-Reader hardware.
Installation #
Add the mtrust_sec_kit
package to your Flutter project's pubspec.yaml
:
dependencies:
mtrust_sec_kit: ˆ1.0.0
SEC Kit can work with different URP Connection Strategy. The default for SEC Readers is BLE.
Add the ble connection strategy to your project by including it in your pubspec.yaml
file.
dependencies:
mtrust_sec_kit: ˆ1.0.0
# Add the BLE connection strategy
mtrust_urp_ble_strategy: ˆ8.0.1
Please follow the instructions for configuring BLE for your respective platform in the Readme of the BLE Strategy!
Usage #
Fonts #
SEC Kit utilizes the Lato font and custom icons. To include these assets, update your pubspec.yaml
:
fluter:
fonts:
- family: Lato
fonts:
- asset: packages/liquid_flutter/fonts/Lato-Regular.ttf
weight: 500
- asset: packages/liquid_flutter/fonts/Lato-Bold.ttf
weight: 800
- family: LiquidIcons
fonts:
- asset: packages/liquid_flutter/fonts/LiquidIcons.ttf
Localization #
To support multiple languages, add the necessary localization delegates to your application. For comprehensive guidance on internationalization, consult the flutter documentation.
return const MaterialApp(
title: 'Your awesome application',
localizationsDelegates: [
...LiquidLocalizations.delegate,
...UrpUiLocalizations.delegate,
...SecLocalizations.localizationsDelegates,
],
home: MyHomePage(),
);
Adding UI dependencies #
To utilize SEC Kit's UI components, incorporate the following providers and portals:
-
Theme Provider: Wrap your app with LdThemeProvider:
LdThemeProvider( child: MaterialApp( home: MyHomePage(), ), )
-
Portal: Enclose your Scaffold with LdPortal:
LdPortal( child: Scaffold( ... ), )
Use the SEC Sheet #
To display the SEC Sheet, utilize the SecSheet
widget. It requires a connection strategy, a payload, and callbacks for the verification process:
SecSheet(
strategy: _connectionStrategy,
payload: // Payload,
onVerificationDone: () {},
onVerificationFailed: () {},
builder: (context, openSheet) {
// Call openSheet to open the SEC Sheet
},
),
Configuration Options #
- Connection Strategies: While BLE is the default, SEC Kit supports various connection strategies. Ensure you include and configure the appropriate strategy package as needed.
Troubleshooting #
-
BLE Connectivity Issues: Verify that your device's Bluetooth is enabled and that the M-Trust SEC-Reader is powered on and in range.
-
Font Rendering Problems: Ensure that the font assets are correctly referenced in your
pubspec.yaml
and that the files exist in the specified paths.
Contributing #
We welcome contributions! Please fork the repository and submit a pull request with your changes. Ensure that your code adheres to our coding standards and includes appropriate tests.
License #
This project is licensed under the MIT License. See the LICENSE file for details.