mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Allow Exporting transaction history to a CSV file (#3230)
* Allow Exporting transaction history to a CSV file * fix: improve safety for share dialog bounds and navigation pop
This commit is contained in:
@@ -33,8 +33,20 @@ class ShareUtil {
|
||||
return Rect.zero;
|
||||
}
|
||||
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
final renderObject = context.findRenderObject();
|
||||
if (renderObject is! RenderBox) {
|
||||
return Rect.zero;
|
||||
}
|
||||
|
||||
return box!.localToGlobal(Offset.zero) & box.size;
|
||||
final rect = renderObject.localToGlobal(Offset.zero) & renderObject.size;
|
||||
// iOS requires sharePositionOrigin to lie fully within the source view's
|
||||
// bounds; clip to the screen so an offset/oversized page rect doesn't spill
|
||||
// past the edge and trigger a PlatformException on iPad.
|
||||
final screen = Offset.zero & MediaQuery.of(context).size;
|
||||
final clipped = rect.intersect(screen);
|
||||
if (clipped.isEmpty) {
|
||||
return Rect.zero;
|
||||
}
|
||||
return clipped;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user