# Methods

## getStatus

```dart
await wepinSDK.getStatus()
```

Returns the lifecycle status of the WepinSDK.

#### **Parameters**

* None

#### **Return value**

* **Future\<WepinLifeCycle>**
  * **notInitialized**: WepinSDK has not been initialized.
  * **initializing**: WepinSDK is in the process of initializing.
  * **initialized**: WepinSDK has been successfully initialized.
  * **beforeLogin**: WepinSDK is initialized, but the user is not logged in.
  * **login**: The user is logged in and registered with Wepin.
  * **loginBeforeRegister**: The user is logged in but not registered with Wepin.

#### **Example**

```dart
final status = await wepinSDK.getStatus();
```

## login

The `login` variable is a Wepin login library that includes various authentication methods, allowing users to log in using different approaches. It supports email and password login, OAuth provider login, login using ID tokens or access tokens, and more. For detailed information on each method, refer to the official [Login Library guide](/en/widget-integration/flutter-sdk/login-library/methods.md).

#### **Available Methods**

* [`loginWithOauthProvider`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwithoauthprovider)
* [`signUpWithEmailAndPassword`](/en/widget-integration/flutter-sdk/login-library/methods.md#signupwithemailandpassword)
* [`loginWithEmailAndPassword`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwithemailandpassword)
* [`loginWithIdToken`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwithidtoken)
* [`loginWithAccessToken`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwithaccesstoken)
* [`getRefreshFirebaseToken`](/en/widget-integration/flutter-sdk/login-library/methods.md#getrefreshfirebasetoken)
* [`loginFirebaseWithOauthProvider`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginfirebasewithoauthprovider)
* [`loginWepinWithOauthProvider`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwepinwithoauthprovider)
* [`loginWepinWithIdToken`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwepinwithidtoken)
* [`loginWepinWithAccessToken`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwepinwithaccesstoken)
* [`loginWepinWithEmailAndPassword`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwepinwithemailandpassword)
* [`loginWepin`](/en/widget-integration/flutter-sdk/login-library/methods.md#loginwepin)
* [`getCurrentWepinUser`](/en/widget-integration/flutter-sdk/login-library/methods.md#getcurrentwepinuser)
* [`logout`](/en/widget-integration/flutter-sdk/login-library/methods.md#logout)
* [`getSignForLogin`](/en/widget-integration/flutter-sdk/login-library/methods.md#getsignforlogin)

These methods support various login scenarios, allowing you to select the appropriate method based on your needs.

#### **Exception**

* [**WepinError**](#wepinerror)

#### **Example**

```dart
// Login using an OAuth provider
final oauthResult = await wepinSDK.login.loginWithOauthProvider(provider: 'google', clientId: 'your-client-id');

// Sign up and log in using email and password
final signUpResult = await wepinSDK.login.signUpWithEmailAndPassword(email: 'example@example.com', password: 'password123');

// Log in using an ID token
final idTokenResult = await wepinSDK.login.loginWithIdToken(idToken: 'your-id-token', sign: 'your-sign');

// Log in to Wepin
final wepinLoginResult = await wepinSDK.login.loginWepin(idTokenResult);

// Get the currently logged-in user
final currentUser = await wepinSDK.login.getCurrentWepinUser();

// Logout
await wepinSDK.login.logout();
```

## loginWithUI

```dart
await wepinSDK.loginWithUI(BuildContext context, {required List<LoginProvider> loginProviders, String? email})
```

The `loginWithUI()` method provides the functionality to log in using a widget and returns the information of the logged-in user. If a user is already logged in, the widget will not be displayed, and the method will directly return the logged-in user's information. To perform a login without the widget, use the `loginWepin()` method from the `login` variable instead.

{% hint style="warning" %}
This method can only be used after the authentication key has been deleted from the [Wepin Workspace](https://workspace.wepin.io/).\
(Wepin Workspace > Development Tools menu > Login tab > Auth Key > Delete)

> The Auth Key menu is visible only if an authentication key was previously generated.
> {% endhint %}

**Supported Version**\
Supported from version <mark style="color:orange;">**`0.0.4`**</mark> and later.

#### **Parameters**

* **context** `<BuildContext>`\
  In Flutter, `context` represents the location within the widget tree, allowing you to locate widgets, access theme data, and handle navigation. When calling `loginWithUI`, you should pass the current context to ensure that the widget is displayed in the correct part of the UI hierarchy.
* **loginProviders**<`List<LoginProvider>`> - An array of login providers to configure the widget. If an empty array is provided, only the email login function is available.
  * **provider** <`String`>\
    The OAuth login provider (e.g., 'google', 'naver', 'discord', 'apple').
  * **clientId** <`String`> \
    The client ID of the OAuth login provider.
* **email**<`String`> ***optional***\
  The `email` parameter allows users to log in using the specified email address when logging in through the widget.

{% hint style="info" %}
To use OAuth login functionality (e.g., `loginWithUI`), you need to configure OAuth login providers. You must first register your OAuth login provider information in the  [Wepin Workspace](https://workspace.wepin.io/).  For more details on setting up OAuth providers, refer to the [Social Login OAuth Providers documentation](/en/login/social-login-auth-providers.md).
{% endhint %}

#### **Return Value**

* Future\<WepinUser>
  * **status** `<String>`\
    Indicates success or failure ('success'|'fail').
  * **userInfo** `<WepinUserInfo>` ***optional -*** User information.
    * **userId** `<String>`

      Wepin user ID.
    * **email** `<String>`

      The email address of the user logged in to Wepin.
    * **provider** `<String>`

      Login provider ('google'|'apple'|'naver'|'discord'|'email'|'external\_token').
    * **use2FA** `<bool>`

      Indicates whether 2FA is enabled on the user’s wallet.
  * **userStatus** `<WepinUserStatus>`: User status.
    * **loginStatus** `<String>`

      Login status ('complete' | 'pinRequired' | 'registerRequired'). If the user's `loginStatus` is not 'complete', they need to register with Wepin.
    * **pinRequired** `<bool>`***optional***\
      Indicates if a PIN is required.
  * **walletId** `<String>`\
    Wepin user’s wallet ID.
  * **token** `<WepinToken>`\
    Wepin token information.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
// google, apple, discord, naver login
final res = await wepinSDK.loginWithUI(context,
  loginProviders: [
    {
      provider: 'google',
      clientId: 'google-client-id'
    },
    {
      provider: 'apple',
      clientId: 'apple-client-id'
    },
    {
      provider: 'discord',
      clientId: 'discord-client-id'
    },
    {
      provider: 'naver',
      clientId: 'naver-client-id'
    },
  ]);

// only email login
final res = await wepinSDK.loginWithUI(context,
  loginProviders: []);

//with specified email address
final res = await wepinSDK.loginWithUI(context,
  loginProviders: [], email: 'abc@abc.com');
  
if(res.userStatus.loginStatus != "complete"){
    final userInfo  = await wepinSDK.register(context);
}
```

## openWidget

```dart
await wepinSDK.openWidget(BuildContext context)
```

Opens the widget window. If the user is not logged in, the widget window will not open. Therefore, the user must be logged in to Wepin before calling `openWidget`. To log in to Wepin, use the `loginWithUI` or `loginWepin` method from the `login` variable.

#### **Parameters**

* **context** `<BuildContext>`\
  Represents the location of a widget in the widget tree in Flutter. This context is used to locate the widget’s position and to provide various functions like navigation, accessing theme data, and more. When calling `openWidget`, pass the current context to ensure the widget is displayed within the correct part of the UI hierarchy.

#### **Return Value**

* **Future\<void>**

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
await wepinSDK.openWidget(context);
```

## closeWidget

```dart
wepinSDK.closeWidget()
```

Closes the widget window. Closing the window does not log out the user.

#### **Parameters**

* None

#### **Return Value**

* **void**

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
wepinSDK.closeWidget();
```

## register

```dart
await wepinSDK.register(BuildContext context)
```

Registers the user with Wepin. After signing up and logging in, the Wepin widget’s registration page opens, allowing the user to register (create a wallet and account) with Wepin services. This function can only be used when `WepinLifeCycle` is `loginBeforeRegister`. After calling the `loginWepin()` method from the `login` variable, if the `loginStatus` value in `userStatus` is not 'complete', this method should be called.

#### **Parameters**

* **context** `<BuildContext>`\
  Represents the location of a widget in the widget tree. It is used to locate the widget's position in the tree and to provide various functions like navigation and accessing theme data. Pass the current context when calling `register` to ensure the widget is displayed in the correct part of the UI hierarchy.

#### **Return Value**

* Future\<WepinUser>
  * **status** `<String>`\
    Indicates success or failure ('success'|'fail').
  * **userInfo** `<WepinUserInfo>` ***optional -*** User information.
    * **userId** `<String>`

      Wepin user ID.
    * **email** `<String>`

      The email address of the user logged in to Wepin.
    * **provider** `<String>`

      Login provider ('google'|'apple'|'naver'|'discord'|'email'|'external\_token').
    * **use2FA** `<bool>`

      Indicates whether 2FA is enabled on the user’s wallet.
  * **userStatus** `<WepinUserStatus>`: User status.
    * **loginStatus** `<String>`

      Login status ('complete' | 'pinRequired' | 'registerRequired'). If the user's `loginStatus` is not 'complete', they need to register with Wepin.
    * **pinRequired** `<bool>`***optional***\
      Indicates if a PIN is required.
  * **walletId** `<String>`\
    Wepin user’s wallet ID.
  * **token** `<WepinToken>`\
    Wepin token information.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
final userInfo = await wepinSDK.register(context);
```

## getAccounts

```dart
await wepinSDK.getAccounts({List<String>? networks, bool? withEoa})
```

Returns the user's account information (networks and addresses) available in the app. This function can only be used after logging in to Wepin. If no parameters are provided, it returns information for all the user's accounts.

#### **Parameters**

* **networks** `<List<String>>` ***optional***\
  The networks for which you want to return account information. The supported blockchain networks can be found on the supported blockchain page.
* **withEoa** `<bool>` ***optional***\
  If AA accounts are present, this determines whether to include EOA accounts in the return.

{% content-ref url="/pages/c58QTBKZd8FibB8m3Pc4" %}
[Supported blockchains](/en/wepin/supported-blockchains.md)
{% endcontent-ref %}

#### **Return Value**

* **Future \<List\<WepinAccount>>**
  * **address** `<String>`\
    User account address.
  * **network** `<String>`

    The network type of the user's account.
  * **contract** `<String>` ***optional***\
    The contract address of the token.
  * **isAA** `<bool>` ***optional***\
    Indicates if it is an AA account.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
final result = await wepinSDK.getAccounts(
  networks: ['Ethereum'], 
  withEoa: true
);
```

* response

```dart
[
  WepinAccount(
    address: "0x0000001111112222223333334444445555556666",
    network: "Ethereum",
  ),
  WepinAccount(
    address: "0x0000001111112222223333334444445555556666",
    network: "Ethereum",
    contract: "0x777777888888999999000000111111222222333333",
  ),
  WepinAccount(
    address: "0x4444445555556666000000111111222222333333",
    network: "Ethereum",
    isAA: true,
  ),
]
```

## getBalance

```dart
await wepinSDK.getBalance({List<WepinAccount>? accounts})
```

Returns the balance information (amount) of accounts. This function can only be used after logging in to Wepin. If no `accounts` parameter is provided, it returns the balance of all user accounts.

#### **Parameters**

* **accounts** `<List<WepinAccount>>` ***optional***
  * **network** `<String>`

    The network type of the account for which to check the balance.
  * **address** `<String>`

    The address of the account for which to check the balance.
  * **isAA** `<bool>`***optional*** \
    Indicates if it is an AA account.

#### **Return Value**

* **Future \<List\<WepinAccountBalanceInfo>>**
  * **network** `<String>`

    The network type of the user's account.
  * **address** `<String>`

    The address of the user's account.
  * **symbol** `<String>`

    Network symbol.
  * **balance** `<String>`

    The amount of the network coin held.
  * **tokens** `<List<WepinTokenBalanceInfo>>`
    * **symbol** `<String>`

      Token symbol.
    * **balance** `<String>`

      The amount of the token held.
    * **contract** `<String>`

      Token contract address.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
final result = await wepinSDK.getBalance([WepinAccount(
  address: '0x0000001111112222223333334444445555556666',
  network: 'Ethereum',
)]);
```

* response

```dart
[
    WepinAccountBalanceInfo(
        network: "Ethereum",
        address: "0x0000001111112222223333334444445555556666",
        symbol: "ETH",
        balance: "1.1",
        tokens:[
            WepinTokenBalanceInfo(
                contract: "0x123...213",
                symbol: "TEST",
                balance: "10"
            ),
        ]
    )
]
```

## getNFTs

```dart
await wepinSDK.getNFTs({required bool refresh, List<String>? networks})
```

Returns the user's NFTs. This function can only be used after logging in to Wepin. If no `networks` parameter is provided, it returns all of the user's NFT information.

#### **Parameters**

* **refresh** `<bool>`\
  Required parameter to indicate whether to refresh the NFT data.
* **networks** `<List<String>>` ***optional*** \
  A list of network names to filter the NFTs.

#### **Return Value**

* **Future\<List\<WepinNFT>>**
  * **account** `<WepinAccount>`
    * **address** `<String>`\
      User account address.
    * **network** `<String>` \
      The network type of the user's account.
    * **contract** `<String>` ***optional***\
      Token contract address.
    * **isAA** `<bool>` ***optional***\
      Indicates if it is an AA account.
  * **contract** `<WepinNFTContract>`
    * **name** `<String>`\
      NFT contract name.
    * **address** `<String>` \
      NFT contract address.
    * **scheme** `<String>` \
      Scheme of the NFT.
    * **description** `<String>` ***optional***\
      Description of the NFT contract.
    * **network** `<String>` \
      Network associated with the NFT contract.
    * **externalLink** `<String>` ***optional***\
      External link associated with the NFT contract.
    * **imageUrl** `<String>` ***optional***\
      Image URL associated with the NFT contract.
  * **name** `<String>`\
    Name of the NFT.
  * **description** `<String>` \
    Description of the NFT.
  * **externalLink** `<String>` \
    External link associated with the NFT.
  * **imageUrl** `<String>`\
    Image URL associated with the NFT.
  * **contentUrl** `<String>` ***optional***\
    URL pointing to the content associated with the NFT.
  * **quantity** `<int>` \
    Quantity of the NFT.
  * **contentType** `<String>` \
    Content type of the NFT ('image' | 'video').
  * **state** `<int>`\
    State of the NFT.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
final result = await wepinSDK.getNFTs(refresh: true, networks: ['Ethereum']);
```

* Response

```dart
[
  WepinNFT(
    account: WepinAccount(
      address: "0x0000001111112222223333334444445555556666",
      network: "Ethereum",
      contract: "0x777777888888999999000000111111222222333333",
      isAA: true,
    ),
    contract: WepinNFTContract(
      name: "NFT Collection",
      address: "0x777777888888999999000000111111222222333333",
      scheme: "ERC721",
      description: "An example NFT collection",
      network: "Ethereum",
      externalLink: "https://example.com",
      imageUrl: "https://example.com/image.png",
    ),
    name: "Sample NFT",
    description: "A sample NFT description",
    externalLink: "https://example.com/nft",
    imageUrl: "https://example.com/nft-image.png",
    contentUrl: "https://example.com/nft-content.png",
    quantity: 1,
    contentType: "image/png",
    state: 0,
  ),
]
```

## send

```dart
await wepinSDK.send(BuildContext context, {required WepinAccount account, WepinTxData? txData})
```

Performs the send function using the widget and returns the ID information of the send transaction. This function can only be used after logging in to Wepin.

#### **Parameters**

* **context** `<BuildContext>`\
  Represents the location of a widget in the widget tree in Flutter. This context is used to locate the widget’s position and to provide various functions like navigation, accessing theme data, and more. When calling `send`, pass the current context to ensure the widget is displayed within the correct part of the UI hierarchy.
* **account** `<WepinAccount>` - The user's account information to send from.
  * **network** `<String>` \
    The type of network to send to.
  * **address** `<String>`\
    The address of the account to send to.
  * **contract** `<String>` ***optional*** \
    The contract address of the token.
* **txData** `<WepinTxData>` ***optional***
  * **to** `<String>` \
    The address to send to.
  * **amount** `<String>` \
    The amount to send.

#### **Return Value**

* **Future \<WepinSendResponse>**
  * **txId** `<string>` \
    The transaction ID of the send transaction.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
final result = await wepinSDK.send(context, {
    account: WepinAccount(
        address: '0x0000001111112222223333334444445555556666',
        network: 'Ethereum',
    ),
    txData: WepinTxData(
        to: '0x9999991111112222223333334444445555556666',
        amount: '0.1',
    )
})
// token send
final result = await wepinSDK.send(context, {
    account: WepinAccount(
        address: '0x0000001111112222223333334444445555556666',
        network: 'Ethereum',
        contract: '0x9999991111112222223333334444445555556666',
    ),
    txData: WepinTxData(
        to: '0x9999991111112222223333334444445555556666',
        amount: '0.1',
    )
})
```

* response

```dart
WepinSendResponse(
    txId: "0x76bafd4b700ed959999d08ab76f95d7b6ab2249c0446921c62a6336a70b84f32"
)
```

## receive

```dart
await wepinSDK.receive(BuildContext context, {required WepinAccount account})
```

The `receive()` method opens the account information page associated with the specified account. This method can only be used after logging into Wepin.

**Supported Version**\
Supported from version <mark style="color:orange;">**`0.0.4`**</mark> and later.

#### **Parameters**

* **context** `<BuildContext>`\
  In Flutter, `context` represents the location within the widget tree, allowing you to locate widgets, access theme data, and handle navigation. When calling `receive`, you should pass the current context to ensure that the widget is displayed in the correct part of the UI hierarchy.
* **account** `<WepinAccount>` - Provides the account information for the page that will be opened.
  * **network** `<String>` \
    The network associated with the account.
  * **address** `<String>`\
    The address of the account.
  * **contract** `<String>` ***optional*** \
    The contract address of the token.

#### **Return Value**

* **Future\<WepinReceiveResponse>**
  * **account** `<WepinAccount>` - The account information of the page that was opened.
    * **network** `<String>` \
      The network associated with the account.
      * **address** `<String>`\
        The address of the account.
      * **contract** `<String>` ***optional*** \
        The contract address of the token.

#### **Exception**

* [WepinError](#wepinerror)

#### **Example**

```dart
// Opening an account page
final result = await wepinSDK.receive(context, {
    account: WepinAccount(
      address: '0x0000001111112222223333334444445555556666',
      network: 'Ethereum',
    ),
})

// Opening a token page
final result = await wepinSDK.receive(context, {
  account: WepinAccount(
    address: '0x0000001111112222223333334444445555556666',
    network: 'Ethereum',
    contract: '0x9999991111112222223333334444445555556666'
  ),
})
```

## finalize

```dart
await wepinSDK.finalize()
```

Terminates the use of WepinSDK. The `WepinLifeCycle` changes to `notInitialized`.

#### **Return Value**

* **None**

#### **Example**

```dart
await wepinSDK.finalize();
```

## WepinError

| Error Code                    | Error Message                 | Error Description                                                                                                                                                                                    |
| ----------------------------- | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invalidAppKey`               | "InvalidAppKey"               | The Wepin app key is invalid.                                                                                                                                                                        |
| `invalidParameters` \`        | "InvalidParameters"           | One or more parameters provided are invalid or missing.                                                                                                                                              |
| `invalidLoginProvider`        | "InvalidLoginProvider"        | The login provider specified is not supported or is invalid.                                                                                                                                         |
| `invalidToken`                | "InvalidToken"                | The token does not exist.                                                                                                                                                                            |
| `invalidLoginSession`         | "InvalidLoginSession"         | The login session information does not exist.                                                                                                                                                        |
| `notInitialized`              | "NotInitialized"              | The WepinLoginLibrary has not been properly initialized.                                                                                                                                             |
| `alreadyInitialized`          | "AlreadyInitialized"          | The WepinLoginLibrary is already initialized, so the logout operation cannot be performed again.                                                                                                     |
| `userCancelled`               | "UserCancelled"               | The user has cancelled the operation.                                                                                                                                                                |
| `unknownError`                | "UnknownError"                | An unknown error has occurred, and the cause is not identified.                                                                                                                                      |
| `notConnectedInternet`        | "NotConnectedInternet"        | The system is unable to detect an active internet connection.                                                                                                                                        |
| `failedLogin`                 | "FailedLogin"                 | The login attempt has failed due to incorrect credentials or other issues.                                                                                                                           |
| `alreadyLogout`               | "AlreadyLogout"               | The user is already logged out, so the logout operation cannot be performed again.                                                                                                                   |
| `invalidEmailDomain`          | "InvalidEmailDomain"          | The provided email address's domain is not allowed or recognized by the system.                                                                                                                      |
| `failedSendEmail`             | "FailedSendEmail"             | The system encountered an error while sending an email. This is because the email address is invalid or we sent verification emails too often. Please change your email or try again after 1 minute. |
| `requiredEmailVerified`       | "RequiredEmailVerified"       | Email verification is required to proceed with the requested operation.                                                                                                                              |
| `incorrectEmailForm`          | "incorrectEmailForm"          | The provided email address does not match the expected format.                                                                                                                                       |
| `incorrectPasswordForm`       | "IncorrectPasswordForm"       | The provided password does not meet the required format or criteria.                                                                                                                                 |
| `notInitializedNetwork`       | "NotInitializedNetwork"       | The network or connection required for the operation has not been properly initialized.                                                                                                              |
| `requiredSignupEmail`         | "RequiredSignupEmail"         | The user needs to sign up with an email address to proceed.                                                                                                                                          |
| `failedEmailVerified`         | "FailedEmailVerified"         | The WepinLoginLibrary encountered an issue while attempting to verify the provided email address.                                                                                                    |
| `failedPasswordStateSetting`  | "FailedPasswordStateSetting"  | Failed to set the password state. This error may occur during password management operations, potentially due to invalid input or system issues.                                                     |
| `failedPasswordSetting`       | "failedPasswordSetting"       | Failed to set the password. This could be due to issues with the provided password or internal errors during the password setting process.                                                           |
| `existedEmail`                | "ExistedEmail"                | The provided email address is already registered. This error occurs when attempting to sign up with an email that is already in use.                                                                 |
| `apiRequestError`             | "ApiRequestError"             | There was an error while making the API request. This can happen due to network issues, invalid endpoints, or server errors.                                                                         |
| `incorrectLifecycleException` | "IncorrectLifecycleException" | The lifecycle of the Wepin SDK is incorrect for the requested operation. Ensure that the SDK is in the correct state (e.g., `initialized` and `login`) before proceeding.                            |
| `failedRegister`              | "FailedRegister"              | Failed to register the user. This can occur due to issues with the provided registration details or internal errors during the registration process.                                                 |
| `accountNotFound`             | "AccountNotFound"             | The specified account was not found. This error is returned when attempting to access an account that does not exist in the Wepin.                                                                   |
| `nftNotFound`                 | "NftNotFound"                 | The specified NFT was not found. This error occurs when the requested NFT does not exist or is not accessible within the user's account.                                                             |
| `failedSend`                  | "FailedSend"                  | Failed to send the required data or request. This error could be due to network issues, incorrect data, or internal server errors.                                                                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wepin.io/en/widget-integration/flutter-sdk/widget/method.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
