minor fixes

This commit is contained in:
Thibault Deckers 2021-01-18 11:59:22 +09:00
parent a8bab93035
commit 4690fac4f6
2 changed files with 7 additions and 4 deletions

View file

@ -36,7 +36,7 @@ class SectionHeader extends StatelessWidget {
padding: padding,
constraints: BoxConstraints(minHeight: leadingDimension),
child: GestureDetector(
onTap: () => _toggleSectionSelection(context),
onTap: selectable ? () => _toggleSectionSelection(context) : null,
child: Text.rich(
TextSpan(
children: [
@ -53,7 +53,7 @@ class SectionHeader extends StatelessWidget {
child: leading,
)
: null,
onPressed: () => _toggleSectionSelection(context),
onPressed: selectable ? () => _toggleSectionSelection(context) : null,
),
),
TextSpan(

View file

@ -1,4 +1,3 @@
import 'dart:math';
import 'dart:ui' as ui;
import 'package:aves/theme/durations.dart';
@ -153,7 +152,11 @@ class _GridScaleGestureDetectorState<T> extends State<GridScaleGestureDetector<T
final appBarHeight = widget.appBarHeightNotifier.value;
final scrollOffset = tileRect.top + (tileRect.height - scrollableHeight) / 2 + appBarHeight;
PrimaryScrollController.of(context)?.jumpTo(max(.0, scrollOffset));
final controller = PrimaryScrollController.of(context);
if (controller != null) {
final maxScrollExtent = controller.position.maxScrollExtent;
controller.jumpTo(scrollOffset.clamp(.0, maxScrollExtent));
}
}
}