Skip to content

Commit 98e3958

Browse files
update flutter docs to v6
1 parent 2a62336 commit 98e3958

File tree

6 files changed

+78
-9
lines changed

6 files changed

+78
-9
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: PnP Flutter SDK - v5 to v6
3+
description: "PnP Flutter SDK - v5 to v6 | Documentation - Web3Auth"
4+
sidebar_label: v5 to v6
5+
---
6+
7+
This migration guide provides steps for upgrading from version v5 to v6 of the PnP Flutter SDK. The
8+
guide outlines significant changes and enhancements, including the support of Web3Auth OpenLogin
9+
version v9, and Wallet Services v3.
10+
11+
## Breaking Changes
12+
13+
### `getSignResponse` is now removed.
14+
15+
In v6, we try to improve the developer experience by removing the `getSignResponse` method and
16+
returning the result in the `request` method itself.
17+
18+
Previously, after calling the `request` method, developers had to use the `getSignResponse` method
19+
to retrieve the `SignResponse`. In the latest version v6, the `request` method will return the
20+
`SignResponse` directly.
21+
22+
```dart
23+
try {
24+
List<dynamic> params = [];
25+
// Message to be signed
26+
params.add("Hello, Web3Auth from Flutter!");
27+
// User's EOA address
28+
params.add("<User Address in Hex>");
29+
30+
// add-next-line
31+
final response = await Web3AuthFlutter.request(
32+
ChainConfig(
33+
chainId: "0x1",
34+
rpcTarget: "https://mainnet.infura.io/v3/$key",
35+
),
36+
"personal_sign",
37+
params,
38+
);
39+
40+
// remove-next-line
41+
final response = await Web3AuthFlutter.getSignResponse();
42+
43+
log(response.toString());
44+
} on UserCancelledException {
45+
log("User cancelled.");
46+
} catch(e) {
47+
log("Unknown exception occurred");
48+
}
49+
```
50+
51+
## Minimum Android SDK Version
52+
53+
The minimum Android SDK version for the PnP Flutter SDK is now 26. Please update your app level
54+
gradle file to set the minimum SDK version to 26.
55+
56+
```gradle
57+
defaultConfig {
58+
// ...
59+
// add-next-line
60+
minSdkVersion 26 //flutter.minSdkVersion
61+
// remove-next-line
62+
minSdkVersion 24 //flutter.minSdkVersion
63+
// ...
64+
}
65+
```
66+
67+
## Enhancements
68+
69+
In the latest version v6, we have added support for the Web3Auth Auth Service version v9, and Wallet
70+
Services v3. In Wallet Services v3, the prebuilt wallet UI now supports the swap functionality
71+
allowing users to swap to their favorite token from the app itself.

docs/sdk/pnp/flutter/flutter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ custom authentication flow of your choice.
1313

1414
## Requirements
1515

16-
- **Android** API version 34 or newer.
16+
- **Android** API version 26 or newer.
1717
- **iOS** 14, Xcode 12+ and Swift 5.x
1818

1919
## Resources

docs/sdk/pnp/flutter/usage.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,22 +615,20 @@ try {
615615
params.add("<User Address in Hex>");
616616
617617
// focus-start
618-
await Web3AuthFlutter.request(
618+
final response = await Web3AuthFlutter.request(
619619
ChainConfig(
620620
chainId: "0x1",
621621
rpcTarget: "https://mainnet.infura.io/v3/$key",
622622
),
623623
"personal_sign",
624624
params,
625625
);
626+
627+
log(response.toString());
626628
// focus-end
627629
} on UserCancelledException {
628630
log("User cancelled.");
629631
} catch(e) {
630632
log("Unknown exception occurred");
631633
}
632-
633-
// focus-next-line
634-
final signResponse = await Web3AuthFlutter.getSignResponse();
635-
log(signResponse.toString())
636634
```

sidebars.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ const sidebars: SidebarsConfig = {
14861486
{
14871487
type: "category",
14881488
label: "Migration Guides",
1489-
items: ["migration-guides/flutter-v3-to-v4"],
1489+
items: ["migration-guides/flutter-v5-to-v6", "migration-guides/flutter-v3-to-v4"],
14901490
},
14911491
...sdkQuickLinks,
14921492
],

src/common/sdk/pnp/android/_android-deep-linking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Main activity
88
<category android:name="android.intent.category.DEFAULT" />
99
<category android:name="android.intent.category.BROWSABLE" />
1010

11-
<data android:scheme="{scheme}" android:host="{YOUR_APP_PACKAGE_NAME}" android:path="/path" />
11+
<data android:scheme="{scheme}" android:host="{YOUR_APP_PACKAGE_NAME}"/>
1212
<!-- Accept URIs: w3a://com.example.w3aflutter -->
1313
</intent-filter>
1414
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
```yaml
22
dependencies:
3-
web3auth_flutter: ^5.0.4
3+
web3auth_flutter: ^6.1.0
44
```

0 commit comments

Comments
 (0)