Skip to content

Commit

Permalink
fix: Remove assets background divider (#692)
Browse files Browse the repository at this point in the history
* AccountAssetsTab update background lint

* txTreeSimulationErrorHintCanFix args symbol or empty string
  • Loading branch information
knightsforce authored Dec 26, 2024
1 parent 68edb28 commit e81c3e5
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 37 deletions.
88 changes: 52 additions & 36 deletions lib/feature/wallet/widgets/account_asset_tab/account_asset_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,50 +58,65 @@ class AccountAssetsTab extends StatelessWidget {
},
);

return SliverList.separated(
itemCount: assets.length + 1,
separatorBuilder: (_, index) {
if (index == assets.length - 1) {
return const SizedBox(height: DimensSizeV2.d12);
}
return Container(
height: DimensSize.d24,
color: theme.colors.background1,
);
},
itemBuilder: (context, index) {
if (index == assets.length) {
return _FooterAssetsWidget(
final lastIndex = assets.length - 1;

return SliverMainAxisGroup(
slivers: [
DecoratedSliver(
decoration: BoxDecoration(
color: theme.colors.background0,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(DimensRadiusV2.radius16),
bottom: Radius.circular(DimensRadiusV2.radius16),
),
),
sliver: SliverList.separated(
itemCount: assets.length,
separatorBuilder: (_, index) {
if (index == lastIndex) {
return const SizedBox(height: DimensSizeV2.d12);
}
return Container(
height: DimensSize.d24,
color: theme.colors.background1,
);
},
itemBuilder: (context, index) {
return DecoratedBox(
decoration: BoxDecoration(
color: theme.colors.background1,
borderRadius: BorderRadius.vertical(
top: index == 0
? const Radius.circular(DimensRadiusV2.radius16)
: Radius.zero,
bottom: index == lastIndex
? const Radius.circular(DimensRadiusV2.radius16)
: Radius.zero,
),
),
child: Padding(
padding: EdgeInsets.only(
top: index == 0 ? DimensSizeV2.d16 : 0,
bottom: index == lastIndex ? DimensSizeV2.d16 : 0,
),
child: assets[index],
),
);
},
),
),
SliverToBoxAdapter(
child: _FooterAssetsWidget(
address: account.address,
isShowingNewTokens: isShowingNewTokens,
confirmImportCallback: confirmImportCallback,
numberNewTokens: state.when(
empty: () => null,
accounts: (_, __, newTokens) => newTokens,
),
);
}
return DecoratedBox(
decoration: BoxDecoration(
color: theme.colors.background1,
borderRadius: BorderRadius.vertical(
top: index == 0
? const Radius.circular(DimensRadiusV2.radius16)
: Radius.zero,
bottom: index == assets.length - 1
? const Radius.circular(DimensRadiusV2.radius16)
: Radius.zero,
),
),
child: Padding(
padding: EdgeInsets.only(
top: index == 0 ? DimensSizeV2.d16 : 0,
bottom: index == assets.length - 1 ? DimensSizeV2.d16 : 0,
),
child: assets[index],
),
);
},
),
],
);
},
),
Expand All @@ -126,6 +141,7 @@ class _FooterAssetsWidget extends StatelessWidget {
Widget build(BuildContext context) {
final theme = context.themeStyleV2;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: DimensSizeV2.d6),
if (isShowingNewTokens && numberNewTokens == null)
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/tx_tree_simulation_error_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class TxTreeSimulationErrorWidget extends StatelessWidget {
TextSpan(
text:
LocaleKeys.txTreeSimulationErrorHintCanFix.tr(
args: [if (symbol != null) symbol!],
args: [symbol ?? ''],
),
)
else
Expand Down

0 comments on commit e81c3e5

Please sign in to comment.