mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-05 10:29:23 +00:00
CW-379-Investigate-trade-ID-status-updates (#930)
* cancel Anonpay updateInvoice timer * Remove un-needed dependency injection of anonpayDetailsViewModel since it can be accessed via the parent class [skip ci] --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
53c55523c2
commit
18ba724009
1 changed files with 31 additions and 13 deletions
|
@ -20,13 +20,33 @@ class AnonpayDetailsPage extends BasePage {
|
||||||
final AnonpayDetailsViewModel anonpayDetailsViewModel;
|
final AnonpayDetailsViewModel anonpayDetailsViewModel;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) => AnonpayDetailsPageBody(anonpayDetailsViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
class AnonpayDetailsPageBody extends StatefulWidget {
|
||||||
|
AnonpayDetailsPageBody(this.anonpayDetailsViewModel);
|
||||||
|
|
||||||
|
final AnonpayDetailsViewModel anonpayDetailsViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AnonpayDetailsPageBody> createState() => _AnonpayDetailsPageBodyState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AnonpayDetailsPageBodyState extends State<AnonpayDetailsPageBody> {
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
widget.anonpayDetailsViewModel.timer?.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
return SectionStandardList(
|
return SectionStandardList(
|
||||||
context: context,
|
context: context,
|
||||||
sectionCount: 1,
|
sectionCount: 1,
|
||||||
itemCounter: (int _) => anonpayDetailsViewModel.items.length,
|
itemCounter: (int _) => widget.anonpayDetailsViewModel.items.length,
|
||||||
itemBuilder: (_, __, index) {
|
itemBuilder: (_, __, index) {
|
||||||
final item = anonpayDetailsViewModel.items[index];
|
final item = widget.anonpayDetailsViewModel.items[index];
|
||||||
|
|
||||||
if (item is DetailsListStatusItem) {
|
if (item is DetailsListStatusItem) {
|
||||||
return StandardListStatusRow(title: item.title, value: item.value);
|
return StandardListStatusRow(title: item.title, value: item.value);
|
||||||
|
@ -37,20 +57,18 @@ class AnonpayDetailsPage extends BasePage {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
create: item.createdAt,
|
create: item.createdAt,
|
||||||
pair: item.pair,
|
pair: item.pair,
|
||||||
currentTheme: anonpayDetailsViewModel.settingsStore.currentTheme.type,
|
currentTheme: widget.anonpayDetailsViewModel.settingsStore.currentTheme.type,
|
||||||
onTap: item.onTap,
|
onTap: item.onTap,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: item.value));
|
Clipboard.setData(ClipboardData(text: item.value));
|
||||||
showBar<void>(context, S.of(context).transaction_details_copied(item.title));
|
showBar<void>(context, S.of(context).transaction_details_copied(item.title));
|
||||||
},
|
},
|
||||||
child: ListRow(title: '${item.title}:', value: item.value),
|
child: ListRow(title: '${item.title}:', value: item.value),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue