mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-10 08:33:54 +01:00
Cw 870 ethereum enhancements (#1951)
* fix evm balance display issues * fix adding token * fix tab controller issue * Update cw_evm/lib/evm_chain_client.dart [skip ci] --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -212,15 +212,34 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
|
||||
_contractAddressController.text,
|
||||
);
|
||||
final actionCall = () async {
|
||||
await widget.homeSettingsViewModel.addToken(
|
||||
token: CryptoCurrency(
|
||||
name: _tokenNameController.text,
|
||||
title: _tokenSymbolController.text.toUpperCase(),
|
||||
decimals: int.parse(_tokenDecimalController.text),
|
||||
iconPath: _tokenIconPathController.text,
|
||||
),
|
||||
contractAddress: _contractAddressController.text,
|
||||
);
|
||||
try {
|
||||
await widget.homeSettingsViewModel.addToken(
|
||||
token: CryptoCurrency(
|
||||
name: _tokenNameController.text,
|
||||
title: _tokenSymbolController.text.toUpperCase(),
|
||||
decimals: int.parse(_tokenDecimalController.text),
|
||||
iconPath: _tokenIconPathController.text,
|
||||
),
|
||||
contractAddress: _contractAddressController.text,
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
return AlertWithOneAction(
|
||||
alertTitle: S.current.warning,
|
||||
alertContent: e.toString(),
|
||||
buttonText: S.of(context).ok,
|
||||
buttonAction: () => Navigator.of(dialogContext).pop(),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
if (hasPotentialError) {
|
||||
@@ -235,9 +254,6 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
|
||||
actionRightButton: () async {
|
||||
Navigator.of(dialogContext).pop();
|
||||
await actionCall();
|
||||
if (mounted) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
},
|
||||
actionLeftButton: () => Navigator.of(dialogContext).pop(),
|
||||
);
|
||||
|
||||
@@ -25,6 +25,7 @@ class BalancePage extends StatelessWidget {
|
||||
builder: (context) {
|
||||
final isEVMCompatible = isEVMCompatibleChain(dashboardViewModel.type);
|
||||
return DefaultTabController(
|
||||
key: ValueKey<bool>(isEVMCompatible),
|
||||
length: isEVMCompatible ? 2 : 1,
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user