Files
hash-wallet/lib/src/widgets/evm_switcher_row.dart
T
David AdegokeandGitHub 308de0389d CW-1368: Add Binance Smart Chain (#2836)
* feat: Add Binance Smart Chain support to wallet types and EVM chain registry

* feat: Add BSC node list and support in wallet type and chain ID mappings

* feat: Add BSC default tokens and update evm utility functions

* feat: Integrate BSC support in node settings and management

* feat: Add BSC support to config scripts and wallet type generation

* feat: Add BSC support to EVM chain ID and switcher

* feat: Extend BSC support in wallet utilities and chain type checks

* feat: Add BSC support to different wallet functions

* feat: Add BSCURI class and implement for uri handling

* feat: Update Android and iOS configurations to support BSC URL schemes

* feat: Add BSC support to different functionalities and settings

* refactor: Update wallet type name from'Binance Smart Chain' to BNB Smart Chain

* feat: Add switcher icon and updates token utils

* Review fixes

* More changes to BSC name, wallet listing and images

* Add more default tokens
2026-02-05 13:48:26 +01:00

73 lines
2.2 KiB
Dart

import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/src/widgets/evm_switcher.dart';
import 'package:cake_wallet/src/widgets/standard_switch.dart';
import 'package:flutter/material.dart';
class EvmSwitcherRow extends StatelessWidget {
const EvmSwitcherRow({
super.key,
required this.editMode,
required this.selected,
required this.data,
required this.onTap,
required this.animDuration,
required this.editSwitchValue,
});
final bool editMode;
final bool selected;
final EvmSwitcherDataItem data;
final VoidCallback onTap;
final Duration animDuration;
final bool editSwitchValue;
@override
Widget build(BuildContext context) {
final Color resolvedForegroundColor = editMode || selected
? Theme.of(context).colorScheme.onSurface
: Theme.of(context).colorScheme.primary;
final Color resolvedBackgroundColor = !editMode && selected
? Theme.of(context).colorScheme.surfaceContainerHighest
: Theme.of(context).colorScheme.surfaceContainerHighest.withAlpha(0);
return GestureDetector(
onTap: onTap,
child: AnimatedContainer(
duration: animDuration,
color: resolvedBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
spacing: 8.0,
children: [
CakeImageWidget(
imageUrl: data.svgPath,
width: 16,
height: 16,
),
Text(
data.name,
style: TextStyle(color: resolvedForegroundColor, fontSize: 14),
),
if (selected && !editMode)
CakeImageWidget(
imageUrl: "assets/images/evm_switcher_checkmark.svg",
width: 18,
height: 18,
),
],
),
if (editMode) StandardSwitch(value: editSwitchValue, onTapped: onTap)
],
),
),
),
);
}
}