mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-24 12:00:31 +00:00
CW-442-Update-exchange-selector-checkboxes-with-checkboxes-from-transactions-filter-screen (#1074)
* Update checkboxes
* fix exchange provider selector
* checkbox picker refactoring
* Revert "checkbox picker refactoring"
This reverts commit 66eea9d690
.
* Update check_box_picker.dart
This commit is contained in:
parent
95ea825728
commit
572d928848
2 changed files with 50 additions and 30 deletions
lib/src
|
@ -132,6 +132,9 @@ class NodeForm extends StatelessWidget {
|
|||
Observer(
|
||||
builder: (_) => StandardCheckbox(
|
||||
value: nodeViewModel.useSSL,
|
||||
gradientBackground: true,
|
||||
borderColor: Theme.of(context).dividerColor,
|
||||
iconColor: Colors.white,
|
||||
onChanged: (value) => nodeViewModel.useSSL = value,
|
||||
caption: S.of(context).use_ssl,
|
||||
),
|
||||
|
@ -148,6 +151,9 @@ class NodeForm extends StatelessWidget {
|
|||
Observer(
|
||||
builder: (_) => StandardCheckbox(
|
||||
value: nodeViewModel.trusted,
|
||||
gradientBackground: true,
|
||||
borderColor: Theme.of(context).dividerColor,
|
||||
iconColor: Colors.white,
|
||||
onChanged: (value) => nodeViewModel.trusted = value,
|
||||
caption: S.of(context).trusted,
|
||||
),
|
||||
|
@ -166,6 +172,9 @@ class NodeForm extends StatelessWidget {
|
|||
children: [
|
||||
StandardCheckbox(
|
||||
value: nodeViewModel.useSocksProxy,
|
||||
gradientBackground: true,
|
||||
borderColor: Theme.of(context).dividerColor,
|
||||
iconColor: Colors.white,
|
||||
onChanged: (value) {
|
||||
if (!value) {
|
||||
_socksAddressController.text = '';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
|
||||
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
||||
|
@ -101,7 +102,7 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
|||
height: 1,
|
||||
)
|
||||
: const SizedBox(),
|
||||
itemCount: items == null || items.isEmpty ? 0 : items.length,
|
||||
itemCount: items.isEmpty ? 0 : items.length,
|
||||
itemBuilder: (context, index) => buildItem(index),
|
||||
),
|
||||
);
|
||||
|
@ -112,41 +113,51 @@ class CheckBoxPickerState extends State<CheckBoxPicker> {
|
|||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
if (item.isDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool newValue = !item.value;
|
||||
item.value = newValue;
|
||||
widget.onChanged(index, newValue);
|
||||
setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: 55,
|
||||
color: Theme.of(context).dialogTheme.backgroundColor,
|
||||
padding: EdgeInsets.only(left: 24, right: 24),
|
||||
child: CheckboxListTile(
|
||||
value: item.value,
|
||||
activeColor: item.value
|
||||
? Palette.blueCraiola
|
||||
: Theme.of(context).extension<FilterTheme>()!.checkboxBackgroundColor,
|
||||
checkColor: Colors.white,
|
||||
title: widget.displayItem?.call(item) ??
|
||||
Text(
|
||||
item.title,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: item.isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
),
|
||||
onChanged: (bool? value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
child: Row(
|
||||
children: [
|
||||
StandardCheckbox(
|
||||
value: item.value,
|
||||
gradientBackground: true,
|
||||
borderColor: Theme.of(context).dividerColor,
|
||||
iconColor: Colors.white,
|
||||
onChanged: (bool? value) {
|
||||
if (value == null || item.isDisabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
item.value = value;
|
||||
widget.onChanged(index, value);
|
||||
setState(() {});
|
||||
},
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
item.value = value;
|
||||
widget.onChanged(index, value);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
widget.displayItem?.call(item) ??
|
||||
Text(
|
||||
item.title,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontFamily: 'Lato',
|
||||
fontWeight: FontWeight.w600,
|
||||
color: item.isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
decoration: TextDecoration.none,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue