ReownAppKitModal class

Either a projectId and metadata must be provided or an already created appKit. optionalNamespaces is mostly not needed, if you use it, the values set here will override every optionalNamespaces set in evey chain

Implemented types
Mixed-in types

Constructors

ReownAppKitModal({required BuildContext context, IReownAppKit? appKit, String? projectId, PairingMetadata? metadata, bool? enableAnalytics, SIWEConfig? siweConfig, FeaturesConfig? featuresConfig, Map<String, RequiredNamespace>? requiredNamespaces, Map<String, RequiredNamespace>? optionalNamespaces, Set<String>? featuredWalletIds, Set<String>? includedWalletIds, Set<String>? excludedWalletIds, Future<double> getBalanceFallback()?, LogLevel logLevel = LogLevel.nothing})

Properties

appKit IReownAppKit?
The object that manages sessions, authentication, events, and requests for WalletConnect.
no setteroverride
avatarUrl String?
The url to the account's avatar image. Pass this into a Image.network and it will load the avatar image.
no setteroverride
balanceNotifier ValueNotifier<String>
Returns the balance of the currently connected wallet on the selected chain.
final
chainBalance String
Returns the balance of the currently connected wallet on the selected chain.
no setteroverride
featuresConfig FeaturesConfig
latefinaloverride-getter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasNamespaces bool
no setteroverride
isConnected bool
Variable that can be used to check if appKitModal is connected
no setteroverride
isOpen bool
Variable that can be used to check if the modal is visible on screen.
no setteroverride
modalContext BuildContext?
no setteroverride
onModalConnect Event<ModalConnect>
final
onModalDisconnect Event<ModalDisconnect>
final
onModalError Event<ModalError>
final
onModalNetworkChange Event<ModalNetworkChange>
final
onModalUpdate Event<ModalConnect>
final
onSessionEventEvent Event<SessionEvent>
final
onSessionExpireEvent Event<SessionExpire>
final
onSessionUpdateEvent Event<SessionUpdate>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedChain ReownAppKitModalNetworkInfo?
The currently selected chain.
no setteroverride
selectedWallet ReownAppKitModalWalletInfo?
The currently selected wallet.
no setteroverride
session ReownAppKitModalSession?
The current session's data.
no setteroverride
status ReownAppKitModalStatus
Whether or not this object has been initialized.
no setteroverride
wcUri String?
The URI that can be used to connect to this dApp. This is only available after the openModalView function is called.
no setteroverride

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
buildConnectionUri() Future<void>
This will do nothing if isConnected is true.
override
closeModal({bool disconnectSession = false}) → void
Closes the modal.
override
connectSelectedWallet({bool inBrowser = false}) Future<void>
Connects the selectedWallet previously selected
override
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
inherited
didChangeAppLifecycleState(AppLifecycleState state) → void
Called when the system puts the app in the background or returns the app to the foreground.
override
didChangeLocales(List<Locale>? locales) → void
Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.
inherited
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
inherited
didChangePlatformBrightness() → void
Called when the platform brightness changes.
inherited
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
inherited
didChangeViewFocus(ViewFocusEvent event) → void
Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.
inherited
didHaveMemoryPressure() → void
Called when the system is running low on memory.
inherited
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route, such as after a system back button press or back gesture.
inherited
didPushRoute(String route) Future<bool>
Called when the host tells the application to push a new route onto the navigator.
inherited
didPushRouteInformation(RouteInformation routeInformation) Future<bool>
Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.
inherited
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
inherited
disconnect({bool disconnectAllSessions = true}) Future<void>
Disconnects the session and pairing, if any. If there is no session, this does nothing.
override
dispatchEnvelope(String url) Future<bool>
/////* PUBLIC METHODS */////////
override
dispose() Future<void>
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
expirePreviousInactivePairings() Future<void>
Used to expire and delete any inactive pairing
override
getApprovedChains({String? namespace}) List<String>?
Will get the list of already approved chains by the wallet (to switch to)
override
getApprovedEvents({String? namespace}) List<String>?
List of approved events by connected wallet
override
getApprovedMethods({String? namespace}) List<String>?
List of approved methods by connected wallet
override
getAvailableChains() List<String>?
Will get the list of available chains to add
override
handleCancelBackGesture() → void
Called when a predictive back gesture is canceled, indicating that no navigation should occur.
inherited
handleCommitBackGesture() → void
Called when a predictive back gesture is finished successfully, indicating that the current route should be popped.
inherited
handleStartBackGesture(PredictiveBackEvent backEvent) bool
Called at the start of a predictive back gesture.
inherited
handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) → void
Called when a predictive back gesture moves.
inherited
init() Future<void>
Sets up the explorer and appKit if they already been initialized.
override
launchBlockExplorer() → void
Launch blockchain explorer for the current chain in external browser
override
launchConnectedWallet() → void
Opens the native wallet selectedWallet after connected
override
loadAccountData() Future<void>
Loads account balance and avatar. Returns true if it was able to actually load data (i.e. there is a selected chain and session)
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
openModalView([Widget? startWidget]) Future<void>
Opens the modal with the provided startWidget (if any). If none is provided, the default state will be used based on platform.
override
openNetworksView() Future<void>
Opens modal on Network Selection Screen
override
reconnectRelay() Future<void>
Connects to the relay if not already connected. If the relay is already connected, this does nothing.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
request({required String? topic, required String chainId, required SessionRequestParams request, String? switchToChainId}) Future
Make a request
override
requestAddChain(ReownAppKitModalNetworkInfo newChain) Future<void>
override
requestReadContract({required String? topic, required String chainId, required DeployedContract deployedContract, required String functionName, EthereumAddress? sender, List parameters = const []}) Future<List>
override
requestSwitchToChain(ReownAppKitModalNetworkInfo newChain) Future<void>
override
requestWriteContract({required String? topic, required String chainId, required DeployedContract deployedContract, required String functionName, required Transaction transaction, List parameters = const [], String? method}) Future
override
selectChain(ReownAppKitModalNetworkInfo? chainInfo, {bool switchChain = false, bool logEvent = true}) Future<void>
Sets the selectedChain If the wallet is already connected, it will request the chain to be changed and will update the session with the new chain. If chainInfo is null this will disconnect the wallet.
override
selectWallet(ReownAppKitModalWalletInfo? walletInfo) → void
Sets the selectedWallet to be connected
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited