finik_sdk 0.1.2 finik_sdk: ^0.1.2 copied to clipboard
This Flutter package allows your application to integrate Finik application features.
Finik SDK #
Overview #
The Finik SDK is a Flutter package that helps your app retrieve QR codes from the Finik server.
It also includes a pre-made QR page for easy and fast integration into your app.
Platform | Android | iOS | Linux | macOS | Web | Windows |
---|---|---|---|---|---|---|
Support | SDK 19+ | 12.0+ | - | - | - | - |
Features #
1. Fetch QR Codes from the Server #
Easily get or create QR codes using Finik SDK. The SDK uses GraphQL queries for accurate and updated data.
2. Pre-Made QR Page #
Quickly add a ready-to-use QR page to your app to save development time.
3. QR Code Scanning #
Coming soon. Stay tuned for updates.
How to Use #
Example Code #
Here’s how to use FinikProvider to add the SDK to your app:
import 'package:flutter/material.dart';
import 'package:finik_sdk/finik_sdk.dart';
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Finik DEMO',
home: FinikProvider(
apiKey: 'YOUR_API_KEY',
languageCode: 'en',
useHiveForGraphQLCache: false,
onBackPressed: () => debugPrint('onBackPressed'),
widget: const CreateItemHandlerWidget(
accountId: 'YOUR_ITEM_ID',
nameEn: 'YOUR_NAME_EN',
requiredFields: [
RequiredField(
fieldId: 'YOUR_FIELD_ID_FOR_REQUIRED_FIELD',
value: 'YOUR_VALUE',
),
],
),
),
);
}
}
Parameters Explained #
- apiKey: Your API key from the Finik server.
- languageCode: The language for translations. Supported options: 'ky', 'en', 'ru'.
- useHiveForGraphQLCache: Chooses where to store GraphQL data:
- Set to
true
for local disk storage using Hive. - Set to
false
for temporary in-memory storage (good for app runtime).
- Set to
- onBackPressed: A function triggered when the back button is pressed. Useful for custom navigation or showing dialogs.
- widget: The main widget managed by
FinikProvider
.
FinikWidget Details #
The FinikWidget
is a basic widget used in the Finik SDK. It lets you add different functions
to your app and is passed to FinikProvider
. The SDK currently includes these widgets:
1. CreateItemHandlerWidget #
A widget for creating or managing items in the Finik system.
Parameters
accountId
(String, required): The unique ID for the account or item.nameEn
(String, required): The name of the item in English.requiredFields
(List: Extra fields needed to create the item. Each field includes:fieldId
(String): The unique ID for the field.value
(String): The value for the field.
Example Code
CreateItemHandlerWidget(
accountId: 'YOUR_ITEM_ID',
nameEn: 'YOUR_NAME_EN',
requiredFields: [
RequiredField(
fieldId: 'YOUR_FIELD_ID_FOR_REQUIRED_FIELD',
value: 'YOUR_VALUE',
),
],
)
2. GetItemHandlerWidget #
A widget for getting and showing information about a specific item.
Parameters
itemId
(String, required): The unique ID for the item to fetch.
Example Code
GetItemHandlerWidget(
accountId: 'YOUR_ACCOUNT_ID',
)
3. ScannerHandlerWidget #
A widget for scanning QR codes.
Status
This feature is still being developed. It will let users scan QR codes and handle the data easily.
Example Code (Coming Soon)
ScannerHandlerWidget()
Notes #
- These widgets are used with
FinikProvider
for flexible and easy integration into your app. - More widgets may be added later to enhance the SDK's features.
Compatibility #
- Dart: Version 2.17.0 or higher
- Platforms: Android (SDK 19+), iOS (12.0+)
Contributions #
We welcome your feedback and contributions to make the Finik SDK even better.
Feel free to report issues or suggest new features!
Contact #
For questions or support, please email: averspay.kg@gmail.com