showSwitchNetwork method
Implementation
Future<bool?> showSwitchNetwork(
BuildContext context, {
required NetworkConfig chain,
}) async {
return await _showDialog(
context: context,
builder: (context) => ListView(
shrinkWrap: true,
padding: _theme.contentPadding,
children: [
_buildDialogHeader('Switch Network?'),
SizedBox(height: _theme.itemSpacing),
_buildInfoRow('Chain ID', chain.chainId.toString()),
SizedBox(height: _theme.itemSpacing),
_buildInfoRow('Chain Name', chain.chainName),
if (chain.nativeCurrency?.symbol != null) ...[
SizedBox(height: _theme.itemSpacing),
_buildInfoRow('Currency', chain.nativeCurrency!.symbol),
],
if (chain.nativeCurrency?.decimals != null) ...[
SizedBox(height: _theme.itemSpacing),
_buildInfoRow(
'Decimals', chain.nativeCurrency!.decimals.toString()),
],
SizedBox(height: _theme.itemSpacing * 2),
_buildActionButtons(
context: context,
cancelText: 'Cancel',
confirmText: 'Confirm',
),
],
),
);
}