CW-383-replace-swipe-to-delete-wallet-action-with-a-delete-trash-icon-on-the-right (#935)
* feat: replace "swipe to delete" wallet action with a delete / trash icon on the right * fix: remove InkWell and _actionPane actions * feat: add a bit of padding from the end
Rafael Saes committed
Jun 9, 2023 at 19:31 UTC
e84d02f66106ce055bb92f8f57bbeace31fc0b87
1 file changed
+20
-20
lib/src/screens/wallet_list/wallet_list_page.dart
+20
-20
@@ -149,12 +149,26 @@ class WalletListBodyState extends State<WalletListBody> {
149
150
return wallet.isCurrent
151
? row
152
- : Slidable(
153
- key: Key('${wallet.key}'),
154
- startActionPane: _actionPane(wallet),
155
- endActionPane: _actionPane(wallet),
156
- child: row,
157
- );
152
+ : Row(children: [
153
+ Expanded(child: row),
154
+ GestureDetector(
155
+ onTap: () => _removeWallet(wallet),
156
+ child: Container(
157
+ height: 40,
158
+ width: 44,
159
+ padding: EdgeInsets.only(right: 20),
160
+ child: Center(
161
+ child: Image.asset('assets/images/trash.png',
162
+ height: 16,
163
+ width: 16,
164
+ color: Theme.of(context)
165
+ .primaryTextTheme
166
+ .titleLarge!
167
+ .color),
168
+ ),
169
+ ),
170
+ )
171
+ ]);
172
}),
173
),
174
),
@@ -277,18 +291,4 @@ class WalletListBodyState extends State<WalletListBody> {
291
_progressBar = null;
292
});
293
}
280
-
281
- ActionPane _actionPane(WalletListItem wallet) => ActionPane(
282
- motion: const ScrollMotion(),
283
- extentRatio: 0.3,
284
- children: [
285
- SlidableAction(
286
- onPressed: (_) => _removeWallet(wallet),
287
- backgroundColor: Colors.red,
288
- foregroundColor: Colors.white,
289
- icon: CupertinoIcons.delete,
290
- label: S.of(context).delete,
291
- ),
292
- ],
293
- );
294
}