补充提交
This commit is contained in:
parent
50f0cc554a
commit
356c671ae7
@ -121,6 +121,10 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSFileProtectionKey</key>
|
||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||
<key>UIFileSharingEnabled</key>
|
||||
<true/>
|
||||
<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@ -48,12 +48,19 @@
|
||||
self.textToShare = paramDic[@"shareText"];
|
||||
self.urlToShare = paramDic[@"urlToShare"];
|
||||
}
|
||||
//分享的url
|
||||
NSURL *urlToShare = [NSURL URLWithString:self.urlToShare];
|
||||
// NSURL *urlToShare = [NSURL URLWithString:@"https://pre.lock.star-lock.cn:8093/login"];
|
||||
if ([self.urlToShare isEqualToString:"fileShare"]) {
|
||||
// 创建要分享或操作的文件对象
|
||||
let fileURL = URL(fileURLWithPath: "/path/to/file.pdf")
|
||||
|
||||
//在这里呢 如果想分享图片 就把图片添加进去 文字什么的通上
|
||||
NSArray *activityItems = @[self.textToShare,urlToShare];
|
||||
// 将文件对象添加到数组中
|
||||
let activityItems = [fileURL]
|
||||
} else {
|
||||
//分享的url
|
||||
NSURL *urlToShare = [NSURL URLWithString:self.urlToShare];
|
||||
|
||||
//在这里呢 如果想分享图片 就把图片添加进去 文字什么的通上
|
||||
NSArray *activityItems = @[self.textToShare,urlToShare];
|
||||
}
|
||||
|
||||
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ class _ExportSuccessPageState extends State<ExportSuccessPage> with RouteAware {
|
||||
SubmitBtn(
|
||||
btnName: '立即查看'.tr,
|
||||
onClick: () {
|
||||
// OpenFile.open(state.getFilePath.value);
|
||||
OpenFile.open(state.getFilePath.value);
|
||||
NativeInteractionTool()
|
||||
.loadNativeFileShare(shareText: state.getFilePath.value);
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:excel/excel.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
@ -26,28 +25,6 @@ class _ViewExportRecordPageState extends State<ViewExportRecordPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
loadExcel();
|
||||
}
|
||||
|
||||
Future<void> loadExcel() async {
|
||||
try {
|
||||
final Directory appDocDir = await getApplicationDocumentsDirectory();
|
||||
final String appDocPath = appDocDir.path;
|
||||
final String filePath = '$appDocPath/exported_file.xlsx';
|
||||
|
||||
final Uint8List bytes = File(filePath).readAsBytesSync();
|
||||
final Excel excel = Excel.decodeBytes(bytes);
|
||||
|
||||
for (final String table in excel.tables.keys) {
|
||||
for (final List<Data?> row in excel.tables[table]!.rows) {
|
||||
setState(() {
|
||||
state.excelData.add(row);
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error reading Excel: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -21,8 +21,14 @@ class NativeInteractionTool {
|
||||
///加载原生分享
|
||||
void loadNativeShare({required String shareText}) {
|
||||
final String urlToShare = '${F.apiPrefix}/apps';
|
||||
sendChannel.invokeMethod(
|
||||
'loadNativeShare', <String, String>{'shareText': shareText,'urlToShare':urlToShare});
|
||||
sendChannel.invokeMethod('loadNativeShare',
|
||||
<String, String>{'shareText': shareText, 'urlToShare': urlToShare});
|
||||
}
|
||||
|
||||
///加载原生文件分享
|
||||
void loadNativeFileShare({required String shareText}) {
|
||||
sendChannel.invokeMethod('loadNativeShare',
|
||||
<String, String>{'shareText': shareText, 'urlToShare': 'fileShare'});
|
||||
}
|
||||
|
||||
///获取设备蓝牙状态
|
||||
|
||||
@ -217,6 +217,7 @@ dependencies:
|
||||
file_picker: ^5.3.1
|
||||
# 错误日志监控
|
||||
flutter_bugly_plugin: ^0.0.9
|
||||
open_file: ^3.3.2
|
||||
|
||||
dependency_overrides:
|
||||
#强制设置google_maps_flutter_ios 为 2.5.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user