Skip to content
Snippets Groups Projects
Commit db06d08b authored by vjrj's avatar vjrj
Browse files

More work with payments

parent 6573bb68
No related branches found
No related tags found
No related merge requests found
......@@ -53,4 +53,8 @@ class PaymentCubit extends HydratedCubit<PaymentState> {
void selectAmount(double amount) {
emit(state.copyWith(amount: amount));
}
void setDescription(String description) {
emit(state.copyWith(description: description));
}
}
......@@ -427,10 +427,14 @@ Future<String> pay(
final List<Node> nodes = nodesWorkingList(NodeType.gva);
// reorder list to use others
if (nodes.isNotEmpty) {
nodes.shuffle();
// nodes.shuffle();
// no hay Retry?
try {
final Gva gva = Gva(node: nodes.first.url);
final String node = nodes.first.url;
final Gva gva = Gva(node: node);
final CesiumWallet wallet = await SharedPreferencesHelper().getWallet();
print(
'Trying to send $amount to $to with comment ${comment ?? ''} and $node');
final String response = await gva.pay(
recipient: to,
amount: amount,
......
......@@ -35,6 +35,11 @@ class _PayFormState extends State<PayForm> {
const SizedBox(height: 10.0),
TextField(
controller: _commentController,
onChanged: (String? value) {
if (value != null) {
context.read<PaymentCubit>().setDescription(value);
}
},
decoration: InputDecoration(
labelText: tr('g1_form_pay_desc'),
hintText: tr('g1_form_pay_hint'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment