Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/flutter/lib/src/cupertino/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CupertinoSwitch extends StatefulWidget {
@required this.value,
@required this.onChanged,
this.activeColor,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(dragStartBehavior != null),
super(key: key);

Expand Down Expand Up @@ -96,6 +96,7 @@ class CupertinoSwitch extends StatefulWidget {
/// [CupertinoTheme] in accordance to native iOS behavior.
final Color activeColor;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// {@template flutter.cupertino.switch.dragStartBehavior}
/// Determines the way that drag start behavior is handled.
///
Expand All @@ -108,7 +109,7 @@ class CupertinoSwitch extends StatefulWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// See also:
///
Expand Down Expand Up @@ -147,7 +148,7 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
this.activeColor,
this.onChanged,
this.vsync,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : super(key: key);

final bool value;
Expand Down Expand Up @@ -200,7 +201,7 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
ValueChanged<bool> onChanged,
@required TextDirection textDirection,
@required TickerProvider vsync,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : assert(value != null),
assert(activeColor != null),
assert(vsync != null),
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/gestures/monodrag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
/// [dragStartBehavior] must not be null.
DragGestureRecognizer({
Object debugOwner,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(dragStartBehavior != null),
super(debugOwner: debugOwner);

Expand Down
9 changes: 5 additions & 4 deletions packages/flutter/lib/src/material/date_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class DayPicker extends StatelessWidget {
@required this.lastDate,
@required this.displayedMonth,
this.selectableDayPredicate,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(selectedDate != null),
assert(currentDate != null),
assert(onChanged != null),
Expand Down Expand Up @@ -284,6 +284,7 @@ class DayPicker extends StatelessWidget {
/// Optional user supplied predicate function to customize selectable days.
final SelectableDayPredicate selectableDayPredicate;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// Determines the way that drag start behavior is handled.
///
/// If set to [DragStartBehavior.start], the drag gesture used to scroll a
Expand All @@ -295,7 +296,7 @@ class DayPicker extends StatelessWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// See also:
///
Expand Down Expand Up @@ -524,7 +525,7 @@ class MonthPicker extends StatefulWidget {
@required this.firstDate,
@required this.lastDate,
this.selectableDayPredicate,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(selectedDate != null),
assert(onChanged != null),
assert(!firstDate.isAfter(lastDate)),
Expand Down Expand Up @@ -787,7 +788,7 @@ class YearPicker extends StatefulWidget {
@required this.onChanged,
@required this.firstDate,
@required this.lastDate,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(selectedDate != null),
assert(onChanged != null),
assert(!firstDate.isAfter(lastDate)),
Expand Down
5 changes: 3 additions & 2 deletions packages/flutter/lib/src/material/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class DrawerController extends StatefulWidget {
@required this.child,
@required this.alignment,
this.drawerCallback,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(child != null),
assert(dragStartBehavior != null),
assert(alignment != null),
Expand All @@ -200,6 +200,7 @@ class DrawerController extends StatefulWidget {
/// Optional callback that is called when a [Drawer] is opened or closed.
final DrawerCallback drawerCallback;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// {@template flutter.material.drawer.dragStartBehavior}
/// Determines the way that drag start behavior is handled.
///
Expand All @@ -212,7 +213,7 @@ class DrawerController extends StatefulWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// See also:
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PaginatedDataTable extends StatefulWidget {
this.rowsPerPage = defaultRowsPerPage,
this.availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
this.onRowsPerPageChanged,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
@required this.source
}) : assert(header != null),
assert(columns != null),
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ class Scaffold extends StatefulWidget {
this.resizeToAvoidBottomPadding,
this.resizeToAvoidBottomInset,
this.primary = true,
this.drawerDragStartBehavior = DragStartBehavior.start,
this.drawerDragStartBehavior = DragStartBehavior.down,
}) : assert(primary != null),
assert(drawerDragStartBehavior != null),
super(key: key);
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/material/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
this.labelPadding,
this.unselectedLabelColor,
this.unselectedLabelStyle,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
this.onTap,
}) : assert(tabs != null),
assert(isScrollable != null),
Expand Down Expand Up @@ -1043,7 +1043,7 @@ class TabBarView extends StatefulWidget {
@required this.children,
this.controller,
this.physics,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(children != null),
assert(dragStartBehavior != null),
super(key: key);
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/material/text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class TextField extends StatefulWidget {
this.cursorColor,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20.0),
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
this.enableInteractiveSelection,
this.onTap,
this.buildCounter,
Expand Down
5 changes: 3 additions & 2 deletions packages/flutter/lib/src/widgets/dismissible.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Dismissible extends StatefulWidget {
this.dismissThresholds = const <DismissDirection, double>{},
this.movementDuration = const Duration(milliseconds: 200),
this.crossAxisEndOffset = 0.0,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(key != null),
assert(secondaryBackground != null ? background != null : true),
assert(dragStartBehavior != null),
Expand Down Expand Up @@ -146,6 +146,7 @@ class Dismissible extends StatefulWidget {
/// it is positive or negative.
final double crossAxisEndOffset;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// Determines the way that drag start behavior is handled.
///
/// If set to [DragStartBehavior.start], the drag gesture used to dismiss a
Expand All @@ -156,7 +157,7 @@ class Dismissible extends StatefulWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// See also:
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/widgets/editable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class EditableText extends StatefulWidget {
this.cursorRadius,
this.scrollPadding = const EdgeInsets.all(20.0),
this.keyboardAppearance = Brightness.light,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
this.enableInteractiveSelection,
}) : assert(controller != null),
assert(focusNode != null),
Expand Down
5 changes: 3 additions & 2 deletions packages/flutter/lib/src/widgets/gesture_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class GestureDetector extends StatelessWidget {
this.onScaleEnd,
this.behavior,
this.excludeFromSemantics = false,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(excludeFromSemantics != null),
assert(dragStartBehavior != null),
assert(() {
Expand Down Expand Up @@ -373,6 +373,7 @@ class GestureDetector extends StatelessWidget {
/// duplication of information.
final bool excludeFromSemantics;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// Determines the way that drag start behavior is handled.
///
/// If set to [DragStartBehavior.start], gesture drag behavior will
Expand All @@ -383,7 +384,7 @@ class GestureDetector extends StatelessWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// Only the [onStart] callbacks for the [VerticalDragGestureRecognizer],
/// [HorizontalDragGestureRecognizer] and [PanGestureRecognizer] are affected
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/widgets/nested_scroll_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class NestedScrollView extends StatefulWidget {
this.physics,
@required this.headerSliverBuilder,
@required this.body,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(scrollDirection != null),
assert(reverse != null),
assert(headerSliverBuilder != null),
Expand Down Expand Up @@ -371,7 +371,7 @@ class _NestedScrollViewCustomScrollView extends CustomScrollView {
@required ScrollController controller,
@required List<Widget> slivers,
@required this.handle,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : super(
scrollDirection: scrollDirection,
reverse: reverse,
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter/lib/src/widgets/page_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class PageView extends StatefulWidget {
this.pageSnapping = true,
this.onPageChanged,
List<Widget> children = const <Widget>[],
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : controller = controller ?? _defaultPageController,
childrenDelegate = SliverChildListDelegate(children),
super(key: key);
Expand All @@ -451,7 +451,7 @@ class PageView extends StatefulWidget {
this.onPageChanged,
@required IndexedWidgetBuilder itemBuilder,
int itemCount,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : controller = controller ?? _defaultPageController,
childrenDelegate = SliverChildBuilderDelegate(itemBuilder, childCount: itemCount),
super(key: key);
Expand All @@ -467,7 +467,7 @@ class PageView extends StatefulWidget {
this.pageSnapping = true,
this.onPageChanged,
@required this.childrenDelegate,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(childrenDelegate != null),
controller = controller ?? _defaultPageController,
super(key: key);
Expand Down
16 changes: 8 additions & 8 deletions packages/flutter/lib/src/widgets/scroll_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ abstract class ScrollView extends StatelessWidget {
this.shrinkWrap = false,
this.cacheExtent,
this.semanticChildCount,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(reverse != null),
assert(shrinkWrap != null),
assert(dragStartBehavior != null),
Expand Down Expand Up @@ -404,7 +404,7 @@ class CustomScrollView extends ScrollView {
double cacheExtent,
this.slivers = const <Widget>[],
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : super(
key: key,
scrollDirection: scrollDirection,
Expand Down Expand Up @@ -448,7 +448,7 @@ abstract class BoxScrollView extends ScrollView {
this.padding,
double cacheExtent,
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : super(
key: key,
scrollDirection: scrollDirection,
Expand Down Expand Up @@ -750,7 +750,7 @@ class ListView extends BoxScrollView {
double cacheExtent,
List<Widget> children = const <Widget>[],
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : childrenDelegate = SliverChildListDelegate(
children,
addAutomaticKeepAlives: addAutomaticKeepAlives,
Expand Down Expand Up @@ -813,7 +813,7 @@ class ListView extends BoxScrollView {
bool addSemanticIndexes = true,
double cacheExtent,
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : childrenDelegate = SliverChildBuilderDelegate(
itemBuilder,
childCount: itemCount,
Expand Down Expand Up @@ -1265,7 +1265,7 @@ class GridView extends BoxScrollView {
@required this.childrenDelegate,
double cacheExtent,
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : assert(gridDelegate != null),
assert(childrenDelegate != null),
super(
Expand Down Expand Up @@ -1315,7 +1315,7 @@ class GridView extends BoxScrollView {
double cacheExtent,
List<Widget> children = const <Widget>[],
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : gridDelegate = SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: crossAxisCount,
mainAxisSpacing: mainAxisSpacing,
Expand Down Expand Up @@ -1373,7 +1373,7 @@ class GridView extends BoxScrollView {
bool addSemanticIndexes = true,
List<Widget> children = const <Widget>[],
int semanticChildCount,
DragStartBehavior dragStartBehavior = DragStartBehavior.start,
DragStartBehavior dragStartBehavior = DragStartBehavior.down,
}) : gridDelegate = SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: maxCrossAxisExtent,
mainAxisSpacing: mainAxisSpacing,
Expand Down
5 changes: 3 additions & 2 deletions packages/flutter/lib/src/widgets/scrollable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Scrollable extends StatefulWidget {
@required this.viewportBuilder,
this.excludeFromSemantics = false,
this.semanticChildCount,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(axisDirection != null),
assert(dragStartBehavior != null),
assert(viewportBuilder != null),
Expand Down Expand Up @@ -182,6 +182,7 @@ class Scrollable extends StatefulWidget {
/// * [SemanticsConfiguration.scrollChildCount], the corresponding semantics property.
final int semanticChildCount;

// TODO(jslavitz): Set the DragStartBehavior default to be start across all widgets.
/// {@template flutter.widgets.scrollable.dragStartBehavior}
/// Determines the way that drag start behavior is handled.
///
Expand All @@ -193,7 +194,7 @@ class Scrollable extends StatefulWidget {
/// animation smoother and setting it to [DragStartBehavior.down] will make
/// drag behavior feel slightly more reactive.
///
/// By default, the drag start behavior is [DragStartBehavior.start].
/// By default, the drag start behavior is [DragStartBehavior.down].
///
/// See also:
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class SingleChildScrollView extends StatelessWidget {
this.physics,
this.controller,
this.child,
this.dragStartBehavior = DragStartBehavior.start,
this.dragStartBehavior = DragStartBehavior.down,
}) : assert(scrollDirection != null),
assert(dragStartBehavior != null),
assert(!(controller != null && primary == true),
Expand Down
Loading