Upgrade to v1.5.1

This commit is contained in:
niuhuan 2022-04-30 12:59:03 +08:00
parent 46403f41fb
commit 087b09fe68
9 changed files with 246 additions and 234 deletions

View File

@ -1 +1 @@
v1.4.6 v1.5.1

View File

@ -1,3 +1,4 @@
- [x] 修复 分流2 / 分流3, API速度得到提高 - [x] 修复一些BUG
- [x] 看此本子多人也在看 - [x] 优化阅读器 (之前丢了一部分代码, 导致被回滚了, 全屏按钮重新写了一遍)
- [x] 本子神推荐/魔推荐 - [x] 优化导入导出 / 保存图片等文件系统交互操作
- [x] 优化推荐栏目

View File

@ -2,7 +2,7 @@
import 'dart:io'; import 'dart:io';
import 'package:clipboard/clipboard.dart'; import 'package:clipboard/clipboard.dart';
import 'package:filesystem_picker/filesystem_picker.dart'; import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:pikapika/basic/Common.dart'; import 'package:pikapika/basic/Common.dart';
@ -77,13 +77,12 @@ Future<dynamic> _saveImageAndroid(String path, BuildContext context) async {
/// ///
Future<String?> chooseFolder(BuildContext context) async { Future<String?> chooseFolder(BuildContext context) async {
return FilesystemPicker.open( return FilePicker.platform.getDirectoryPath(
title: '选择一个文件夹', dialogTitle: "选择一个文件夹, 将文件保存到这里",
pickText: '将文件保存到这里', initialDirectory: Directory
context: context, .fromUri(Uri.file(await currentChooserRoot()))
fsType: FilesystemType.folder, .absolute
rootDirectory: .path,
Directory.fromUri(Uri.file(await currentChooserRoot())).absolute,
); );
} }

View File

@ -73,7 +73,12 @@ class _ComicCollectionsScreenState extends State<ComicCollectionsScreen> {
color: appBarTheme.backgroundColor, color: appBarTheme.backgroundColor,
child: TabBar( child: TabBar(
indicatorColor: theme.dividerColor, indicatorColor: theme.dividerColor,
tabs: collection.map((e) => Tab(text: e.title)).toList(), tabs: collection
.map((e) => Tab(
text: e.title.indexOf("推薦") > 0
? e.title.substring(0, e.title.indexOf("推薦"))
: e.title))
.toList(),
), ),
), ),
body: TabBarView( body: TabBarView(

View File

@ -1,6 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:filesystem_picker/filesystem_picker.dart'; import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:pikapika/basic/Channels.dart'; import 'package:pikapika/basic/Channels.dart';
import 'package:pikapika/basic/Common.dart'; import 'package:pikapika/basic/Common.dart';
@ -43,7 +43,7 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> {
} }
@override @override
Widget build(BuildContext context){ Widget build(BuildContext context) {
return rightClickPop( return rightClickPop(
child: buildScreen(context), child: buildScreen(context),
context: context, context: context,
@ -96,15 +96,15 @@ class _DownloadImportScreenState extends State<DownloadImportScreen> {
defaultToast(context, "$e"); defaultToast(context, "$e");
return; return;
} }
String? path = await FilesystemPicker.open( var ls = await FilePicker.platform.pickFiles(
title: '选择要导入的文件', dialogTitle: '选择要导入的文件',
context: context, allowMultiple: false,
rootDirectory: Directory(chooseRoot), initialDirectory: chooseRoot,
fsType: FilesystemType.file, type: FileType.custom,
folderIconColor: Colors.teal, allowedExtensions: ['zip'],
allowedExtensions: ['.zip'], allowCompression: false,
fileTileSelectMode: FileTileSelectMode.wholeTile,
); );
String? path = ls != null && ls.count > 0 ? ls.paths[0] : null;
if (path != null) { if (path != null) {
try { try {
setState(() { setState(() {

View File

@ -30,7 +30,7 @@ import 'Images.dart';
/////////////// ///////////////
Event<_ReaderControllerEventArgs> _readerControllerEvent = Event<_ReaderControllerEventArgs> _readerControllerEvent =
Event<_ReaderControllerEventArgs>(); Event<_ReaderControllerEventArgs>();
class _ReaderControllerEventArgs extends EventArgs { class _ReaderControllerEventArgs extends EventArgs {
final String key; final String key;
@ -156,7 +156,7 @@ class _ImageReaderState extends State<ImageReader> {
late final FullScreenAction _fullScreenAction = currentFullScreenAction(); late final FullScreenAction _fullScreenAction = currentFullScreenAction();
late final ReaderSliderPosition _readerSliderPosition = late final ReaderSliderPosition _readerSliderPosition =
currentReaderSliderPosition(); currentReaderSliderPosition();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -186,12 +186,12 @@ class _ImageReaderContent extends StatefulWidget {
final ImageReaderStruct struct; final ImageReaderStruct struct;
const _ImageReaderContent( const _ImageReaderContent(
this.struct, this.struct,
this.pagerDirection, this.pagerDirection,
this.pagerType, this.pagerType,
this.fullScreenAction, this.fullScreenAction,
this.readerSliderPosition, this.readerSliderPosition,
); );
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -289,55 +289,87 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( switch (currentFullScreenAction()) {
children: [ //
_buildViewer(), case FullScreenAction.CONTROLLER:
_buildBar(), return Stack(
], children: [
); _buildViewer(),
_buildBar(_buildFullScreenControllerStackItem()),
],
);
case FullScreenAction.TOUCH_ONCE:
return Stack(
children: [
_buildTouchOnceControllerAction(_buildViewer()),
_buildBar(Container()),
],
);
case FullScreenAction.TOUCH_DOUBLE:
return Stack(
children: [
_buildTouchDoubleControllerAction(_buildViewer()),
_buildBar(Container()),
],
);
case FullScreenAction.TOUCH_DOUBLE_ONCE_NEXT:
return Stack(
children: [
_buildTouchDoubleOnceNextControllerAction(_buildViewer()),
_buildBar(Container()),
],
);
case FullScreenAction.THREE_AREA:
return Stack(
children: [
_buildViewer(),
_buildBar(_buildThreeAreaControllerAction()),
],
);
}
} }
Widget _buildBar() { Widget _buildBar(Widget child) {
switch (widget.readerSliderPosition) { switch (widget.readerSliderPosition) {
case ReaderSliderPosition.BOTTOM: case ReaderSliderPosition.BOTTOM:
return Column( return Column(
children: [ children: [
_buildAppBar(), _buildAppBar(),
Expanded(child: _buildController()), Expanded(child: child),
widget.struct.fullScreen widget.struct.fullScreen
? Container() ? Container()
: Container( : Container(
height: 45, height: 45,
color: const Color(0x88000000), color: const Color(0x88000000),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(width: 15), Container(width: 15),
IconButton( IconButton(
icon: const Icon(Icons.fullscreen), icon: const Icon(Icons.fullscreen),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
widget.struct widget.struct
.onFullScreenChange(!widget.struct.fullScreen); .onFullScreenChange(!widget.struct.fullScreen);
}, },
),
Container(width: 10),
Expanded(
child:
widget.pagerType != ReaderType.WEB_TOON_FREE_ZOOM
? _buildSliderBottom()
: Container(),
),
Container(width: 10),
IconButton(
icon: const Icon(Icons.skip_next_outlined),
color: Colors.white,
onPressed: _onNextAction,
),
Container(width: 15),
],
),
), ),
Container(width: 10),
Expanded(
child:
widget.pagerType != ReaderType.WEB_TOON_FREE_ZOOM
? _buildSliderBottom()
: Container(),
),
Container(width: 10),
IconButton(
icon: const Icon(Icons.skip_next_outlined),
color: Colors.white,
onPressed: _onNextAction,
),
Container(width: 15),
],
),
),
], ],
); );
case ReaderSliderPosition.RIGHT: case ReaderSliderPosition.RIGHT:
@ -347,7 +379,7 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
Expanded( Expanded(
child: Stack( child: Stack(
children: [ children: [
_buildController(), child,
_buildSliderRight(), _buildSliderRight(),
], ],
), ),
@ -361,7 +393,7 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
Expanded( Expanded(
child: Stack( child: Stack(
children: [ children: [
_buildController(), child,
_buildSliderLeft(), _buildSliderLeft(),
], ],
), ),
@ -374,19 +406,19 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
Widget _buildAppBar() => widget.struct.fullScreen Widget _buildAppBar() => widget.struct.fullScreen
? Container() ? Container()
: AppBar( : AppBar(
title: Text( title: Text(
"${widget.struct.epNameMap[widget.struct.epOrder] ?? ""} - ${widget.struct.comicTitle}"), "${widget.struct.epNameMap[widget.struct.epOrder] ?? ""} - ${widget.struct.comicTitle}"),
actions: [ actions: [
IconButton( IconButton(
onPressed: _onChooseEp, onPressed: _onChooseEp,
icon: const Icon(Icons.menu_open), icon: const Icon(Icons.menu_open),
), ),
IconButton( IconButton(
onPressed: _onMoreSetting, onPressed: _onMoreSetting,
icon: const Icon(Icons.more_horiz), icon: const Icon(Icons.more_horiz),
), ),
], ],
); );
Widget _buildSliderBottom() { Widget _buildSliderBottom() {
return Column( return Column(
@ -404,52 +436,52 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
Widget _buildSliderLeft() => widget.struct.fullScreen Widget _buildSliderLeft() => widget.struct.fullScreen
? Container() ? Container()
: Align( : Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
width: 35, width: 35,
height: 300, height: 300,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Color(0x66000000), color: Color(0x66000000),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10), topRight: Radius.circular(10),
bottomRight: Radius.circular(10), bottomRight: Radius.circular(10),
),
),
padding:
const EdgeInsets.only(top: 10, bottom: 10, left: 6, right: 5),
child: Center(
child: _buildSliderWidget(Axis.vertical),
),
),
), ),
); ),
padding:
const EdgeInsets.only(top: 10, bottom: 10, left: 6, right: 5),
child: Center(
child: _buildSliderWidget(Axis.vertical),
),
),
),
);
Widget _buildSliderRight() => widget.struct.fullScreen Widget _buildSliderRight() => widget.struct.fullScreen
? Container() ? Container()
: Align( : Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
width: 35, width: 35,
height: 300, height: 300,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Color(0x66000000), color: Color(0x66000000),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
),
),
padding:
const EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 6),
child: Center(
child: _buildSliderWidget(Axis.vertical),
),
),
), ),
); ),
padding:
const EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 6),
child: Center(
child: _buildSliderWidget(Axis.vertical),
),
),
),
);
Widget _buildSliderWidget(Axis axis) { Widget _buildSliderWidget(Axis axis) {
return FlutterSlider( return FlutterSlider(
@ -501,24 +533,7 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
); );
} }
Widget _buildController() { Widget _buildFullScreenControllerStackItem() {
switch (currentFullScreenAction()) {
case FullScreenAction.CONTROLLER:
return _buildFullScreenController();
case FullScreenAction.TOUCH_ONCE:
return _buildTouchOnceController();
case FullScreenAction.TOUCH_DOUBLE:
return _buildTouchDoubleController();
case FullScreenAction.TOUCH_DOUBLE_ONCE_NEXT:
return _buildTouchDoubleOnceNextController();
case FullScreenAction.THREE_AREA:
return _buildThreeAreaController();
default:
return Container();
}
}
Widget _buildFullScreenController() {
if (widget.readerSliderPosition == ReaderSliderPosition.BOTTOM && if (widget.readerSliderPosition == ReaderSliderPosition.BOTTOM &&
!widget.struct.fullScreen) { !widget.struct.fullScreen) {
return Container(); return Container();
@ -529,7 +544,7 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
padding: padding:
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4), const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
margin: const EdgeInsets.only(bottom: 10), margin: const EdgeInsets.only(bottom: 10),
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -555,27 +570,27 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
); );
} }
Widget _buildTouchOnceController() { Widget _buildTouchOnceControllerAction(Widget child) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
widget.struct.onFullScreenChange(!widget.struct.fullScreen); widget.struct.onFullScreenChange(!widget.struct.fullScreen);
}, },
child: Container(), child: child,
); );
} }
Widget _buildTouchDoubleController() { Widget _buildTouchDoubleControllerAction(Widget child) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onDoubleTap: () { onDoubleTap: () {
widget.struct.onFullScreenChange(!widget.struct.fullScreen); widget.struct.onFullScreenChange(!widget.struct.fullScreen);
}, },
child: Container(), child: child,
); );
} }
Widget _buildTouchDoubleOnceNextController() { Widget _buildTouchDoubleOnceNextControllerAction(Widget child) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () { onTap: () {
@ -584,11 +599,11 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
onDoubleTap: () { onDoubleTap: () {
widget.struct.onFullScreenChange(!widget.struct.fullScreen); widget.struct.onFullScreenChange(!widget.struct.fullScreen);
}, },
child: Container(), child: child,
); );
} }
Widget _buildThreeAreaController() { Widget _buildThreeAreaControllerAction() {
return LayoutBuilder( return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) { builder: (BuildContext context, BoxConstraints constraints) {
var up = Expanded( var up = Expanded(
@ -703,11 +718,11 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
case FullScreenAction.CONTROLLER: case FullScreenAction.CONTROLLER:
return false; return false;
case FullScreenAction.TOUCH_ONCE: case FullScreenAction.TOUCH_ONCE:
return true; return false;
case FullScreenAction.TOUCH_DOUBLE: case FullScreenAction.TOUCH_DOUBLE:
return true; return false;
case FullScreenAction.TOUCH_DOUBLE_ONCE_NEXT: case FullScreenAction.TOUCH_DOUBLE_ONCE_NEXT:
return true; return false;
case FullScreenAction.THREE_AREA: case FullScreenAction.THREE_AREA:
return true; return true;
} }
@ -735,7 +750,7 @@ class _EpChooser extends StatefulWidget {
final int epOrder; final int epOrder;
final FutureOr Function(int) onChangeEp; final FutureOr Function(int) onChangeEp;
const _EpChooser(this.epNameMap, this.epOrder, this.onChangeEp); _EpChooser(this.epNameMap, this.epOrder, this.onChangeEp);
@override @override
State<StatefulWidget> createState() => _EpChooserState(); State<StatefulWidget> createState() => _EpChooserState();
@ -782,7 +797,7 @@ class _SettingPanel extends StatefulWidget {
final FutureOr Function() onReloadEp; final FutureOr Function() onReloadEp;
final FutureOr Function() onDownload; final FutureOr Function() onDownload;
const _SettingPanel(this.onReloadEp, this.onDownload); _SettingPanel(this.onReloadEp, this.onDownload);
@override @override
State<StatefulWidget> createState() => _SettingPanelState(); State<StatefulWidget> createState() => _SettingPanelState();
@ -866,42 +881,42 @@ class _SettingPanelState extends State<_SettingPanel> {
); );
} }
Widget _bottomIcon({ Widget _bottomIcon({
required IconData icon, required IconData icon,
required String title, required String title,
required void Function() onPressed, required void Function() onPressed,
}) { }) {
return Expanded( return Expanded(
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
iconSize: 55, iconSize: 55,
icon: Column( icon: Column(
children: [ children: [
Container(height: 3), Container(height: 3),
Icon( Icon(
icon, icon,
size: 25, size: 25,
color: Colors.white, color: Colors.white,
), ),
Container(height: 3), Container(height: 3),
Text( Text(
title, title,
style: const TextStyle(color: Colors.white, fontSize: 10), style: const TextStyle(color: Colors.white, fontSize: 10),
maxLines: 1, maxLines: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
Container(height: 3), Container(height: 3),
], ],
), ),
onPressed: onPressed, onPressed: onPressed,
) )
], ],
),
), ),
); ),
} );
}
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -953,7 +968,7 @@ class _WebToonReaderState extends _ImageReaderContentState {
} }
_controllerTime = DateTime.now().millisecondsSinceEpoch + 400; _controllerTime = DateTime.now().millisecondsSinceEpoch + 400;
_itemScrollController.scrollTo( _itemScrollController.scrollTo(
index: index, // 1 position 1 index: index,
duration: const Duration(milliseconds: 400), duration: const Duration(milliseconds: 400),
); );
} }
@ -1039,9 +1054,9 @@ class _WebToonReaderState extends _ImageReaderContentState {
return ScrollablePositionedList.builder( return ScrollablePositionedList.builder(
initialScrollIndex: super._startIndex, initialScrollIndex: super._startIndex,
scrollDirection: scrollDirection:
widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM
? Axis.vertical ? Axis.vertical
: Axis.horizontal, : Axis.horizontal,
reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT, reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT,
padding: EdgeInsets.only( padding: EdgeInsets.only(
// , , // , ,
@ -1049,9 +1064,9 @@ class _WebToonReaderState extends _ImageReaderContentState {
bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM
? 130 // 130 ? 130 // 130
: ( // : ( //
widget.struct.fullScreen widget.struct.fullScreen
? super._topBarHeight() // ? super._topBarHeight() //
: super._bottomBarHeight()) : super._bottomBarHeight())
// , BAR的高度, BAR的高度, // , BAR的高度, BAR的高度,
, ,
), ),
@ -1104,7 +1119,7 @@ class _WebToonDownloadImage extends _WebToonReaderImage {
final int height; final int height;
final String format; final String format;
const _WebToonDownloadImage({ _WebToonDownloadImage({
required this.fileServer, required this.fileServer,
required this.path, required this.path,
required this.localPath, required this.localPath,
@ -1137,12 +1152,12 @@ class _WebToonRemoteImage extends _WebToonReaderImage {
final String fileServer; final String fileServer;
final String path; final String path;
const _WebToonRemoteImage( _WebToonRemoteImage(
this.fileServer, this.fileServer,
this.path, this.path,
Size size, Size size,
Function(Size)? onTrueSize, Function(Size)? onTrueSize,
) : super(size, onTrueSize); ) : super(size, onTrueSize);
@override @override
Future<RemoteImageData> imageData() async { Future<RemoteImageData> imageData() async {
@ -1155,7 +1170,7 @@ abstract class _WebToonReaderImage extends StatefulWidget {
final Size size; final Size size;
final Function(Size)? onTrueSize; final Function(Size)? onTrueSize;
const _WebToonReaderImage(this.size, this.onTrueSize); _WebToonReaderImage(this.size, this.onTrueSize);
@override @override
State<StatefulWidget> createState() => _WebToonReaderImageState(); State<StatefulWidget> createState() => _WebToonReaderImageState();
@ -1182,14 +1197,14 @@ class _WebToonReaderImageState extends State<_WebToonReaderImage> {
return FutureBuilder( return FutureBuilder(
future: _future, future: _future,
builder: ( builder: (
BuildContext context, BuildContext context,
AsyncSnapshot<RemoteImageData> snapshot, AsyncSnapshot<RemoteImageData> snapshot,
) { ) {
if (snapshot.hasError) { if (snapshot.hasError) {
return GestureDetector( return GestureDetector(
onLongPress: () async { onLongPress: () async {
String? choose = String? choose =
await chooseListDialog(context, '请选择', ['重新加载图片']); await chooseListDialog(context, '请选择', ['重新加载图片']);
switch (choose) { switch (choose) {
case '重新加载图片': case '重新加载图片':
setState(() { setState(() {
@ -1340,9 +1355,9 @@ class _ListViewReaderState extends _ImageReaderContentState
} }
var list = ListView.builder( var list = ListView.builder(
scrollDirection: scrollDirection:
widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM
? Axis.vertical ? Axis.vertical
: Axis.horizontal, : Axis.horizontal,
reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT, reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT,
padding: EdgeInsets.only( padding: EdgeInsets.only(
// , , // , ,
@ -1350,9 +1365,9 @@ class _ListViewReaderState extends _ImageReaderContentState
bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM
? 130 // 130 ? 130 // 130
: ( // : ( //
widget.struct.fullScreen widget.struct.fullScreen
? super._topBarHeight() // ? super._topBarHeight() //
: super._bottomBarHeight()) : super._bottomBarHeight())
// , BAR的高度, BAR的高度, // , BAR的高度, BAR的高度,
, ,
), ),
@ -1487,7 +1502,7 @@ class _GalleryReaderState extends _ImageReaderContentState {
if (item.downloadLocalPath != null) { if (item.downloadLocalPath != null) {
return PhotoViewGalleryPageOptions( return PhotoViewGalleryPageOptions(
imageProvider: imageProvider:
ResourceDownloadFileImageProvider(item.downloadLocalPath!), ResourceDownloadFileImageProvider(item.downloadLocalPath!),
errorBuilder: (b, e, s) { errorBuilder: (b, e, s) {
print("$e,$s"); print("$e,$s");
return LayoutBuilder( return LayoutBuilder(
@ -1502,7 +1517,7 @@ class _GalleryReaderState extends _ImageReaderContentState {
} }
return PhotoViewGalleryPageOptions( return PhotoViewGalleryPageOptions(
imageProvider: imageProvider:
ResourceRemoteImageProvider(item.fileServer, item.path), ResourceRemoteImageProvider(item.fileServer, item.path),
errorBuilder: (b, e, s) { errorBuilder: (b, e, s) {
print("$e,$s"); print("$e,$s");
return LayoutBuilder( return LayoutBuilder(
@ -1530,7 +1545,7 @@ class _GalleryReaderState extends _ImageReaderContentState {
} }
String? choose = String? choose =
await chooseListDialog(context, '请选择', ['预览图片', '保存图片']); await chooseListDialog(context, '请选择', ['预览图片', '保存图片']);
switch (choose) { switch (choose) {
case '预览图片': case '预览图片':
try { try {
@ -1579,7 +1594,7 @@ class _GalleryReaderState extends _ImageReaderContentState {
child: Container( child: Container(
margin: const EdgeInsets.only(bottom: 10), margin: const EdgeInsets.only(bottom: 10),
padding: padding:
const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4), const EdgeInsets.only(left: 10, right: 10, top: 4, bottom: 4),
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
@ -1604,4 +1619,4 @@ class _GalleryReaderState extends _ImageReaderContentState {
} }
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -15,7 +15,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4 url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c

View File

@ -84,7 +84,7 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -120,13 +120,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.1" version: "4.5.1"
filesystem_picker:
dependency: "direct main"
description:
name: filesystem_picker
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -244,7 +237,7 @@ packages:
name: image_picker_ios name: image_picker_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.4+11" version: "0.8.5"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -445,14 +438,14 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.20" version: "6.1.0"
url_launcher_android: url_launcher_android:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_android name: url_launcher_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.15" version: "6.0.16"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
@ -508,7 +501,7 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.1" version: "2.5.2"
xml: xml:
dependency: transitive dependency: transitive
description: description:

View File

@ -36,7 +36,6 @@ dependencies:
another_xlider: ^1.0.0 another_xlider: ^1.0.0
scrollable_positioned_list: ^0.2.0-nullsafety.0 scrollable_positioned_list: ^0.2.0-nullsafety.0
permission_handler: ^8.1.4+1 permission_handler: ^8.1.4+1
filesystem_picker: ^2.0.0-nullsafety.0
url_launcher: ^6.0.9 url_launcher: ^6.0.9
clipboard: ^0.1.3 clipboard: ^0.1.3
photo_view: ^0.13.0 photo_view: ^0.13.0