mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
fix custom rate issue (#1579)
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ class StandardPickerListItem<T> extends TransactionDetailsListItem {
|
||||
final List<T> items;
|
||||
final String Function(T item, double sliderValue) displayItem;
|
||||
final Function(double) onSliderChanged;
|
||||
final Function(T) onItemSelected;
|
||||
final Function(T item, double sliderValue) onItemSelected;
|
||||
final int selectedIdx;
|
||||
final double? maxValue;
|
||||
final int customItemIndex;
|
||||
|
||||
@@ -23,7 +23,7 @@ class StandardPickerList<T> extends StatefulWidget {
|
||||
final int customItemIndex;
|
||||
final String Function(T item, double sliderValue) displayItem;
|
||||
final Function(double) onSliderChanged;
|
||||
final Function(T) onItemSelected;
|
||||
final Function(T item, double sliderValue) onItemSelected;
|
||||
final String value;
|
||||
final int selectedIdx;
|
||||
final double customValue;
|
||||
@@ -50,6 +50,7 @@ class _StandardPickerListState<T> extends State<StandardPickerList<T>> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String adaptedDisplayItem(T item) => widget.displayItem(item, customValue);
|
||||
String adaptedOnItemSelected(T item) => widget.onItemSelected(item, customValue).toString();
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
@@ -74,7 +75,7 @@ class _StandardPickerListState<T> extends State<StandardPickerList<T>> {
|
||||
},
|
||||
onItemSelected: (T item) {
|
||||
setState(() => selectedIdx = widget.items.indexOf(item));
|
||||
value = widget.onItemSelected(item).toString();
|
||||
value = adaptedOnItemSelected(item);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user