123456789101112131415161718192021222324252627282930313233 |
- import 'package:flutter/material.dart';
- class AlwaysScrollListView extends StatefulWidget {
- final Widget child;
- final ScrollController scrollController;
- final Color? color;
- const AlwaysScrollListView({
- super.key,
- required this.child,
- required this.scrollController,
- this.color = Colors.grey,
- });
- @override
- State<StatefulWidget> createState() {
- return _AlwaysScrollListViewState();
- }
- }
- class _AlwaysScrollListViewState extends State<AlwaysScrollListView> {
- @override
- Widget build(BuildContext context) {
- return RawScrollbar(
- controller: widget.scrollController,
- trackVisibility: true,
- thumbVisibility: true,
- thumbColor: widget.color,
- radius: const Radius.circular(20),
- child: widget.child,
- );
- }
- }
|