Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
|
||||
double computeDetailScrollProgress(
|
||||
BuildContext context,
|
||||
double offset, {
|
||||
double? collapseExtent,
|
||||
}) {
|
||||
final mq = MediaQuery.of(context);
|
||||
if (mq.disableAnimations) return offset > 10 ? 1.0 : 0.0;
|
||||
final maxScroll = collapseExtent ?? mq.size.height * 0.8;
|
||||
final raw = (offset / maxScroll).clamp(0.0, 1.0);
|
||||
return (raw * 100).roundToDouble() / 100;
|
||||
}
|
||||
Reference in New Issue
Block a user