feat(delete):删除里面文件夹

This commit is contained in:
2025-10-23 10:47:53 +08:00
parent 35d26643ba
commit 55ab438c11
75 changed files with 2424 additions and 41 deletions

View File

@@ -0,0 +1,89 @@
// import 'dart:async';
//
// import 'package:flutter/material.dart';
// import 'package:flutter_cached_pdfview/flutter_cached_pdfview.dart';
//
// class CustomerPDFPage extends StatefulWidget {
// final String filePath;
// const CustomerPDFPage({
// super.key,
// required this.filePath,
// });
//
// @override
// State<CustomerPDFPage> createState() => _CustomerPDFPageState();
// }
//
// class _CustomerPDFPageState extends State<CustomerPDFPage> {
// final StreamController<String> _pageCountController =
// StreamController<String>();
// final Completer<PDFViewController> _pdfViewController =
// Completer<PDFViewController>();
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body: SafeArea(
// child: Stack(
// children: [
// PDF(
// onPageChanged: (int? current, int? total) =>
// _pageCountController.add('${current! + 1} - $total'),
// onViewCreated: (PDFViewController pdfViewController) async {
// _pdfViewController.complete(pdfViewController);
// final int currentPage =
// await pdfViewController.getCurrentPage() ?? 0;
// final int? pageCount = await pdfViewController.getPageCount();
// _pageCountController.add('${currentPage + 1} - $pageCount');
// },
// ).cachedFromUrl(
// widget.filePath,
// placeholder: (progress) => Center(child: Text('$progress %')),
// errorWidget: (error) => Center(child: Text(error.toString())),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// GestureDetector(
// onTap: () => Navigator.pop(context),
// child: Container(
// margin: const EdgeInsets.only(left: 16, top: 16),
// width: 44,
// height: 44,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(22),
// color: Colors.grey.withOpacity(0.3),
// ),
// child: const Icon(
// Icons.navigate_before,
// color: Colors.white,
// ),
// ),
// ),
// Container(
// margin: const EdgeInsets.only(right: 16, top: 16),
// width: 88,
// height: 44,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(22),
// color: Colors.grey.withOpacity(0.3),
// ),
// child: StreamBuilder<String>(
// stream: _pageCountController.stream,
// builder: (_, AsyncSnapshot<String> snapshot) {
// if (snapshot.hasData) {
// return Center(
// child: Text(snapshot.data!),
// );
// }
// return const SizedBox();
// }),
// ),
// ],
// ),
// ],
// ),
// ),
// );
// }
// }

View File

@@ -0,0 +1,149 @@
import 'dart:collection';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class CustomerWebView extends StatefulWidget {
final String url;
final bool? hideBack;
const CustomerWebView({
super.key,
required this.url,
this.hideBack,
});
@override
State<CustomerWebView> createState() => _CustomerWebViewState();
}
class _CustomerWebViewState extends State<CustomerWebView> {
final GlobalKey webViewKey = GlobalKey();
InAppWebViewController? webViewController;
InAppWebViewSettings settings = InAppWebViewSettings(
isInspectable: kDebugMode,
mediaPlaybackRequiresUserGesture: false,
allowsInlineMediaPlayback: true,
iframeAllow: "camera; microphone",
iframeAllowFullscreen: true);
@override
void initState() {
super.initState();
webViewController?.loadUrl(urlRequest: URLRequest(url: WebUri(widget.url)));
}
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.bottom]);
return Stack(
alignment: Alignment.topLeft,
children: [
InAppWebView(
key: webViewKey,
// webViewEnvironment: webViewEnvironment,
initialUrlRequest: URLRequest(url: WebUri(widget.url)),
// initialUrlRequest:
// URLRequest(url: WebUri(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
// initialFile: "assets/index.html",
initialUserScripts: UnmodifiableListView<UserScript>([]),
initialSettings: settings,
// contextMenu: contextMenu,
// pullToRefreshController: pullToRefreshController,
onWebViewCreated: (controller) async {
webViewController = controller;
},
onLoadStart: (controller, url) {
setState(() {
// this.url = url.toString();
// urlController.text = this.url;
});
},
// onPermissionRequest: (controller, request) {
// return PermissionResponse(
// resources: request.resources,
// action: PermissionResponseAction.GRANT);
// },
// shouldOverrideUrlLoading:
// (controller, navigationAction) async {
// var uri = navigationAction.request.url!;
//
// if (![
// "http",
// "https",
// "file",
// "chrome",
// "data",
// "javascript",
// "about"
// ].contains(uri.scheme)) {
// if (await canLaunchUrl(uri)) {
// // Launch the App
// await launchUrl(
// uri,
// );
// // and cancel the request
// return NavigationActionPolicy.CANCEL;
// }
// }
//
// return NavigationActionPolicy.ALLOW;
// },
// onLoadStop: (controller, url) {
// pullToRefreshController?.endRefreshing();
// setState(() {
// this.url = url.toString();
// urlController.text = this.url;
// });
// },
// onReceivedError: (controller, request, error) {
// pullToRefreshController?.endRefreshing();
// },
// onProgressChanged: (controller, progress) {
// if (progress == 100) {
// pullToRefreshController?.endRefreshing();
// }
// setState(() {
// this.progress = progress / 100;
// urlController.text = this.url;
// });
// },
// onUpdateVisitedHistory: (controller, url, isReload) {
// setState(() {
// this.url = url.toString();
// urlController.text = this.url;
// });
// },
onConsoleMessage: (controller, consoleMessage) {
print(consoleMessage);
},
),
Visibility(
visible: widget.hideBack != true,
child: GestureDetector(
onTap: () => Navigator.pop(context),
child: Container(
margin: const EdgeInsets.only(left: 16, top: 16),
width: 44,
height: 44,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22),
color: Colors.grey.withOpacity(0.3),
),
child: const Icon(
Icons.navigate_before,
color: Colors.white,
),
),
),
)
],
);
}
}