Skip to content

Commit

Permalink
feat(EWM-327): expand asset tap area (#557)
Browse files Browse the repository at this point in the history
* feat(EWM-327): expand asset tap area

* fix: analyze

---------

Co-authored-by: Egor Komarov <egor.komarov@bf.rocks>
  • Loading branch information
Odrin and Egor Komarov authored Oct 1, 2024
1 parent db0cbfa commit c2b193c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,51 +138,63 @@ class SelectNewAssetItem extends StatelessWidget {
Widget build(BuildContext context) {
final theme = context.themeStyleV2;

return Padding(
padding: const EdgeInsets.symmetric(vertical: DimensSizeV2.d8),
child: SeparatedRow(
children: [
TokenWalletIconWidget(
logoURI: asset.logoURI,
address: asset.address,
version: asset.version,
),
Expanded(
child: SeparatedColumn(
separatorSize: DimensSizeV2.d4,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
asset.symbol,
style: theme.textStyles.labelSmall,
overflow: TextOverflow.ellipsis,
softWrap: false,
maxLines: 1,
),
Text(
asset.name,
style: theme.textStyles.labelXSmall.copyWith(
color: theme.colors.content3,
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
final cubit = context.read<SelectNewAssetCubit>();
if (!isSelected) {
cubit.enableAsset(asset.address);
} else {
cubit.disableAsset(asset.address);
}
},
child: Padding(
padding: const EdgeInsets.symmetric(vertical: DimensSizeV2.d8),
child: SeparatedRow(
children: [
TokenWalletIconWidget(
logoURI: asset.logoURI,
address: asset.address,
version: asset.version,
),
Expanded(
child: SeparatedColumn(
separatorSize: DimensSizeV2.d4,
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
asset.symbol,
style: theme.textStyles.labelSmall,
overflow: TextOverflow.ellipsis,
softWrap: false,
maxLines: 1,
),
overflow: TextOverflow.ellipsis,
softWrap: false,
maxLines: 1,
),
],
Text(
asset.name,
style: theme.textStyles.labelXSmall.copyWith(
color: theme.colors.content3,
),
overflow: TextOverflow.ellipsis,
softWrap: false,
maxLines: 1,
),
],
),
),
),
Switch(
value: isSelected,
onChanged: (v) {
if (v) {
context.read<SelectNewAssetCubit>().enableAsset(asset.address);
} else {
context.read<SelectNewAssetCubit>().disableAsset(asset.address);
}
},
),
],
Switch(
value: isSelected,
onChanged: (v) {
final cubit = context.read<SelectNewAssetCubit>();
if (v) {
cubit.enableAsset(asset.address);
} else {
cubit.disableAsset(asset.address);
}
},
),
],
),
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class WalletAssetWidget extends StatelessWidget {

return GestureDetector(
onTap: onPressed,
behavior: HitTestBehavior.translucent,
child: SeparatedRow(
separatorSize: DimensSizeV2.d12,
children: [
Expand Down

0 comments on commit c2b193c

Please sign in to comment.