Enable mouse scrolling on Carousel sample (#965)

* Enable mouse scrollBehavior on carousel sample

Overriding PageVeiw scrollBehavior , adding PointerDeviceKind.mouse as a dragDevice

* Flutter format
pull/1033/head
Jonas Cerqueira Junior 3 years ago committed by GitHub
parent 4b9cc632a7
commit ec140beda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

Loading…
Cancel
Save