Merge branch 'main' of https://github.com/cake-tech/cake_wallet into mweb-bg-sync-2
BIN
assets/images/flags/abw.png
Normal file
After ![]() (image error) Size: 607 B |
BIN
assets/images/flags/afg.png
Normal file
After ![]() (image error) Size: 1.8 KiB |
BIN
assets/images/flags/ago.png
Normal file
After ![]() (image error) Size: 1.1 KiB |
BIN
assets/images/flags/aia.png
Normal file
After ![]() (image error) Size: 1.3 KiB |
BIN
assets/images/flags/and.png
Normal file
After ![]() (image error) Size: 1.9 KiB |
BIN
assets/images/flags/asm.png
Normal file
After ![]() (image error) Size: 503 B |
BIN
assets/images/flags/atf.png
Normal file
After ![]() (image error) Size: 1.3 KiB |
BIN
assets/images/flags/atg.png
Normal file
After ![]() (image error) Size: 963 B |
BIN
assets/images/flags/aut.png
Normal file
After ![]() (image error) Size: 125 B |
BIN
assets/images/flags/aze.png
Normal file
After ![]() (image error) Size: 717 B |
BIN
assets/images/flags/bel.png
Normal file
After ![]() (image error) Size: 127 B |
BIN
assets/images/flags/bes.png
Normal file
After ![]() (image error) Size: 236 B |
BIN
assets/images/flags/bhr.png
Normal file
After ![]() (image error) Size: 567 B |
BIN
assets/images/flags/blz.png
Normal file
After ![]() (image error) Size: 1.7 KiB |
BIN
assets/images/flags/bmu.png
Normal file
After ![]() (image error) Size: 1.5 KiB |
BIN
assets/images/flags/bol.png
Normal file
After ![]() (image error) Size: 668 B |
BIN
assets/images/flags/brn.png
Normal file
After ![]() (image error) Size: 1.9 KiB |
BIN
assets/images/flags/btn.png
Normal file
After ![]() (image error) Size: 3.9 KiB |
BIN
assets/images/flags/bvt.png
Normal file
After ![]() (image error) Size: 147 B |
BIN
assets/images/flags/bwa.png
Normal file
After ![]() (image error) Size: 134 B |
BIN
assets/images/flags/cck.png
Normal file
After ![]() (image error) Size: 1.1 KiB |
BIN
assets/images/flags/cmr.png
Normal file
After ![]() (image error) Size: 402 B |
BIN
assets/images/flags/cok.png
Normal file
After ![]() (image error) Size: 1.4 KiB |
BIN
assets/images/flags/cpv.png
Normal file
After ![]() (image error) Size: 297 B |
BIN
assets/images/flags/cri.png
Normal file
After ![]() (image error) Size: 136 B |
BIN
assets/images/flags/cuw.png
Normal file
After ![]() (image error) Size: 481 B |
BIN
assets/images/flags/cxr.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
BIN
assets/images/flags/cyp.png
Normal file
After ![]() (image error) Size: 1.1 KiB |
BIN
assets/images/flags/dji.png
Normal file
After ![]() (image error) Size: 387 B |
BIN
assets/images/flags/dma.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
BIN
assets/images/flags/dza.png
Normal file
After ![]() (image error) Size: 518 B |
BIN
assets/images/flags/ecu.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
BIN
assets/images/flags/est.png
Normal file
After ![]() (image error) Size: 130 B |
BIN
assets/images/flags/eth.png
Normal file
After ![]() (image error) Size: 1.5 KiB |
BIN
assets/images/flags/fin.png
Normal file
After ![]() (image error) Size: 131 B |
BIN
assets/images/flags/fji.png
Normal file
After ![]() (image error) Size: 1.5 KiB |
BIN
assets/images/flags/flk.png
Normal file
After ![]() (image error) Size: 1.6 KiB |
BIN
assets/images/flags/fro.png
Normal file
After ![]() (image error) Size: 147 B |
BIN
assets/images/flags/fsm.png
Normal file
After ![]() (image error) Size: 340 B |
BIN
assets/images/flags/gab.png
Normal file
After ![]() (image error) Size: 130 B |
BIN
assets/images/flags/geo.png
Normal file
After ![]() (image error) Size: 187 B |
BIN
assets/images/flags/ggi.png
Normal file
After ![]() (image error) Size: 892 B |
BIN
assets/images/flags/ggy.png
Normal file
After ![]() (image error) Size: 192 B |
BIN
assets/images/flags/glp.png
Normal file
After ![]() (image error) Size: 1.8 KiB |
BIN
assets/images/flags/gmb.png
Normal file
After ![]() (image error) Size: 278 B |
BIN
assets/images/flags/grc.png
Normal file
After ![]() (image error) Size: 436 B |
BIN
assets/images/flags/grd.png
Normal file
After ![]() (image error) Size: 892 B |
BIN
assets/images/flags/grl.png
Normal file
After ![]() (image error) Size: 407 B |
BIN
assets/images/flags/guf.png
Normal file
After ![]() (image error) Size: 581 B |
BIN
assets/images/flags/gum.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
BIN
assets/images/flags/guy.png
Normal file
After ![]() (image error) Size: 635 B |
BIN
assets/images/flags/hmd.png
Normal file
After ![]() (image error) Size: 780 B |
BIN
assets/images/flags/iot.png
Normal file
After ![]() (image error) Size: 2.4 KiB |
BIN
assets/images/flags/irl.png
Normal file
After ![]() (image error) Size: 127 B |
BIN
assets/images/flags/jam.png
Normal file
After ![]() (image error) Size: 526 B |
BIN
assets/images/flags/jey.png
Normal file
After ![]() (image error) Size: 914 B |
BIN
assets/images/flags/jor.png
Normal file
After ![]() (image error) Size: 3.1 KiB |
BIN
assets/images/flags/kaz.png
Normal file
After ![]() (image error) Size: 1.7 KiB |
BIN
assets/images/flags/ken.png
Normal file
After ![]() (image error) Size: 2 KiB |
BIN
assets/images/flags/kir.png
Normal file
After ![]() (image error) Size: 2.1 KiB |
BIN
assets/images/flags/kwt.png
Normal file
After ![]() (image error) Size: 372 B |
BIN
assets/images/flags/lbn.png
Normal file
After ![]() (image error) Size: 960 B |
BIN
assets/images/flags/lie.png
Normal file
After ![]() (image error) Size: 844 B |
BIN
assets/images/flags/lka.png
Normal file
After ![]() (image error) Size: 1.7 KiB |
BIN
assets/images/flags/ltu.png
Normal file
After ![]() (image error) Size: 130 B |
BIN
assets/images/flags/lux.png
Normal file
After ![]() (image error) Size: 130 B |
BIN
assets/images/flags/lva.png
Normal file
After ![]() (image error) Size: 124 B |
BIN
assets/images/flags/mco.png
Normal file
After ![]() (image error) Size: 204 B |
BIN
assets/images/flags/mlt.png
Normal file
After ![]() (image error) Size: 485 B |
BIN
assets/images/flags/mnp.png
Normal file
After ![]() (image error) Size: 2 KiB |
BIN
assets/images/flags/mrt.png
Normal file
After ![]() (image error) Size: 509 B |
BIN
assets/images/flags/msr.png
Normal file
After ![]() (image error) Size: 1.5 KiB |
BIN
assets/images/flags/mtq.png
Normal file
After ![]() (image error) Size: 1.5 KiB |
BIN
assets/images/flags/mwi.png
Normal file
After ![]() (image error) Size: 754 B |
BIN
assets/images/flags/myt.png
Normal file
After ![]() (image error) Size: 2 KiB |
BIN
assets/images/flags/ner.png
Normal file
After ![]() (image error) Size: 494 B |
BIN
assets/images/flags/nfk.png
Normal file
After ![]() (image error) Size: 1.4 KiB |
BIN
assets/images/flags/niu.png
Normal file
After ![]() (image error) Size: 1.1 KiB |
BIN
assets/images/flags/omn.png
Normal file
After ![]() (image error) Size: 711 B |
BIN
assets/images/flags/per.png
Normal file
After ![]() (image error) Size: 123 B |
BIN
assets/images/flags/plw.png
Normal file
After ![]() (image error) Size: 608 B |
BIN
assets/images/flags/pri.png
Normal file
After ![]() (image error) Size: 1.8 KiB |
BIN
assets/images/flags/pyf.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
BIN
assets/images/flags/qat.png
Normal file
After ![]() (image error) Size: 2 KiB |
BIN
assets/images/flags/slb.png
Normal file
After ![]() (image error) Size: 403 B |
BIN
assets/images/flags/slv.png
Normal file
After ![]() (image error) Size: 642 B |
BIN
assets/images/flags/svk.png
Normal file
After ![]() (image error) Size: 521 B |
BIN
assets/images/flags/svn.png
Normal file
After ![]() (image error) Size: 1.9 KiB |
BIN
assets/images/flags/tkm.png
Normal file
After ![]() (image error) Size: 1.6 KiB |
BIN
assets/images/flags/ton.png
Normal file
After ![]() (image error) Size: 139 B |
BIN
assets/images/flags/tuv.png
Normal file
After ![]() (image error) Size: 1.4 KiB |
BIN
assets/images/flags/ury.png
Normal file
After ![]() (image error) Size: 1,017 B |
BIN
assets/images/flags/vat.png
Normal file
After ![]() (image error) Size: 851 B |
BIN
assets/images/flags/vir.png
Normal file
After ![]() (image error) Size: 1.9 KiB |
BIN
assets/images/flags/vut.png
Normal file
After ![]() (image error) Size: 1.2 KiB |
|
@ -393,7 +393,6 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
|
|||
// if the confirmations haven't changed, skip updating:
|
||||
if (tx.confirmations == confirmations) continue;
|
||||
|
||||
// print("updating confs ${tx.id} from ${tx.confirmations} -> $confirmations");
|
||||
|
||||
// if an outgoing tx is now confirmed, delete the utxo from the box (delete the unspent coin):
|
||||
if (confirmations >= 2 &&
|
||||
|
|
|
@ -73,6 +73,7 @@ dependency_overrides:
|
|||
|
||||
# The following section is specific to Flutter.
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your package, add an assets section, like this:
|
||||
# assets:
|
||||
|
|
|
@ -49,6 +49,7 @@ dependency_overrides:
|
|||
|
||||
# The following section is specific to Flutter packages.
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your package, add an assets section, like this:
|
||||
# assets:
|
||||
|
|
|
@ -47,6 +47,7 @@ dependency_overrides:
|
|||
|
||||
# The following section is specific to Flutter.
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your package, add an assets section, like this:
|
||||
# assets:
|
||||
|
|
|
@ -10,10 +10,16 @@ class CommonTestCases {
|
|||
hasType<T>();
|
||||
}
|
||||
|
||||
Future<void> tapItemByKey(String key, {bool shouldPumpAndSettle = true}) async {
|
||||
Future<void> tapItemByKey(
|
||||
String key, {
|
||||
bool shouldPumpAndSettle = true,
|
||||
int pumpDuration = 100,
|
||||
}) async {
|
||||
final widget = find.byKey(ValueKey(key));
|
||||
await tester.tap(widget);
|
||||
shouldPumpAndSettle ? await tester.pumpAndSettle() : await tester.pump();
|
||||
shouldPumpAndSettle
|
||||
? await tester.pumpAndSettle(Duration(milliseconds: pumpDuration))
|
||||
: await tester.pump();
|
||||
}
|
||||
|
||||
Future<void> tapItemByFinder(Finder finder, {bool shouldPumpAndSettle = true}) async {
|
||||
|
@ -31,6 +37,11 @@ class CommonTestCases {
|
|||
expect(typeWidget, findsOneWidget);
|
||||
}
|
||||
|
||||
bool isKeyPresent(String key) {
|
||||
final typeWidget = find.byKey(ValueKey(key));
|
||||
return typeWidget.tryEvaluate();
|
||||
}
|
||||
|
||||
void hasValueKey(String key) {
|
||||
final typeWidget = find.byKey(ValueKey(key));
|
||||
expect(typeWidget, findsOneWidget);
|
||||
|
@ -53,33 +64,86 @@ class CommonTestCases {
|
|||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
Future<void> scrollUntilVisible(String childKey, String parentScrollableKey,
|
||||
{double delta = 300}) async {
|
||||
final scrollableWidget = find.descendant(
|
||||
of: find.byKey(Key(parentScrollableKey)),
|
||||
Future<void> dragUntilVisible(String childKey, String parentKey) async {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final itemFinder = find.byKey(ValueKey(childKey));
|
||||
final listFinder = find.byKey(ValueKey(parentKey));
|
||||
|
||||
// Check if the widget is already in the widget tree
|
||||
if (tester.any(itemFinder)) {
|
||||
// Widget is already built and in the tree
|
||||
tester.printToConsole('Child is already present');
|
||||
return;
|
||||
}
|
||||
|
||||
// We can adjust this as needed
|
||||
final maxScrolls = 200;
|
||||
|
||||
int scrolls = 0;
|
||||
bool found = false;
|
||||
|
||||
// We start by scrolling down
|
||||
bool scrollDown = true;
|
||||
|
||||
// Flag to check if we've already reversed direction
|
||||
bool reversedDirection = false;
|
||||
|
||||
// Find the Scrollable associated with the Parent Ad
|
||||
final scrollableFinder = find.descendant(
|
||||
of: listFinder,
|
||||
matching: find.byType(Scrollable),
|
||||
);
|
||||
|
||||
final isAlreadyVisibile = isWidgetVisible(find.byKey(ValueKey(childKey)));
|
||||
|
||||
if (isAlreadyVisibile) return;
|
||||
|
||||
await tester.scrollUntilVisible(
|
||||
find.byKey(ValueKey(childKey)),
|
||||
delta,
|
||||
scrollable: scrollableWidget,
|
||||
// Ensure that the Scrollable is found
|
||||
expect(
|
||||
scrollableFinder,
|
||||
findsOneWidget,
|
||||
reason: 'Scrollable descendant of the Parent Widget not found.',
|
||||
);
|
||||
}
|
||||
|
||||
bool isWidgetVisible(Finder finder) {
|
||||
try {
|
||||
final Element element = finder.evaluate().single;
|
||||
final RenderBox renderBox = element.renderObject as RenderBox;
|
||||
return renderBox.paintBounds
|
||||
.shift(renderBox.localToGlobal(Offset.zero))
|
||||
.overlaps(tester.binding.renderViews.first.paintBounds);
|
||||
} catch (e) {
|
||||
return false;
|
||||
// Get the initial scroll position
|
||||
final scrollableState = tester.state<ScrollableState>(scrollableFinder);
|
||||
double previousScrollPosition = scrollableState.position.pixels;
|
||||
|
||||
while (!found && scrolls < maxScrolls) {
|
||||
tester.printToConsole('Scrolling ${scrollDown ? 'down' : 'up'}, attempt $scrolls');
|
||||
|
||||
// Perform the drag in the current direction
|
||||
await tester.drag(
|
||||
scrollableFinder,
|
||||
scrollDown ? const Offset(0, -100) : const Offset(0, 100),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
scrolls++;
|
||||
|
||||
// Update the scroll position after the drag
|
||||
final currentScrollPosition = scrollableState.position.pixels;
|
||||
|
||||
if (currentScrollPosition == previousScrollPosition) {
|
||||
// Cannot scroll further in this direction
|
||||
if (reversedDirection) {
|
||||
// We've already tried both directions
|
||||
tester.printToConsole('Cannot scroll further in both directions. Widget not found.');
|
||||
break;
|
||||
} else {
|
||||
// Reverse the scroll direction
|
||||
scrollDown = !scrollDown;
|
||||
reversedDirection = true;
|
||||
tester.printToConsole('Reached the end, reversing direction');
|
||||
}
|
||||
} else {
|
||||
// Continue scrolling in the current direction
|
||||
previousScrollPosition = currentScrollPosition;
|
||||
}
|
||||
|
||||
// Check if the widget is now in the widget tree
|
||||
found = tester.any(itemFinder);
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
tester.printToConsole('Widget not found after scrolling in both directions.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +155,15 @@ class CommonTestCases {
|
|||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
void findWidgetViaDescendant({
|
||||
required FinderBase<Element> of,
|
||||
required FinderBase<Element> matching,
|
||||
}) {
|
||||
final textWidget = find.descendant(of: of, matching: matching);
|
||||
|
||||
expect(textWidget, findsOneWidget);
|
||||
}
|
||||
|
||||
Future<void> defaultSleepTime({int seconds = 2}) async =>
|
||||
await Future.delayed(Duration(seconds: seconds));
|
||||
}
|
||||
|
|