Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.1.3-beta01

- Analytics API support

## 3.1.2

- Bug fixes for Coinbase Wallet integration
Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
versionName=3.1.2
versionCode=36
versionName=3.1.3
versionCode=38
6 changes: 6 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ PODS:
- CoinbaseWalletSDK/CrossPlatform (1.0.4):
- CoinbaseWalletSDK/Client
- Flutter (1.0.0)
- flutter_timezone (0.0.1):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
Expand All @@ -29,6 +31,7 @@ DEPENDENCIES:
- appcheck (from `.symlinks/plugins/appcheck/ios`)
- coinbase_wallet_sdk (from `.symlinks/plugins/coinbase_wallet_sdk/ios`)
- Flutter (from `Flutter`)
- flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
Expand All @@ -47,6 +50,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/coinbase_wallet_sdk/ios"
Flutter:
:path: Flutter
flutter_timezone:
:path: ".symlinks/plugins/flutter_timezone/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
Expand All @@ -63,6 +68,7 @@ SPEC CHECKSUMS:
coinbase_wallet_sdk: 7ccd4e1a7940deba6ba9bd81beece999a2268c15
CoinbaseWalletSDK: ea1f37512bbc69ebe07416e3b29bf840f5cc3152
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
Expand Down
12 changes: 6 additions & 6 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand All @@ -496,7 +496,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -514,7 +514,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -530,7 +530,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand Down Expand Up @@ -655,7 +655,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -686,7 +686,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 35;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1.2</string>
<string>3.1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>35</string>
<string>38</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
36 changes: 20 additions & 16 deletions example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,41 @@ import 'package:flutter/material.dart';

import 'package:web3modal_flutter/web3modal_flutter.dart';

import 'package:walletconnect_flutter_dapp/widgets/logger_widget.dart';
import 'package:walletconnect_flutter_dapp/widgets/session_widget.dart';
import 'package:walletconnect_flutter_dapp/utils/dart_defines.dart';
import 'package:walletconnect_flutter_dapp/utils/string_constants.dart';

class MyHomePage extends StatefulWidget {
const MyHomePage({
super.key,
required this.swapTheme,
required this.changeTheme,
required this.toggleBrightness,
required this.toggleTheme,
});
final VoidCallback swapTheme;
final VoidCallback changeTheme;
final VoidCallback toggleBrightness;
final VoidCallback toggleTheme;

@override
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
final overlay = OverlayController(const Duration(milliseconds: 200));
late W3MService _w3mService;

@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_toggleOverlay();
});
_initializeService();
}

void _toggleOverlay() {
overlay.show(context);
}

void _initializeService() async {
// See https://docs.walletconnect.com/web3modal/flutter/custom-chains
W3MChainPresets.chains.putIfAbsent(_celo.chainId, () => _celo);
Expand All @@ -36,6 +45,7 @@ class _MyHomePageState extends State<MyHomePage> {
_w3mService = W3MService(
projectId: DartDefines.projectId,
logLevel: LogLevel.error,
enableAnalytics: true,
metadata: const PairingMetadata(
name: StringConstants.w3mPageTitleV3,
description: StringConstants.w3mPageTitleV3,
Expand Down Expand Up @@ -74,15 +84,10 @@ class _MyHomePageState extends State<MyHomePage> {
_w3mService.onModalDisconnect.subscribe(_onModalDisconnect);
_w3mService.onModalError.subscribe(_onModalError);
//
// _w3mService.onSessionConnectEvent.subscribe(_onSessionConnect);
// _w3mService.onSessionDeleteEvent.subscribe(_onSessionDelete);
_w3mService.onSessionExpireEvent.subscribe(_onSessionExpired);
_w3mService.onSessionUpdateEvent.subscribe(_onSessionUpdate);
_w3mService.onSessionEventEvent.subscribe(_onSessionEvent);
//
// _w3mService.onCoinbaseConnect.subscribe((args) {});
// _w3mService.onCoinbaseError.subscribe((args) {});
// _w3mService.onCoinbaseSessionUpdate.subscribe((args) {});
//
await _w3mService.init();
}
Expand All @@ -95,15 +100,10 @@ class _MyHomePageState extends State<MyHomePage> {
_w3mService.onModalDisconnect.unsubscribe(_onModalDisconnect);
_w3mService.onModalError.unsubscribe(_onModalError);
//
// _w3mService.onSessionConnectEvent.unsubscribe(_onSessionConnect);
// _w3mService.onSessionDeleteEvent.unsubscribe(_onSessionDelete);
_w3mService.onSessionExpireEvent.unsubscribe(_onSessionExpired);
_w3mService.onSessionUpdateEvent.unsubscribe(_onSessionUpdate);
_w3mService.onSessionEventEvent.unsubscribe(_onSessionEvent);
//
// _w3mService.onCoinbaseConnect.unsubscribe((args) {});
// _w3mService.onCoinbaseError.unsubscribe((args) {});
// _w3mService.onCoinbaseSessionUpdate.unsubscribe((args) {});
super.dispose();
}

Expand Down Expand Up @@ -154,17 +154,21 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Web3ModalTheme.colorsOf(context).background175,
foregroundColor: Web3ModalTheme.colorsOf(context).foreground100,
actions: [
IconButton(
icon: const Icon(Icons.logo_dev_rounded),
onPressed: _toggleOverlay,
),
IconButton(
icon: isCustom
? const Icon(Icons.yard)
: const Icon(Icons.yard_outlined),
onPressed: widget.changeTheme,
onPressed: widget.toggleTheme,
),
IconButton(
icon: Web3ModalTheme.maybeOf(context)?.isDarkMode ?? false
? const Icon(Icons.light_mode_outlined)
: const Icon(Icons.dark_mode_outlined),
onPressed: widget.swapTheme,
onPressed: widget.toggleBrightness,
),
],
),
Expand Down
12 changes: 6 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
debugShowCheckedModeBanner: false,
title: StringConstants.w3mPageTitleV3,
home: MyHomePage(
swapTheme: () => _swapTheme(),
changeTheme: () => _changeTheme(),
toggleTheme: () => _toggleTheme(),
toggleBrightness: () => _toggleBrightness(),
),
),
);
}

void _swapTheme() => setState(() {
_isDarkMode = !_isDarkMode;
void _toggleTheme() => setState(() {
_themeData = (_themeData == null) ? _customTheme : null;
});

void _changeTheme() => setState(() {
_themeData = (_themeData == null) ? _customTheme : null;
void _toggleBrightness() => setState(() {
_isDarkMode = !_isDarkMode;
});

Web3ModalThemeData get _customTheme => Web3ModalThemeData(
Expand Down
Loading