image reader margin

This commit is contained in:
niuhuan 2021-12-03 12:41:02 +08:00
parent 340ef3b693
commit 491f2201f5
1 changed files with 21 additions and 8 deletions

View File

@ -530,6 +530,8 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
} }
} }
//
Future _onNextAction() async { Future _onNextAction() async {
if (widget.struct.epNameMap.containsKey(widget.struct.epOrder + 1)) { if (widget.struct.epNameMap.containsKey(widget.struct.epOrder + 1)) {
widget.struct.onChangeEp(widget.struct.epOrder + 1); widget.struct.onChangeEp(widget.struct.epOrder + 1);
@ -540,6 +542,14 @@ abstract class _ImageReaderContentState extends State<_ImageReaderContent> {
bool _hasNextEp() => bool _hasNextEp() =>
widget.struct.epNameMap.containsKey(widget.struct.epOrder + 1); widget.struct.epNameMap.containsKey(widget.struct.epOrder + 1);
double _topBarHeight() {
return Scaffold.of(context).appBarMaxHeight ?? 0;
}
double _bottomBarHeight() {
return 45;
}
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -677,12 +687,16 @@ class _WebToonReaderState extends _ImageReaderContentState {
: Axis.horizontal, : Axis.horizontal,
reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT, reverse: widget.pagerDirection == ReaderDirection.RIGHT_TO_LEFT,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: (scaffold.appBarMaxHeight ?? 0), // , ,
top: super._topBarHeight(),
bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM bottom: widget.pagerDirection == ReaderDirection.TOP_TO_BOTTOM
? 130 ? 130 // 130
: (widget.struct.fullScreen : ( //
? (scaffold.appBarMaxHeight ?? 0) widget.struct.fullScreen
: 45), ? super._topBarHeight() //
: super._bottomBarHeight())
// , BAR的高度, BAR的高度,
,
), ),
itemScrollController: _itemScrollController, itemScrollController: _itemScrollController,
itemPositionsListener: _itemPositionsListener, itemPositionsListener: _itemPositionsListener,
@ -975,11 +989,10 @@ class _GalleryReaderState extends _ImageReaderContentState {
} }
}, },
); );
var scaffold = Scaffold.of(context);
gallery = Container( gallery = Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: widget.struct.fullScreen ? 0 : (scaffold.appBarMaxHeight ?? 0), top: widget.struct.fullScreen ? 0 : super._topBarHeight(),
bottom: widget.struct.fullScreen ? 0 : 45, bottom: widget.struct.fullScreen ? 0 : super._bottomBarHeight(),
), ),
child: gallery, child: gallery,
); );