From 9fea5c11a2cb1e86b90ecef69d88e11a475f221b Mon Sep 17 00:00:00 2001 From: Serhii Date: Mon, 20 Mar 2023 14:44:43 +0200 Subject: [PATCH] fix checkbox --- .../widgets/unspent_coins_list_item.dart | 27 +++---------------- .../unspent_coins_list_view_model.dart | 2 +- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart b/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart index fac036f0e..7aff63332 100644 --- a/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart +++ b/lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart @@ -1,5 +1,6 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:cake_wallet/palette.dart'; +import 'package:cake_wallet/src/widgets/standard_checkbox.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -43,30 +44,8 @@ class UnspentCoinsListItem extends StatelessWidget { children: [ Padding( padding: EdgeInsets.only(right: 12), - child: GestureDetector( - onTap: () => onCheckBoxTap?.call(), - child: Container( - height: 24.0, - width: 24.0, - decoration: BoxDecoration( - border: Border.all( - color: Theme.of(context) - .primaryTextTheme! - .caption! - .color!, - width: 1.0), - borderRadius: BorderRadius.all( - Radius.circular(8.0)), - color: itemColor), - child: isSending - ? Icon( - Icons.check, - color: Colors.blue, - size: 20.0, - ) - : Offstage(), - ) - ) + child: StandardCheckbox( + value: isSending, onChanged: (value) => onCheckBoxTap?.call()) ), Expanded( child: Column( diff --git a/lib/view_model/unspent_coins/unspent_coins_list_view_model.dart b/lib/view_model/unspent_coins/unspent_coins_list_view_model.dart index dbd43fdac..cd59bdb15 100644 --- a/lib/view_model/unspent_coins/unspent_coins_list_view_model.dart +++ b/lib/view_model/unspent_coins/unspent_coins_list_view_model.dart @@ -21,7 +21,7 @@ abstract class UnspentCoinsListViewModelBase with Store { } WalletBase wallet; - Box _unspentCoinsInfo; + final Box _unspentCoinsInfo; @computed ObservableList get items => ObservableList.of(bitcoin!.getUnspents(wallet).map((elem) {