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;
}
