copy Copy chevron-down
Widget Integration chevron-right flutter Flutter SDKchevron-right Widget Initialization SDK Initialization for Wepin Flutter Widget SDK
After installing the Wepin Flutter Widget SDK, the next step is to initialize the SDK. SDK initialization involves creating an instance of WepinWidgetSDK and using the init() function to proceed.
To use the Wepin Flutter Widget SDK, you first need to import the SDK. Add the following import statements:
Copy import 'package:wepin_flutter_widget_sdk/wepin_flutter_widget_sdk.dart' ;
import 'package:wepin_flutter_widget_sdk/wepin_flutter_widget_sdk_type.dart' ; Before creating an instance of WepinWidgetSDK, you must register your app's Android/iOS information in the Wepin Workspace.
App Registration chevron-right Using the registered app information, create an instance of WepinWidgetSDK. In the state init stage of the main.dart file, create and initialize the WepinWidgetSDK instance as follows:
Copy WepinWidgetSDK wepinSDK = WepinWidgetSDK (
wepinAppKey : wepinAppKey ,
wepinAppId : wepinAppId
) ; SDK Initialization (init)
When initializing the Wepin Flutter Widget SDK, you can define the required widget properties.
attributes <WidgetAttributes>optional - Widget properties to define during initialization.
defaultLanguage <String>:
Set the default language of the widget. The default value is ko, and currently supported languages are en, ja and ko.
defaultCurrency <String>
Set the default currency of the widget. The default value is KRW, and currently supported currencies are USD, JPYand KRW.
Checking Initialization Status (isInitialized)
You can check whether the WepinSDK has been successfully initialized.
<bool>
Returns true if the initialization was successful, and false if it failed.
Changing Language and Currency (changeLanguage)
You can change the language and currency of the widget.
language <String>
Specifies the language to be displayed in the widget. Currently supported languages are en, ja and ko.
currency <String>
Specifies the currency to be displayed in the widget. Currently supported currencies are USD, JPY and KRW.