Skip to content

Commit

Permalink
chore: rename field to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
bonomat committed Mar 25, 2024
1 parent 7410d39 commit 6364766
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mobile/lib/common/amount_input_modalised.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _EnterAmountModalState extends State<EnterAmountModal> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
AmountInputField(
value: widget.amount != null ? Amount(widget.amount!) : Amount.zero(),
initialValue: widget.amount != null ? Amount(widget.amount!) : Amount.zero(),
hint: "e.g. $hint",
label: "Amount",
validator: widget.validator,
Expand Down
6 changes: 3 additions & 3 deletions mobile/lib/common/amount_text_input_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AmountInputField extends StatelessWidget {
this.label = '',
this.hint = '',
this.onChanged,
required this.value,
required this.initialValue,
this.isLoading = false,
this.suffixIcon,
this.controller,
Expand All @@ -23,7 +23,7 @@ class AmountInputField extends StatelessWidget {

final TextEditingController? controller;
final TextStyle? style;
final Amount value;
final Amount initialValue;
final bool enabled;
final String label;
final String hint;
Expand All @@ -41,7 +41,7 @@ class AmountInputField extends StatelessWidget {
style: style ?? const TextStyle(color: Colors.black87, fontSize: 16),
enabled: enabled,
controller: controller,
initialValue: controller != null ? null : value.formatted(),
initialValue: controller != null ? null : initialValue.formatted(),
keyboardType: TextInputType.number,
decoration: decoration ??
InputDecoration(
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/features/trade/channel_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class _ChannelConfiguration extends State<ChannelConfiguration> {
children: [
Flexible(
child: AmountInputField(
value: ownTotalCollateral,
initialValue: ownTotalCollateral,
controller: _collateralController,
label: 'Your collateral (sats)',
onChanged: (value) {
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/features/trade/trade_bottom_sheet_tab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class _TradeBottomSheetTabState extends State<TradeBottomSheetTab> {
children: [
Flexible(
child: AmountInputField(
value: tradeValues.quantity ?? Amount.zero(),
initialValue: tradeValues.quantity ?? Amount.zero(),
hint: "e.g. 100 USD",
label: "Quantity (USD)",
onChanged: (value) {
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/features/wallet/send/fee_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class _FeePickerModalState extends State<_FeePickerModal> {
"sats/vbyte",
style: TextStyle(fontSize: 16, color: Color(0xff878787)),
)),
value: Amount(1)),
initialValue: Amount(1)),
),
),
const SizedBox(height: 25),
Expand Down
6 changes: 3 additions & 3 deletions webapp/frontend/lib/common/amount_text_input_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AmountInputField extends StatelessWidget {
this.label = '',
this.hint = '',
this.onChanged,
this.value,
this.initialValue,
this.isLoading = false,
this.infoText,
this.controller,
Expand All @@ -27,7 +27,7 @@ class AmountInputField extends StatelessWidget {

final TextEditingController? controller;
final TextStyle? style;
final Formattable? value;
final Formattable? initialValue;
final bool enabled;
final String label;
final String hint;
Expand All @@ -48,7 +48,7 @@ class AmountInputField extends StatelessWidget {
enabled: enabled,
controller: controller,
textAlign: textAlign,
initialValue: controller != null ? null : value?.formatted(),
initialValue: controller != null ? null : initialValue?.formatted(),
keyboardType: TextInputType.number,
decoration: decoration ??
InputDecoration(
Expand Down
2 changes: 1 addition & 1 deletion webapp/frontend/lib/trade/trade_screen_order_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _NewOrderForm extends State<NewOrderForm> {
Align(
alignment: AlignmentDirectional.centerEnd,
child: AmountInputField(
value: _quantity,
initialValue: _quantity,
enabled: true,
label: "Quantity",
textAlign: TextAlign.right,
Expand Down
4 changes: 2 additions & 2 deletions webapp/frontend/lib/wallet/send_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _SendScreenState extends State<SendScreen> {
),
const SizedBox(height: 20),
AmountInputField(
value: amount != null ? amount! : Amount.zero(),
initialValue: amount != null ? amount! : Amount.zero(),
label: "Amount in sats",
controller: _amountController,
validator: (value) {
Expand All @@ -88,7 +88,7 @@ class _SendScreenState extends State<SendScreen> {
),
const SizedBox(height: 20),
AmountInputField(
value: fee != null ? fee! : Amount.zero(),
initialValue: fee != null ? fee! : Amount.zero(),
label: "Sats/vb",
controller: _feeController,
validator: (value) {
Expand Down

0 comments on commit 6364766

Please sign in to comment.