showAddNetwork method

Future<bool?> showAddNetwork(
  1. BuildContext context, {
  2. required NetworkConfig network,
})

Implementation

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