mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 02:26:52 +08:00
opt live room
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -7,7 +7,6 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart' show DateFormat;
|
||||
import 'package:live_photo_maker/live_photo_maker.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
@@ -31,9 +30,7 @@ class ImageUtil {
|
||||
SharePlus.instance.share(
|
||||
ShareParams(
|
||||
files: [XFile(path)],
|
||||
sharePositionOrigin: await Utils.isIpad()
|
||||
? Rect.fromLTWH(0, 0, Get.width, Get.height / 2)
|
||||
: null,
|
||||
sharePositionOrigin: await Utils.sharePositionOrigin,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,14 +40,25 @@ class Utils {
|
||||
return _isIpad!;
|
||||
}
|
||||
|
||||
static Future<Rect?> get sharePositionOrigin async {
|
||||
if (await Utils.isIpad()) {
|
||||
final size = Get.size;
|
||||
return Rect.fromLTWH(
|
||||
0,
|
||||
0,
|
||||
size.width,
|
||||
size.height / 2,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static Future<void> shareText(String text) async {
|
||||
try {
|
||||
SharePlus.instance.share(
|
||||
ShareParams(
|
||||
text: text,
|
||||
sharePositionOrigin: await Utils.isIpad()
|
||||
? Rect.fromLTWH(0, 0, Get.width, Get.height / 2)
|
||||
: null,
|
||||
sharePositionOrigin: await sharePositionOrigin,
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user