Comment trying accelerate scrolling

This commit is contained in:
poka 2022-05-06 12:53:01 +02:00
parent 22369d241a
commit 05f1d702e3
1 changed files with 23 additions and 0 deletions

View File

@ -9,6 +9,8 @@ import 'package:flutter/services.dart';
import 'package:miniplayer/miniplayer.dart';
import 'package:provider/provider.dart';
import 'package:youtube_explode_dart/youtube_explode_dart.dart';
// import 'dart:math';
// import 'package:flutter/rendering.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key, required this.title}) : super(key: key);
@ -46,6 +48,7 @@ class _HomeScreenState extends State<HomeScreen> {
// thumbVisibility: true,
mainAxisMargin: 70,
child: SingleChildScrollView(
// controller: AdjustableScrollController(40),
child: Column(
children: <Widget>[
Container(
@ -500,3 +503,23 @@ String timeFormat(Duration d) {
String seconds = dd.toString().split(':')[2];
return '$minutes:$seconds';
}
// class AdjustableScrollController extends ScrollController {
// AdjustableScrollController([int extraScrollSpeed = 40]) {
// // super.initialScrollOffset = 50;
// super.addListener(() {
// ScrollDirection scrollDirection = super.position.userScrollDirection;
// if (scrollDirection != ScrollDirection.idle) {
// double scrollEnd = super.offset +
// (scrollDirection == ScrollDirection.reverse
// ? extraScrollSpeed
// : -extraScrollSpeed);
// scrollEnd = min(super.position.maxScrollExtent,
// max(super.position.minScrollExtent, scrollEnd));
// WidgetsBinding.instance.addPostFrameCallback((_) {
// if (super.hasClients) jumpTo(scrollEnd);
// });
// }
// });
// }
// }