mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-29 04:49:51 +00:00
- Add Linter rules for return types and final fields
- Enhance exception_handler code - Add ShareUtil to unify modification point
This commit is contained in:
parent
318e3b92e5
commit
8a45cb4dc7
7 changed files with 44 additions and 38 deletions
13
lib/utils/share_util.dart
Normal file
13
lib/utils/share_util.dart
Normal file
|
@ -0,0 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
class ShareUtil {
|
||||
static void share({required String text, required BuildContext context}) {
|
||||
final box = context.findRenderObject() as RenderBox?;
|
||||
|
||||
Share.share(
|
||||
text,
|
||||
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue