mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-24 09:21:29 +08:00
32 lines
766 B
Dart
32 lines
766 B
Dart
/*
|
|
* SPDX-FileCopyrightText: 2019-2021 Vishesh Handa <me@vhanda.in>
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ScrollViewWithoutAnimation extends StatelessWidget {
|
|
final Widget child;
|
|
final Axis scrollDirection;
|
|
|
|
const ScrollViewWithoutAnimation({
|
|
required this.child,
|
|
this.scrollDirection = Axis.vertical,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return NotificationListener<OverscrollIndicatorNotification>(
|
|
onNotification: (OverscrollIndicatorNotification overScroll) {
|
|
overScroll.disallowIndicator();
|
|
return false;
|
|
},
|
|
child: SingleChildScrollView(
|
|
scrollDirection: scrollDirection,
|
|
child: child,
|
|
),
|
|
);
|
|
}
|
|
}
|