fix: reverse play

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-31 17:02:12 +08:00
parent 273e5649c3
commit df41729d74
12 changed files with 142 additions and 125 deletions

View File

@@ -28,6 +28,7 @@ class ListSheetContent extends StatefulWidget {
this.onReverse,
this.showTitle,
this.isSupportReverse,
this.isReversed,
});
final dynamic index;
@@ -41,6 +42,7 @@ class ListSheetContent extends StatefulWidget {
final VoidCallback? onReverse;
final bool? showTitle;
final bool? isSupportReverse;
final bool? isReversed;
@override
State<ListSheetContent> createState() => _ListSheetContentState();
@@ -381,10 +383,10 @@ class _ListSheetContentState extends State<ListSheetContent>
stream: _indexStream?.stream,
initialData: _index,
builder: (context, snapshot) => _mediumButton(
tooltip: reverse[snapshot.data] ? '' : '',
tooltip: reverse[snapshot.data] ? '' : '',
icon: !reverse[snapshot.data]
? MdiIcons.sortAscending
: MdiIcons.sortDescending,
? MdiIcons.sortNumericAscending
: MdiIcons.sortNumericDescending,
onPressed: () {
setState(() {
reverse[_ctr?.index ?? 0] = !reverse[_ctr?.index ?? 0];
@@ -436,8 +438,10 @@ class _ListSheetContentState extends State<ListSheetContent>
}
Widget get _reverseButton => _mediumButton(
tooltip: '倒序播放',
icon: Icons.u_turn_right,
tooltip: widget.isReversed == true ? '正序播放' : '倒序播放',
icon: widget.isReversed == true
? MdiIcons.sortDescending
: MdiIcons.sortAscending,
onPressed: () async {
if (widget.showTitle == false) {
// jump to current
@@ -479,7 +483,7 @@ class _ListSheetContentState extends State<ListSheetContent>
Widget _buildBody(i, episodes) => Material(
child: ScrollablePositionedList.separated(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom + 20,
bottom: MediaQuery.of(context).padding.bottom + 80,
),
reverse: reverse[i ?? 0],
itemCount: episodes.length,