mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Enable mouse scrolling on Carousel sample (#965)
* Enable mouse scrollBehavior on carousel sample Overriding PageVeiw scrollBehavior , adding PointerDeviceKind.mouse as a dragDevice * Flutter format
This commit is contained in:
committed by
GitHub
parent
4b9cc632a7
commit
ec140beda1
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CarouselDemo extends StatelessWidget {
|
||||
@@ -77,6 +78,12 @@ class _CarouselState extends State<Carousel> {
|
||||
});
|
||||
},
|
||||
controller: _controller,
|
||||
scrollBehavior: ScrollConfiguration.of(context).copyWith(
|
||||
dragDevices: {
|
||||
PointerDeviceKind.touch,
|
||||
PointerDeviceKind.mouse,
|
||||
},
|
||||
),
|
||||
itemBuilder: (context, index) => AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (context, child) {
|
||||
|
||||
Reference in New Issue
Block a user