TF-2313 Add ScrollbarListView widget
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 30c10db3d1833a77fc4f342c2c84fddcdef6d87c)
This commit is contained in:
@@ -232,6 +232,7 @@ extension AppColor on Color {
|
|||||||
static const messageDialogColor = Color(0xFF8C9CAF);
|
static const messageDialogColor = Color(0xFF8C9CAF);
|
||||||
static const messageDialogHighlightColor = Color(0xFF37383A);
|
static const messageDialogHighlightColor = Color(0xFF37383A);
|
||||||
static const labelColor = Color(0xFF71767C);
|
static const labelColor = Color(0xFF71767C);
|
||||||
|
static const thumbScrollbarColor = Color(0xFFC1C1C1);
|
||||||
|
|
||||||
static const mapGradientColor = [
|
static const mapGradientColor = [
|
||||||
[Color(0xFF21D4FD), Color(0xFFB721FF)],
|
[Color(0xFF21D4FD), Color(0xFFB721FF)],
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
import 'package:flutter/gestures.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class CustomScrollBehavior extends MaterialScrollBehavior {
|
|
||||||
@override
|
|
||||||
Set<PointerDeviceKind> get dragDevices => {
|
|
||||||
PointerDeviceKind.touch,
|
|
||||||
PointerDeviceKind.mouse,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ScrollbarListView extends StatelessWidget {
|
||||||
|
|
||||||
|
final Widget child;
|
||||||
|
final ScrollController scrollController;
|
||||||
|
final ScrollBehavior? scrollBehavior;
|
||||||
|
|
||||||
|
const ScrollbarListView({
|
||||||
|
super.key,
|
||||||
|
required this.child,
|
||||||
|
required this.scrollController,
|
||||||
|
this.scrollBehavior
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RawScrollbar(
|
||||||
|
thumbColor: AppColor.thumbScrollbarColor,
|
||||||
|
radius: const Radius.circular(10.0),
|
||||||
|
trackRadius: const Radius.circular(10.0),
|
||||||
|
minThumbLength: 70,
|
||||||
|
minOverscrollLength: 70,
|
||||||
|
controller: scrollController,
|
||||||
|
child: ScrollConfiguration(
|
||||||
|
behavior: scrollBehavior ?? ScrollConfiguration.of(context).copyWith(scrollbars: false),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user