mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
Handle potential null value for sharePositionOrigin in backup sharing functionality
This commit is contained in:
parent
55ac972989
commit
7bef205dd2
1 changed files with 10 additions and 3 deletions
|
|
@ -176,12 +176,19 @@ Future<void> doBackUp(
|
|||
alignment: Alignment.topLeft,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
final box = () {
|
||||
try {
|
||||
return context.findRenderObject() as RenderBox?;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}();
|
||||
Share.shareXFiles(
|
||||
[XFile(p.join(path, "$name.backup"))],
|
||||
text: "$name.backup",
|
||||
sharePositionOrigin:
|
||||
box!.localToGlobal(Offset.zero) & box.size,
|
||||
sharePositionOrigin: box == null
|
||||
? null
|
||||
: box.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
},
|
||||
child: Text(context.l10n.share),
|
||||
|
|
|
|||
Loading…
Reference in a new issue