getnet_pos
A plugin wrapper to use getnet pos hardware sdk in your flutter apps.
ONLY WORKS ON ANDROID FOR NOW
Usage
Configure your project
Change minSdkVersion to 22 in your app
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.test_getnet_pos_package"
minSdkVersion 22
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
In android/app folder add the getnet sdk dependency (must have .aar extension)
.
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── libs
│ │ │ └── libposdigital-1.4.0-2-release.aar
print method
You can pass a list of string as argument. The first element of the list is the header. Print barcode and QrCode if find a text that match the given patterns.
import 'package:getnet_pos/getnet_pos.dart';
...
try {
GetnetPos.print(
[
"Header is the first line",
"Content line 1",
"Content line 2",
],
printBarcode = false, //default is true
barcodePattern = '^\\d{1,}.\$', //by default
qrCodePattern = '^\\d{1,}.\$', //by default
);
} on PlatformException {
..
}
getMifareCardSN method
You can get the card serial number via contactless just invoking this method.
import 'package:getnet_pos/getnet_pos.dart';
...
GetnetPos.getMifareCardSN().then((cardSerialNumber) {
// Do anything with serial number here!
debugPrint(cardSerialNumber);
}).catchError((error) => debugPrint(error));
scan method
You can scan qrcode/barcode using the device camera with this method.
import 'package:getnet_pos/getnet_pos.dart';
...
GetnetPos.scan().then((scanResult) {
// Do anything with serial number here!
debugPrint(scanResult);
}).catchError((error) => debugPrint(error));
Libraries
Dart
- dart:ui
- Built-in types and core primitives for a Flutter application. [...]
- dart:async
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- dart:collection
- Classes and utilities that supplement the collection support in dart:core. [...]
- dart:convert
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- dart:core
- Built-in types, collections, and other core functionality for every Dart program. [...]
- dart:developer
- Interact with developer tools such as the debugger and inspector. [...]
- dart:math
- Mathematical constants and functions, plus a random number generator. [...]
- dart:typed_data
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- dart:io
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- dart:isolate
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]