image reader margin
This commit is contained in:
parent
340ef3b693
commit
491f2201f5
|
@ -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,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue