Skip to content

Commit

Permalink
Merge pull request #3 from reown-com/develop
Browse files Browse the repository at this point in the history
WalletKit 1.0.1
  • Loading branch information
quetool authored Sep 20, 2024
2 parents a31a88a + d0effd0 commit c4256b7
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 159 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The communications protocol for web3, Reown brings the ecosystem together by ena

| [Core SDK](packages/reown_core) | [Sign SDK](packages/reown_sign) | [WalletKit](packages/reown_walletkit) | [AppKit](packages/reown_appkit) |
|---------------------------------|---------------------------------|---------------------------------------|---------------------------------|
| 1.0.0 | 1.0.0 | 1.0.0 | 1.0.1 |
| 1.0.0 | 1.0.0 | 1.0.1 | 1.0.1 |

## License

Expand Down
2 changes: 1 addition & 1 deletion packages/reown_appkit/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **Reown - AppKit Flutter**

<img src="https://docs.reown.com/reown/appkit-logo.svg">
<img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/reown_logo.jpg" height="100"> <img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/appkit_logo_long.png" height="100">

Reown is the onchain UX platform that provides toolkits built on top of the WalletConnect Network that enable builders to create onchain user experiences that make digital ownership effortless, intuitive, and secure.

Expand Down
251 changes: 143 additions & 108 deletions packages/reown_appkit/example/base/lib/pages/connect_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class ConnectPage extends StatefulWidget {
}

class ConnectPageState extends State<ConnectPage> {
bool _testnetOnly = false;
final List<ChainMetadata> _selectedChains = [];
bool _shouldDismissQrCode = true;

Expand Down Expand Up @@ -129,28 +128,23 @@ class ConnectPageState extends State<ConnectPage> {
// Build the list of chain buttons, clear if the textnet changed
final testChains = ChainData.allChains.where((e) => e.isTestnet).toList();
final mainChains = ChainData.allChains.where((e) => !e.isTestnet).toList();
final List<ChainMetadata> chains = _testnetOnly ? testChains : mainChains;

final List<Widget> evmChainButtons = [];
final List<Widget> nonEvmChainButtons = [];
final List<Widget> chainButtons = [];
final List<Widget> testButtons = [];

final evmChains = chains.where((e) => e.type == ChainType.eip155);
final nonEvmChains = chains.where((e) => e.type != ChainType.eip155);

for (final ChainMetadata chain in evmChains) {
for (final ChainMetadata chain in mainChains) {
// Build the button
evmChainButtons.add(
chainButtons.add(
ChainButton(
chain: chain,
onPressed: () => _selectChain(chain),
selected: _selectedChains.contains(chain),
),
);
}

for (final ChainMetadata chain in nonEvmChains) {
for (final ChainMetadata chain in testChains) {
// Build the button
nonEvmChainButtons.add(
testButtons.add(
ChainButton(
chain: chain,
onPressed: () => _selectChain(chain),
Expand All @@ -174,9 +168,26 @@ class ConnectPageState extends State<ConnectPage> {
style: StyleConstants.buttonText,
textAlign: TextAlign.center,
),
Text(
'Only EVM chains',
style: TextStyle(
color: Colors.black.withOpacity(0.7),
fontSize: 12.0,
),
textAlign: TextAlign.center,
),
const SizedBox(height: StyleConstants.linear8),
AppKitModalConnectButton(
appKit: widget.appKitModal,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppKitModalNetworkSelectButton(
appKit: widget.appKitModal,
),
const SizedBox.square(dimension: 8.0),
AppKitModalConnectButton(
appKit: widget.appKitModal,
),
],
),
const SizedBox(height: StyleConstants.linear8),
Visibility(
Expand All @@ -190,119 +201,134 @@ class ConnectPageState extends State<ConnectPage> {
visible: !widget.appKitModal.isConnected,
child: Column(
children: [
const Divider(),
const SizedBox(height: StyleConstants.linear8),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: const Divider(),
),
const Text(
StringConstants.testnetsOnly,
' Or ',
style: StyleConstants.buttonText,
textAlign: TextAlign.center,
),
Switch(
value: _testnetOnly,
onChanged: (value) {
setState(() {
_selectedChains.clear();
_testnetOnly = value;
});
},
Expanded(
child: const Divider(),
),
],
),
const Text('EVM Chains:', style: StyleConstants.buttonText),
const SizedBox(height: StyleConstants.linear8),
const Text(
'Connect With AppKit multichain',
style: StyleConstants.buttonText,
textAlign: TextAlign.center,
),
const SizedBox(height: StyleConstants.linear8),
Wrap(
spacing: 10.0,
children: evmChainButtons,
children: chainButtons,
),
const Divider(),
const Text('Non EVM Chains:', style: StyleConstants.buttonText),
// const Divider(),
const Text('Test chains'),
Wrap(
spacing: 10.0,
children: nonEvmChainButtons,
children: testButtons,
),
const SizedBox(height: StyleConstants.linear8),
const Divider(),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
const SizedBox(height: StyleConstants.linear16),
// const Divider(),
Row(
children: [
const Text(
'Connect Session Propose:',
style: StyleConstants.buttonText,
),
const SizedBox(height: StyleConstants.linear8),
Column(
children: WCSampleWallets.getSampleWallets().map((wallet) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: ElevatedButton(
style: _buttonStyle,
onPressed: _selectedChains.isEmpty
? null
: () {
_onConnect(
nativeLink: '${wallet['schema']}',
closeModal: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pop();
}
},
showToast: (m) async {
showPlatformToast(
child: Text(m),
context: context,
);
},
);
},
child: Text(
'${wallet['name']}',
style: StyleConstants.buttonText,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'Session Propose:',
style: StyleConstants.buttonText,
),
);
}).toList(),
),
const SizedBox(height: StyleConstants.linear8),
const Divider(),
const Text(
'1-Click Auth with LinkMode:',
style: StyleConstants.buttonText,
const SizedBox(height: StyleConstants.linear8),
Column(
children:
WCSampleWallets.getSampleWallets().map((wallet) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: ElevatedButton(
style: _buttonStyle,
onPressed: _selectedChains.isEmpty
? null
: () {
_onConnect(
nativeLink: '${wallet['schema']}',
closeModal: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pop();
}
},
showToast: (m) async {
showPlatformToast(
child: Text(m),
context: context,
);
},
);
},
child: Text(
'${wallet['name']}',
style: StyleConstants.buttonText,
),
),
);
}).toList(),
),
],
),
),
const SizedBox(height: StyleConstants.linear8),
Column(
children: WCSampleWallets.getSampleWallets().map((wallet) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: ElevatedButton(
style: _buttonStyle,
onPressed: _selectedChains.isEmpty
? null
: () {
_sessionAuthenticate(
nativeLink: '${wallet['schema']}',
universalLink: '${wallet['universal']}',
closeModal: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pop();
}
},
showToast: (message) {
showPlatformToast(
child: Text(message),
context: context,
);
},
);
},
child: Text(
'${wallet['name']}',
style: StyleConstants.buttonText,
),
const SizedBox.square(dimension: 8.0),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Text(
'Link Mode:',
style: StyleConstants.buttonText,
),
const SizedBox(height: StyleConstants.linear8),
Column(
children:
WCSampleWallets.getSampleWallets().map((wallet) {
return Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: ElevatedButton(
style: _buttonStyle,
onPressed: _selectedChains.isEmpty
? null
: () {
_sessionAuthenticate(
nativeLink: '${wallet['schema']}',
universalLink:
'${wallet['universal']}',
closeModal: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pop();
}
},
showToast: (message) {
showPlatformToast(
child: Text(message),
context: context,
);
},
);
},
child: Text(
'${wallet['name']}',
style: StyleConstants.buttonText,
),
),
);
}).toList(),
),
);
}).toList(),
],
),
),
],
),
Expand Down Expand Up @@ -546,6 +572,15 @@ class ConnectPageState extends State<ConnectPage> {
return StyleConstants.primaryColor;
},
),
textStyle: MaterialStateProperty.resolveWith<TextStyle>(
(states) => TextStyle(
fontSize: 8.0,
fontWeight: FontWeight.w400,
),
),
padding: MaterialStateProperty.resolveWith<EdgeInsetsGeometry>(
(states) => EdgeInsets.all(0.0),
),
minimumSize: MaterialStateProperty.all<Size>(const Size(
1000.0,
StyleConstants.linear48,
Expand Down
3 changes: 2 additions & 1 deletion packages/reown_core/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# **Reown - Core SDK Flutter**

<br />
<img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/reown_logo.jpg" height="100">

Reown is the onchain UX platform that provides toolkits built on top of the WalletConnect Network that enable builders to create onchain user experiences that make digital ownership effortless, intuitive, and secure.
3 changes: 2 additions & 1 deletion packages/reown_sign/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# **Reown - Sign SDK Flutter**

<br />
<img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/reown_logo.jpg" height="100">

Reown is the onchain UX platform that provides toolkits built on top of the WalletConnect Network that enable builders to create onchain user experiences that make digital ownership effortless, intuitive, and secure.
4 changes: 4 additions & 0 deletions packages/reown_walletkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

- Update readme

## 1.0.0

Initial release.
2 changes: 1 addition & 1 deletion packages/reown_walletkit/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **Reown - WalletKit Flutter**

<img src="https://docs.reown.com/reown/walletkit-logo.svg">
<img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/reown_logo.jpg" height="100"> <img src="https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/walletkit_logo_long.png" height="100">

Reown is the onchain UX platform that provides toolkits built on top of the WalletConnect Network that enable builders to create onchain user experiences that make digital ownership effortless, intuitive, and secure.

Expand Down
Loading

0 comments on commit c4256b7

Please sign in to comment.