Skip to content

Commit

Permalink
refactor: remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
ethicnology committed Dec 23, 2024
1 parent 9e077dd commit 6548cfc
Showing 1 changed file with 47 additions and 227 deletions.
274 changes: 47 additions & 227 deletions lib/receive/receive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ class CreateLightningInvoice extends StatelessWidget {
const Gap(48),
Center(
child: BBButton.big(
// leftIcon: FontAwesomeIcons.receipt,
leftSvgAsset: 'assets/request-payment.svg',
buttonKey: UIKeys.receiveSavePaymentButton,
loading: creatingInv,
Expand Down Expand Up @@ -939,21 +938,6 @@ class SwapFeesDetails extends StatelessWidget {
],
),
);

// return BBText.bodySmall(
// 'Lightning Network payments are converted instantly to Liquid Network Bitcoin (L-BTC). A swap fee of $fees $units will be deducted',
// );

/*
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const BBText.body('Total fees:'),
BBText.bodyBold('$fees $units'),
const Gap(16),
],
);
*/
}
}

Expand Down Expand Up @@ -995,10 +979,6 @@ class ReceiveQRDisplay extends StatelessWidget {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(address);
}

// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('Copied to clipboard')),
// );
},
child: Column(
children: [
Expand Down Expand Up @@ -1137,169 +1117,78 @@ class _ReceiveDisplayAddressState extends State<ReceiveDisplayAddress> {
context.select((ReceiveCubit x) => x.state.payjoinReceiver);

return AnimatedSwitcher(
duration: const Duration(milliseconds: 350),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BBText.body(receiveAddressLabel),
duration: const Duration(milliseconds: 350),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BBText.body(receiveAddressLabel),
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addr);
}
},
child: BBText.bodySmall(
addr,
isBlue: true,
),
),
),
IconButton(
onPressed: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addr);
}
},
iconSize: 24,
color: Colors.blue,
icon: const Icon(Icons.copy),
),
],
),
if (isPjReceiver != null)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addr);
await locator<Clippboard>().copy(addrOnly);
}

// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(
// content: Text('Copied to clipboard'),
// ),
// );
},
child: BBText.bodySmall(
addr,
isBlue: true,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const BBText.bodySmall('Address only:'),
BBText.bodySmall(
addrOnly,
isBlue: true,
),
],
),
),
),
IconButton(
onPressed: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addr);
await locator<Clippboard>().copy(addrOnly);
}

// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('Copied to clipboard')),
// );
},
iconSize: 24,
color: Colors.blue,
icon: const Icon(Icons.copy),
),
],
),
if (isPjReceiver != null)
Row(
children: [
Expanded(
child: GestureDetector(
onTap: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addrOnly);
}
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const BBText.bodySmall('Address only:'),
BBText.bodySmall(
addrOnly,
isBlue: true,
),
],
),
),
),
IconButton(
onPressed: () async {
if (locator.isRegistered<Clippboard>()) {
await locator<Clippboard>().copy(addrOnly);
}

// ScaffoldMessenger.of(context).showSnackBar(
// const SnackBar(content: Text('Copied to clipboard')),
// );
},
iconSize: 24,
color: Colors.blue,
icon: const Icon(Icons.copy),
),
],
),
],
));
],
),
);
}
}

// class CreateInvoice extends StatelessWidget {
// const CreateInvoice({super.key});

// static Future openPopUp(BuildContext context) async {
// final receiveCubit = context.read<ReceiveCubit>();
// final currencyCubit = context.read<CurrencyCubit>();

// if (currencyCubit.state.amount > 0)
// currencyCubit.convertAmtOnCurrencyChange();

// return showBBBottomSheet(
// context: context,
// child: BlocProvider.value(
// value: receiveCubit,
// child: BlocProvider.value(
// value: currencyCubit,
// child: BlocListener<ReceiveCubit, ReceiveState>(
// listenWhen: (previous, current) =>
// previous.savedInvoiceAmount != current.savedInvoiceAmount ||
// previous.savedDescription != current.savedDescription,
// listener: (context, state) {
// context.pop();
// },
// child: const Padding(
// padding: EdgeInsets.all(30),
// child: CreateInvoice(),
// ),
// ),
// ),
// ),
// );
// }

// @override
// Widget build(BuildContext context) {
// final description = context.select((ReceiveCubit _) => _.state.description);

// return Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// BBHeader.popUpCenteredText(
// text: 'Request a Payment',
// onBack: () {
// context.read<ReceiveCubit>().clearInvoiceFields();
// context.read<CurrencyCubit>().reset();

// context.pop();
// },
// ),
// const Gap(40),
// const Gap(4),
// const EnterAmount(uiKey: UIKeys.receiveAmountField),
// const Gap(24),
// const BBText.title(' Public description'),
// const Gap(4),
// BBTextInput.big(
// uiKey: UIKeys.receiveDescriptionField,
// value: description,
// hint: 'Enter description',
// onChanged: (txt) {
// context.read<ReceiveCubit>().descriptionChanged(txt);
// },
// ),
// const Gap(40),
// BBButton.big(
// buttonKey: UIKeys.receiveSavePaymentButton,
// label: 'Save',
// onPressed: () {
// final amt = context.read<CurrencyCubit>().state.amount;
// context.read<ReceiveCubit>().saveFinalInvoiceClicked(amt);
// },
// ),
// const Gap(40),
// ],
// );
// }
// }

class CheckForPaymentsButton extends StatelessWidget {
const CheckForPaymentsButton({super.key});

Expand All @@ -1313,72 +1202,3 @@ class CheckForPaymentsButton extends StatelessWidget {
);
}
}

// class AddLabelButton extends StatelessWidget {
// const AddLabelButton({super.key});

// @override
// Widget build(BuildContext context) {
// return BBButton.big(
// label: 'Add address label',
// // leftIcon: FontAwesomeIcons.penToSquare,
// leftSvgAsset: 'assets/edit.svg',
// onPressed: () {
// AddLabelPopUp.openPopUp(context);
// },
// );
// }
// }

// class AddLabelPopUp extends StatelessWidget {
// const AddLabelPopUp({super.key});

// static Future openPopUp(BuildContext context) async {
// final receive = context.read<ReceiveCubit>();
// return showBBBottomSheet(
// context: context,
// child: BlocProvider.value(
// value: receive,
// child: const Padding(
// padding: EdgeInsets.all(30),
// child: AddLabelPopUp(),
// ),
// ),
// );
// }

// @override
// Widget build(BuildContext context) {
// final value = context.select((ReceiveCubit x) => x.state.description);
// return Column(
// crossAxisAlignment: CrossAxisAlignment.stretch,
// children: [
// BBHeader.popUpCenteredText(
// text: 'Add Label',
// isLeft: true,
// onBack: () {
// context.pop();
// },
// ),
// const Gap(24),
// BBTextInput.big(
// hint: 'Enter label',
// value: value,
// onChanged: (txt) {
// context.read<ReceiveCubit>().descriptionChanged(txt);
// },
// ),
// const Gap(40),
// Center(
// child: BBButton.big(
// label: 'Save',
// onPressed: () {
// context.read<ReceiveCubit>().saveAddrressLabel();
// },
// ),
// ),
// const Gap(40),
// ],
// );
// }
// }

0 comments on commit 6548cfc

Please sign in to comment.