FlutterSmartfaceMobilePlatform class
An abstract class that extends PlatformInterface
to define the
platform-specific implementation for the Flutter Smartface plugin.
This class serves as the base for all platform-specific implementations and ensures that the correct platform interface is used.
- Inheritance
-
- Object
- PlatformInterface
- FlutterSmartfaceBasePlatform
- FlutterSmartfaceMobilePlatform
Constructors
- FlutterSmartfaceMobilePlatform()
-
Factory constructor to return the singleton instance of the class.
If the instance doesn't exist, it creates a new one.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel ↔ MethodChannel
-
A MethodChannel that is used for communication between Flutter and the
native platform. This field is marked as
late
andfinal
, meaning it will be initialized later and cannot be reassigned. The@visibleForTesting
annotation indicates that this field is intended to be visible only for testing purposes.latefinalinherited - name → String
-
The name associated with the platform.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addGroupKeyA(
{required int groupKeyA}) → Future< Either< String, dynamic> > -
Adds a Group Key A to secure storage and invokes the native
SmartfaceMobile.addGroupKeyA
method. -
addGroupKeyB(
{required int groupKeyB}) → Future< Either< String, dynamic> > -
Adds a Group Key B to secure storage and invokes the native
SmartfaceMobile.addGroupKeyB
method. -
androidPlatformView(
String viewType, ValueNotifier< bool> isDetachedValueNotifier, ValueNotifier<bool> isLoadingValueNotifier, Widget? faceMaskOverlay, Widget? onLoadingWidget, Map<String, dynamic> creationParams) → Widget -
inherited
-
apiConfigured(
) → Future< bool> - Checks if the API is configured by verifying the presence of user, password, and clientIdentifier in secure storage.
-
clearGroupKeyA(
) → Future< Either< String, dynamic> > -
Clears (removes) the stored Group Key A from secure storage and invokes
the native method
SmartfaceMobile.clearGroupKeyA
. -
clearGroupKeyB(
) → Future< Either< String, dynamic> > -
Clears (removes) the stored Group Key B from secure storage and invokes
the native method
SmartfaceMobile.clearGroupKeyB
. -
closeCamera(
) → Future< void> - Closes the camera by invoking the 'closeActivity' method on the method channel.
-
defaultPermissionUI(
BuildContext context, Future requestPermission(BuildContext)) → Widget -
A default UI widget for handling permission requests.
inherited
-
disableDebugger(
) → Future< void> - Disables Smartface internal debugger/logging (native side must implement the method).
-
enableAutoContrast(
bool enable) → Future< void> -
enableCheckImageQuality(
bool enable) → Future< void> - Enables or disables the check for image quality.
-
enableDebugger(
) → Future< void> - Enables Smartface internal debugger/logging (native side must implement the method).
-
enrollFinishActivity(
{required bool withGlasses, dynamic onPercentageChanged(dynamic)?, dynamic onPushing(dynamic)?, dynamic onCompleted(dynamic)?, dynamic onFailed(dynamic)?}) → Future< void> - Completes the enrollment activity with the specified parameters.
-
enrollFinishWithoutPushingActivity(
{required bool withGlasses, dynamic onPercentageChanged(dynamic)?, dynamic onCompleted(Map< String, dynamic> )?, dynamic onFailed(dynamic)?}) → Future<void> - Completes the enrollment process without pushing the activity to the server.
-
enrollPrepare(
{required BigInt userIdentifier, required int groupKeyA, required int groupKeyB, required bool withGlasses}) → Future< Either< String, dynamic> > - Prepares the enrollment process for a user.
-
enrollWidget(
{required bool withGlasses, required dynamic onPercentageChanged(dynamic), required dynamic onCountdownStarted(dynamic), required dynamic onPushing(dynamic), required dynamic onCompleted(dynamic), required dynamic onFailed(dynamic), required Widget customPermissionBuilder(dynamic), required Widget onLoadingWidget, required Stack builder(Widget, FlutterSmartfacePlatformCameraController), SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front, bool enableCheckImageQuality = false, dynamic onRectInsideEllipseChanged(bool)?, SmartfaceTransparentEllipseOverlay? rectInsideEllipseOverlay, Widget? faceMaskOverlay}) → Widget - Creates a widget for enrolling with various callbacks and customizations.
-
enrollWithoutServerPushingWidget(
{required bool withGlasses, required dynamic onPercentageChanged(dynamic), required dynamic onCountdownStarted(dynamic), required dynamic onCompleted(dynamic), required dynamic onFailed(dynamic), required Widget customPermissionBuilder(dynamic), required Widget onLoadingWidget, required Stack builder(Widget, FlutterSmartfacePlatformCameraController), SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front, dynamic onRectInsideEllipseChanged(bool)?, SmartfaceTransparentEllipseOverlay? rectInsideEllipseOverlay, Widget? faceMaskOverlay}) → Widget - Creates a widget for enrolling without server pushing.
-
fetchAllFromServer(
) → Future< Either< String, dynamic> > - Fetches all data from the server.
-
fetchFromServer(
) → Future< void> - Fetches data from the server by invoking a native method.
-
fetchUser(
int id) → Future< void> - Fetches user data from the native platform.
-
getMaxUsers(
) → Future< int> - Asynchronously retrieves the maximum number of users from the native platform.
-
getThreshold(
) → Future< double> - Retrieves the security threshold from the native platform.
-
getTotalUsers(
) → Future< int> - Retrieves the total number of users from the native platform.
-
getUser(
{required int id}) → Future< Either< String, dynamic> > -
getUsers(
) → Future< Either< String, dynamic> > - Fetches the list of users from the native platform.
-
getValueFromSecureStorage(
{required String key}) → Future< String?> - Retrieves a value from secure storage for the given key.
-
identify(
{dynamic onIdentify(dynamic)?}) → Future< void> - Identifies an activity and invokes the provided callback upon completion.
-
identifyWidget(
{required dynamic onIdentify(dynamic), required Widget customPermissionBuilder(dynamic), dynamic onFps(dynamic)?, required Center onLoadingWidget, required Widget faceMaskOverlay, required Stack builder(Widget, FlutterSmartfacePlatformCameraController), double? securityLevel, double? livenessThreshold, bool livenessEnabled = false, bool saveImage = false, bool keepIdentification = false, Duration identifyTimeout = const Duration(seconds: 5), SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front, bool enableCheckImageQuality = false}) → Widget - Creates a widget for identifying faces with various customization options.
-
invokeNativeMethod(
String methodName, [dynamic arguments]) → Future< Either< String, dynamic> > -
Invokes a native method through the method channel and handles the response.
inherited
-
iosPlatformView(
String viewType, ValueNotifier< bool> isDetachedValueNotifier, ValueNotifier<bool> isLoadingValueNotifier, Widget? faceMaskOverlay, Widget? onLoadingWidget, Map<String, dynamic> creationParams) → Widget -
inherited
-
isCheckImageQualityEnabled(
) → Future< bool> - Checks if the image quality check is enabled.
-
liveness(
{dynamic onLiveness(dynamic)?}) → Future< void> - Initiates the liveness detection activity.
-
livenessWidget(
{required dynamic onLiveness(dynamic), required dynamic onFps(dynamic), required double livenessThreshold, required Widget customPermissionBuilder(dynamic), required Widget onLoadingWidget, required Widget faceMaskOverlay, required Stack builder(Widget, FlutterSmartfacePlatformCameraController), SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front}) → Widget - Creates a widget for liveness detection with various customizable parameters.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
platformViewLink(
{dynamic onIdentify(dynamic)?, dynamic onPercentageChanged(dynamic)?, dynamic onPushing(dynamic)?, dynamic onCompleted(dynamic)?, dynamic onFailed(dynamic)?, dynamic onCountdownStarted(dynamic)?, dynamic onLiveness(dynamic)?, dynamic onFps(dynamic)?, Widget? onLoadingWidget, Widget? faceMaskOverlay, SmartfaceTransparentEllipseOverlay? rectInsideEllipseOverlay, dynamic onRectInsideEllipseChanged(bool)?, SmartfaceCameraPosition? cameraPosition = SmartfaceCameraPosition.front, required Widget builder(Widget, FlutterSmartfacePlatformCameraController), Widget customPermissionBuilder(Future (BuildContext))?, Map< String, dynamic> creationParams = const {}, required String viewType}) → Widget -
Creates a platform view link widget with various callback functions for handling
different events and optional widgets for loading and face mask overlay.
inherited
-
registerCallback(
String method, dynamic callback(dynamic)) → void -
Registers a callback for a specific method.
inherited
-
removeUser(
{required int id}) → Future< Either< String, dynamic> > - Removes a user with the given ID.
-
saveUserCustomIdentifier(
{int? userCustomIdentifier}) → Future< Either< String, dynamic> > - Saves a custom identifier for the user to secure storage.
-
setCredentials(
{required String user, required String password, required int clientIdentifier}) → Future< Either< String, dynamic> > -
Sets the credentials on the native platform using the provided
user
,password
, andclientIdentifier
. -
setThreshold(
double threshold) → Future< void> - Sets the security threshold for the Smartface Mobile platform.
-
setValueToSecureStorage(
{required String key, required String value}) → Future< void> - Writes a key-value pair to secure storage.
-
smartfaceEnrollActivity(
{dynamic onEnroll(dynamic)?, BigInt? userID, BigInt? groupKeyA, BigInt? groupKeyB}) → Future< void> -
smartfaceIdentifyActivity(
{dynamic onIdentify(dynamic)?, bool? keepIdentification, bool? enableCheckImageQuality = true, int? identifyTimeout, bool? livenessEnabled, double? livenessThreshold, double? securityLevel, bool? saveImage = false, SmartfaceCameraPosition? cameraPosition}) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → FlutterSmartfaceMobilePlatform
-
A singleton getter that returns the instance of FlutterSmartfaceMobilePlatform.
no setter