Enable sort_child_properties_last
lint (#91585)
This commit is contained in:
parent
ee07b0eafc
commit
6d5fc420b6
@ -186,7 +186,7 @@ linter:
|
|||||||
- recursive_getters
|
- recursive_getters
|
||||||
- sized_box_for_whitespace
|
- sized_box_for_whitespace
|
||||||
- slash_for_doc_comments
|
- slash_for_doc_comments
|
||||||
# - sort_child_properties_last # not yet tested
|
- sort_child_properties_last
|
||||||
- sort_constructors_first
|
- sort_constructors_first
|
||||||
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
|
# - sort_pub_dependencies # prevents separating pinned transitive dependencies
|
||||||
- sort_unnamed_constructors_first
|
- sort_unnamed_constructors_first
|
||||||
|
@ -16,14 +16,14 @@ class LogoScreen extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
print(_testSentinel);
|
print(_testSentinel);
|
||||||
return Container(
|
return Container(
|
||||||
|
padding: const EdgeInsets.all(25),
|
||||||
|
color: Colors.blue,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Text('DeferredWidget', key: Key('DeferredWidget')),
|
const Text('DeferredWidget', key: Key('DeferredWidget')),
|
||||||
Image.asset('customassets/flutter_logo.png', key: const Key('DeferredImage')),
|
Image.asset('customassets/flutter_logo.png', key: const Key('DeferredImage')),
|
||||||
]
|
],
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(25),
|
);
|
||||||
color: Colors.blue,
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -132,18 +132,18 @@ class ExampleDragSource extends StatelessWidget {
|
|||||||
if (heavy) {
|
if (heavy) {
|
||||||
return LongPressDraggable<Color>(
|
return LongPressDraggable<Color>(
|
||||||
data: color,
|
data: color,
|
||||||
child: contents,
|
|
||||||
feedback: feedback,
|
feedback: feedback,
|
||||||
feedbackOffset: feedbackOffset,
|
feedbackOffset: feedbackOffset,
|
||||||
dragAnchorStrategy: dragAnchorStrategy,
|
dragAnchorStrategy: dragAnchorStrategy,
|
||||||
|
child: contents,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Draggable<Color>(
|
return Draggable<Color>(
|
||||||
data: color,
|
data: color,
|
||||||
child: contents,
|
|
||||||
feedback: feedback,
|
feedback: feedback,
|
||||||
feedbackOffset: feedbackOffset,
|
feedbackOffset: feedbackOffset,
|
||||||
dragAnchorStrategy: dragAnchorStrategy,
|
dragAnchorStrategy: dragAnchorStrategy,
|
||||||
|
child: contents,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,10 +208,10 @@ class MovableBall extends StatelessWidget {
|
|||||||
if (position == ballPosition) {
|
if (position == ballPosition) {
|
||||||
return Draggable<bool>(
|
return Draggable<bool>(
|
||||||
data: true,
|
data: true,
|
||||||
child: ball,
|
|
||||||
childWhenDragging: dashedBall,
|
childWhenDragging: dashedBall,
|
||||||
feedback: ball,
|
feedback: ball,
|
||||||
maxSimultaneousDrags: 1,
|
maxSimultaneousDrags: 1,
|
||||||
|
child: ball,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return DragTarget<bool>(
|
return DragTarget<bool>(
|
||||||
|
@ -35,9 +35,6 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
child: CupertinoContextMenu(
|
child: CupertinoContextMenu(
|
||||||
child: Container(
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
CupertinoContextMenuAction(
|
CupertinoContextMenuAction(
|
||||||
child: const Text('Action one'),
|
child: const Text('Action one'),
|
||||||
@ -52,6 +49,9 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
child: Container(
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -38,12 +38,12 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
backgroundColor: Color(0xFFE0E0E0),
|
backgroundColor: Color(0xFFE0E0E0),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('OPEN'),
|
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
|
child: Text('OPEN'),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('DISMISS'),
|
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
|
child: Text('DISMISS'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -42,8 +42,8 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('DISMISS'),
|
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
|
child: Text('DISMISS'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -97,8 +97,8 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
|
|||||||
floatingActionButton: _showFab
|
floatingActionButton: _showFab
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
child: const Icon(Icons.add),
|
|
||||||
tooltip: 'Create',
|
tooltip: 'Create',
|
||||||
|
child: const Icon(Icons.add),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
floatingActionButtonLocation: _fabLocation,
|
floatingActionButtonLocation: _fabLocation,
|
||||||
|
@ -50,8 +50,8 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
},
|
},
|
||||||
items: items.map((String item) {
|
items: items.map((String item) {
|
||||||
return DropdownMenuItem<String>(
|
return DropdownMenuItem<String>(
|
||||||
child: Text('Log $item'),
|
|
||||||
value: item,
|
value: item,
|
||||||
|
child: Text('Log $item'),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
@ -36,8 +36,8 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Add your onPressed code here!
|
// Add your onPressed code here!
|
||||||
},
|
},
|
||||||
child: const Icon(Icons.navigation),
|
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
|
child: const Icon(Icons.navigation),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ class MyNavigationRailFab extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: animation.value == 0
|
child: animation.value == 0
|
||||||
? FloatingActionButton(
|
? FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
|
child: const Icon(Icons.add),
|
||||||
)
|
)
|
||||||
: Align(
|
: Align(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
@ -39,8 +39,8 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
content: Text('This is a MaterialBanner'),
|
content: Text('This is a MaterialBanner'),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text('DISMISS'),
|
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
|
child: Text('DISMISS'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -34,7 +34,6 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Tooltip(
|
return Tooltip(
|
||||||
message: 'I am a Tooltip',
|
message: 'I am a Tooltip',
|
||||||
child: const Text('Tap this text and hold down to show a tooltip.'),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(25),
|
borderRadius: BorderRadius.circular(25),
|
||||||
gradient:
|
gradient:
|
||||||
@ -48,6 +47,7 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
showDuration: const Duration(seconds: 2),
|
showDuration: const Duration(seconds: 2),
|
||||||
waitDuration: const Duration(seconds: 1),
|
waitDuration: const Duration(seconds: 1),
|
||||||
|
child: const Text('Tap this text and hold down to show a tooltip.'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,8 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
value: _currentStyle,
|
value: _currentStyle,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
child: const Text('Change Color'),
|
|
||||||
onPressed: _changeColor,
|
onPressed: _changeColor,
|
||||||
|
child: const Text('Change Color'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -42,7 +42,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
AnimatedSwitcher(
|
AnimatedSwitcher(
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
transitionBuilder: (Widget child, Animation<double> animation) {
|
transitionBuilder: (Widget child, Animation<double> animation) {
|
||||||
return ScaleTransition(child: child, scale: animation);
|
return ScaleTransition(scale: animation, child: child);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'$_count',
|
'$_count',
|
||||||
|
@ -71,9 +71,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
} else {
|
} else {
|
||||||
children = const <Widget>[
|
children = const <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
width: 60,
|
width: 60,
|
||||||
height: 60,
|
height: 60,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 16),
|
||||||
|
@ -82,9 +82,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
case ConnectionState.waiting:
|
case ConnectionState.waiting:
|
||||||
children = const <Widget>[
|
children = const <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
width: 60,
|
width: 60,
|
||||||
height: 60,
|
height: 60,
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 16),
|
||||||
|
@ -37,9 +37,9 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
width: 300,
|
width: 300,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
|
fit: BoxFit.fill,
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
|
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
|
||||||
fit: BoxFit.fill,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,15 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
body: Center(
|
body: Center(
|
||||||
child: PhysicalShape(
|
child: PhysicalShape(
|
||||||
elevation: 5.0,
|
elevation: 5.0,
|
||||||
|
clipper: ShapeBorderClipper(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
color: Colors.orange,
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
|
height: 200.0,
|
||||||
|
width: 200.0,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Hello, World!',
|
'Hello, World!',
|
||||||
@ -44,14 +52,7 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
height: 200.0,
|
|
||||||
width: 200.0,
|
|
||||||
),
|
),
|
||||||
clipper: ShapeBorderClipper(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
|
||||||
)),
|
|
||||||
color: Colors.orange,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -42,11 +42,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return Dismissible(
|
return Dismissible(
|
||||||
child: ListTile(
|
|
||||||
title: Text(
|
|
||||||
'Item ${items[index]}',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
background: Container(
|
background: Container(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
),
|
),
|
||||||
@ -56,6 +51,11 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
items.removeAt(index);
|
items.removeAt(index);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
child: ListTile(
|
||||||
|
title: Text(
|
||||||
|
'Item ${items[index]}',
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -43,14 +43,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
// Data is the value this Draggable stores.
|
// Data is the value this Draggable stores.
|
||||||
data: 10,
|
data: 10,
|
||||||
child: Container(
|
|
||||||
height: 100.0,
|
|
||||||
width: 100.0,
|
|
||||||
color: Colors.lightGreenAccent,
|
|
||||||
child: const Center(
|
|
||||||
child: Text('Draggable'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
feedback: Container(
|
feedback: Container(
|
||||||
color: Colors.deepOrange,
|
color: Colors.deepOrange,
|
||||||
height: 100,
|
height: 100,
|
||||||
@ -65,6 +57,14 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
child: Text('Child When Dragging'),
|
child: Text('Child When Dragging'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: Container(
|
||||||
|
height: 100.0,
|
||||||
|
width: 100.0,
|
||||||
|
color: Colors.lightGreenAccent,
|
||||||
|
child: const Center(
|
||||||
|
child: Text('Draggable'),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (
|
builder: (
|
||||||
|
@ -42,10 +42,10 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
return AnimatedOpacity(
|
return AnimatedOpacity(
|
||||||
child: child,
|
|
||||||
opacity: frame == null ? 0 : 1,
|
opacity: frame == null ? 0 : 1,
|
||||||
duration: const Duration(seconds: 1),
|
duration: const Duration(seconds: 1),
|
||||||
curve: Curves.easeOut,
|
curve: Curves.easeOut,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -49,12 +49,12 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
child: const Text('Slide up'),
|
|
||||||
onPressed: _slideUp,
|
onPressed: _slideUp,
|
||||||
|
child: const Text('Slide up'),
|
||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
child: const Text('Slide down'),
|
|
||||||
onPressed: _slideDown,
|
onPressed: _slideDown,
|
||||||
|
child: const Text('Slide down'),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(50),
|
padding: const EdgeInsets.all(50),
|
||||||
|
@ -45,8 +45,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
title: const Text('Persistence Example'),
|
title: const Text('Persistence Example'),
|
||||||
),
|
),
|
||||||
body: PageStorage(
|
body: PageStorage(
|
||||||
child: pages[currentTab],
|
|
||||||
bucket: _bucket,
|
bucket: _bucket,
|
||||||
|
child: pages[currentTab],
|
||||||
),
|
),
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
currentIndex: currentTab,
|
currentIndex: currentTab,
|
||||||
|
@ -74,8 +74,8 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return OutlinedButton(
|
return OutlinedButton(
|
||||||
child: Text('${_answer.value}'),
|
|
||||||
onPressed: _incrementAnswer,
|
onPressed: _incrementAnswer,
|
||||||
|
child: Text('${_answer.value}'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,16 +29,16 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: RawScrollbar(
|
body: RawScrollbar(
|
||||||
child: ListView(
|
|
||||||
children: List<Text>.generate(
|
|
||||||
100, (int index) => Text((index * index).toString())),
|
|
||||||
physics: const BouncingScrollPhysics(),
|
|
||||||
),
|
|
||||||
shape: const StadiumBorder(
|
shape: const StadiumBorder(
|
||||||
side: BorderSide(color: Colors.brown, width: 3.0)),
|
side: BorderSide(color: Colors.brown, width: 3.0)),
|
||||||
thickness: 15.0,
|
thickness: 15.0,
|
||||||
thumbColor: Colors.blue,
|
thumbColor: Colors.blue,
|
||||||
isAlwaysShown: true,
|
isAlwaysShown: true,
|
||||||
|
child: ListView(
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
children: List<Text>.generate(
|
||||||
|
100, (int index) => Text((index * index).toString())),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -795,6 +795,8 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
|
|
||||||
assert(debugIsFlipped == isHourRegionFlipped);
|
assert(debugIsFlipped == isHourRegionFlipped);
|
||||||
},
|
},
|
||||||
|
looping: true,
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(24, (int index) {
|
children: List<Widget>.generate(24, (int index) {
|
||||||
final int hour = isHourRegionFlipped ? (index + 12) % 24 : index;
|
final int hour = isHourRegionFlipped ? (index + 12) % 24 : index;
|
||||||
final int displayHour = widget.use24hFormat ? hour : (hour + 11) % 12 + 1;
|
final int displayHour = widget.use24hFormat ? hour : (hour + 11) % 12 + 1;
|
||||||
@ -808,8 +810,6 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
looping: true,
|
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -835,6 +835,8 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
backgroundColor: widget.backgroundColor,
|
backgroundColor: widget.backgroundColor,
|
||||||
squeeze: _kSqueeze,
|
squeeze: _kSqueeze,
|
||||||
onSelectedItemChanged: _onSelectedItemChange,
|
onSelectedItemChanged: _onSelectedItemChange,
|
||||||
|
looping: true,
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) {
|
children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) {
|
||||||
final int minute = index * widget.minuteInterval;
|
final int minute = index * widget.minuteInterval;
|
||||||
|
|
||||||
@ -858,8 +860,6 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
looping: true,
|
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -889,6 +889,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
assert(selectedAmPm == 0 || selectedAmPm == 1);
|
assert(selectedAmPm == 0 || selectedAmPm == 1);
|
||||||
_onSelectedItemChange(index);
|
_onSelectedItemChange(index);
|
||||||
},
|
},
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(2, (int index) {
|
children: List<Widget>.generate(2, (int index) {
|
||||||
return itemPositioningBuilder(
|
return itemPositioningBuilder(
|
||||||
context,
|
context,
|
||||||
@ -900,7 +901,6 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1172,6 +1172,8 @@ class _CupertinoDatePickerDateState extends State<CupertinoDatePicker> {
|
|||||||
if (_isCurrentDateValid)
|
if (_isCurrentDateValid)
|
||||||
widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay));
|
widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay));
|
||||||
},
|
},
|
||||||
|
looping: true,
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(31, (int index) {
|
children: List<Widget>.generate(31, (int index) {
|
||||||
final int day = index + 1;
|
final int day = index + 1;
|
||||||
return itemPositioningBuilder(
|
return itemPositioningBuilder(
|
||||||
@ -1182,8 +1184,6 @@ class _CupertinoDatePickerDateState extends State<CupertinoDatePicker> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
looping: true,
|
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1213,6 +1213,8 @@ class _CupertinoDatePickerDateState extends State<CupertinoDatePicker> {
|
|||||||
if (_isCurrentDateValid)
|
if (_isCurrentDateValid)
|
||||||
widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay));
|
widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay));
|
||||||
},
|
},
|
||||||
|
looping: true,
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(12, (int index) {
|
children: List<Widget>.generate(12, (int index) {
|
||||||
final int month = index + 1;
|
final int month = index + 1;
|
||||||
final bool isInvalidMonth = (widget.minimumDate?.year == selectedYear && widget.minimumDate!.month > month)
|
final bool isInvalidMonth = (widget.minimumDate?.year == selectedYear && widget.minimumDate!.month > month)
|
||||||
@ -1226,8 +1228,6 @@ class _CupertinoDatePickerDateState extends State<CupertinoDatePicker> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
looping: true,
|
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1782,6 +1782,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(24, (int index) {
|
children: List<Widget>.generate(24, (int index) {
|
||||||
final String label = localizations.timerPickerHourLabel(index) ?? '';
|
final String label = localizations.timerPickerHourLabel(index) ?? '';
|
||||||
final String semanticsLabel = textDirectionFactor == 1
|
final String semanticsLabel = textDirectionFactor == 1
|
||||||
@ -1794,7 +1795,6 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
child: _buildPickerNumberLabel(localizations.timerPickerHour(index), additionalPadding),
|
child: _buildPickerNumberLabel(localizations.timerPickerHour(index), additionalPadding),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,6 +1847,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) {
|
children: List<Widget>.generate(60 ~/ widget.minuteInterval, (int index) {
|
||||||
final int minute = index * widget.minuteInterval;
|
final int minute = index * widget.minuteInterval;
|
||||||
final String label = localizations.timerPickerMinuteLabel(minute) ?? '';
|
final String label = localizations.timerPickerMinuteLabel(minute) ?? '';
|
||||||
@ -1860,7 +1861,6 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
child: _buildPickerNumberLabel(localizations.timerPickerMinute(minute), additionalPadding),
|
child: _buildPickerNumberLabel(localizations.timerPickerMinute(minute), additionalPadding),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1913,6 +1913,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
selectionOverlay: selectionOverlay,
|
||||||
children: List<Widget>.generate(60 ~/ widget.secondInterval, (int index) {
|
children: List<Widget>.generate(60 ~/ widget.secondInterval, (int index) {
|
||||||
final int second = index * widget.secondInterval;
|
final int second = index * widget.secondInterval;
|
||||||
final String label = localizations.timerPickerSecondLabel(second) ?? '';
|
final String label = localizations.timerPickerSecondLabel(second) ?? '';
|
||||||
@ -1926,7 +1927,6 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
child: _buildPickerNumberLabel(localizations.timerPickerSecond(second), additionalPadding),
|
child: _buildPickerNumberLabel(localizations.timerPickerSecond(second), additionalPadding),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
selectionOverlay: selectionOverlay,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,8 +381,8 @@ class _MaterialBannerState extends State<MaterialBanner> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Hero(
|
return Hero(
|
||||||
child: ClipRect(child: materialBannerTransition),
|
|
||||||
tag: '<MaterialBanner Hero tag - ${widget.content}>',
|
tag: '<MaterialBanner Hero tag - ${widget.content}>',
|
||||||
|
child: ClipRect(child: materialBannerTransition),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,8 +195,8 @@ class _DropdownMenuItemButtonState<T> extends State<_DropdownMenuItemButton<T>>
|
|||||||
enableFeedback: widget.enableFeedback,
|
enableFeedback: widget.enableFeedback,
|
||||||
onTap: _handleOnTap,
|
onTap: _handleOnTap,
|
||||||
onFocusChange: _handleFocusChange,
|
onFocusChange: _handleFocusChange,
|
||||||
child: child,
|
|
||||||
borderRadius: itemBorderRadius,
|
borderRadius: itemBorderRadius,
|
||||||
|
child: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
child = FadeTransition(opacity: opacity, child: child);
|
child = FadeTransition(opacity: opacity, child: child);
|
||||||
|
@ -759,7 +759,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
|
|||||||
AnimatedSize(
|
AnimatedSize(
|
||||||
curve: Curves.fastOutSlowIn,
|
curve: Curves.fastOutSlowIn,
|
||||||
duration: kThemeAnimationDuration,
|
duration: kThemeAnimationDuration,
|
||||||
child: Column(children: stepPanels, crossAxisAlignment: CrossAxisAlignment.stretch),
|
child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: stepPanels),
|
||||||
),
|
),
|
||||||
_buildVerticalControls(widget.currentStep),
|
_buildVerticalControls(widget.currentStep),
|
||||||
],
|
],
|
||||||
|
@ -88,8 +88,8 @@ void main() {
|
|||||||
const CupertinoApp(
|
const CupertinoApp(
|
||||||
home: Center(
|
home: Center(
|
||||||
child: CupertinoFormRow(
|
child: CupertinoFormRow(
|
||||||
child: CupertinoTextField(),
|
|
||||||
error: error,
|
error: error,
|
||||||
|
child: CupertinoTextField(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -105,8 +105,8 @@ void main() {
|
|||||||
const CupertinoApp(
|
const CupertinoApp(
|
||||||
home: Center(
|
home: Center(
|
||||||
child: CupertinoFormRow(
|
child: CupertinoFormRow(
|
||||||
child: CupertinoTextField(),
|
|
||||||
helper: helper,
|
helper: helper,
|
||||||
|
child: CupertinoTextField(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -123,9 +123,9 @@ void main() {
|
|||||||
const CupertinoApp(
|
const CupertinoApp(
|
||||||
home: Center(
|
home: Center(
|
||||||
child: CupertinoFormRow(
|
child: CupertinoFormRow(
|
||||||
child: CupertinoTextField(),
|
|
||||||
helper: helper,
|
helper: helper,
|
||||||
error: error,
|
error: error,
|
||||||
|
child: CupertinoTextField(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -145,9 +145,9 @@ void main() {
|
|||||||
const CupertinoApp(
|
const CupertinoApp(
|
||||||
home: Center(
|
home: Center(
|
||||||
child: CupertinoFormRow(
|
child: CupertinoFormRow(
|
||||||
child: CupertinoTextField(),
|
|
||||||
helper: helper,
|
helper: helper,
|
||||||
error: error,
|
error: error,
|
||||||
|
child: CupertinoTextField(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -182,9 +182,9 @@ void main() {
|
|||||||
width: 300.0,
|
width: 300.0,
|
||||||
child: CupertinoPicker(
|
child: CupertinoPicker(
|
||||||
itemExtent: 15.0,
|
itemExtent: 15.0,
|
||||||
children: const <Widget>[Text('1'), Text('1')],
|
|
||||||
onSelectedItemChanged: (int i) {},
|
onSelectedItemChanged: (int i) {},
|
||||||
selectionOverlay: const CupertinoPickerDefaultSelectionOverlay(background: Color(0x12345678)),
|
selectionOverlay: const CupertinoPickerDefaultSelectionOverlay(background: Color(0x12345678)),
|
||||||
|
children: const <Widget>[Text('1'), Text('1')],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -3536,7 +3536,8 @@ void main() {
|
|||||||
value: 'One',
|
value: 'One',
|
||||||
items: const <DropdownMenuItem<String>>[
|
items: const <DropdownMenuItem<String>>[
|
||||||
DropdownMenuItem<String>(
|
DropdownMenuItem<String>(
|
||||||
child: Text('One'), value: 'One'
|
value: 'One',
|
||||||
|
child: Text('One')
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
onChanged: (_) { },
|
onChanged: (_) { },
|
||||||
|
@ -175,13 +175,13 @@ void main() {
|
|||||||
initiallyExpanded: true,
|
initiallyExpanded: true,
|
||||||
title: TestText('Expanded', key: expandedTitleKey),
|
title: TestText('Expanded', key: expandedTitleKey),
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
children: const <Widget>[ListTile(title: Text('0'))],
|
|
||||||
trailing: TestIcon(key: expandedIconKey),
|
trailing: TestIcon(key: expandedIconKey),
|
||||||
|
children: const <Widget>[ListTile(title: Text('0'))],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: TestText('Collapsed', key: collapsedTitleKey),
|
title: TestText('Collapsed', key: collapsedTitleKey),
|
||||||
children: const <Widget>[ListTile(title: Text('0'))],
|
|
||||||
trailing: TestIcon(key: collapsedIconKey),
|
trailing: TestIcon(key: collapsedIconKey),
|
||||||
|
children: const <Widget>[ListTile(title: Text('0'))],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -19,16 +19,16 @@ void main() {
|
|||||||
subtitle: const Text('Subtitle'),
|
subtitle: const Text('Subtitle'),
|
||||||
trailing: const Icon(Icons.thumb_up),
|
trailing: const Icon(Icons.thumb_up),
|
||||||
),
|
),
|
||||||
child: DecoratedBox(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.green[500],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
footer: GridTileBar(
|
footer: GridTileBar(
|
||||||
key: footerKey,
|
key: footerKey,
|
||||||
title: const Text('Footer'),
|
title: const Text('Footer'),
|
||||||
backgroundColor: Colors.black38,
|
backgroundColor: Colors.black38,
|
||||||
),
|
),
|
||||||
|
child: DecoratedBox(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.green[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -556,9 +556,9 @@ void main() {
|
|||||||
testWidgets('PopupMenuButton fails when given both child and icon', (WidgetTester tester) async {
|
testWidgets('PopupMenuButton fails when given both child and icon', (WidgetTester tester) async {
|
||||||
expect(() {
|
expect(() {
|
||||||
PopupMenuButton<int>(
|
PopupMenuButton<int>(
|
||||||
child: const Text('heyo'),
|
|
||||||
icon: const Icon(Icons.view_carousel),
|
icon: const Icon(Icons.view_carousel),
|
||||||
itemBuilder: simplePopupMenuItemBuilder,
|
itemBuilder: simplePopupMenuItemBuilder,
|
||||||
|
child: const Text('heyo'),
|
||||||
);
|
);
|
||||||
}, throwsAssertionError);
|
}, throwsAssertionError);
|
||||||
});
|
});
|
||||||
@ -1699,8 +1699,8 @@ void main() {
|
|||||||
expect(() {
|
expect(() {
|
||||||
PopupMenuButton<int>(
|
PopupMenuButton<int>(
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[],
|
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[],
|
||||||
child: Container(),
|
|
||||||
icon: const Icon(Icons.error),
|
icon: const Icon(Icons.error),
|
||||||
|
child: Container(),
|
||||||
);
|
);
|
||||||
}, throwsAssertionError);
|
}, throwsAssertionError);
|
||||||
});
|
});
|
||||||
|
@ -1520,10 +1520,10 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('ReorderableListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async {
|
testWidgets('ReorderableListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async {
|
||||||
expect(() => ReorderableListView(
|
expect(() => ReorderableListView(
|
||||||
children: const <Widget>[],
|
|
||||||
itemExtent: 30,
|
itemExtent: 30,
|
||||||
prototypeItem: const SizedBox(),
|
prototypeItem: const SizedBox(),
|
||||||
onReorder: (int fromIndex, int toIndex) { },
|
onReorder: (int fromIndex, int toIndex) { },
|
||||||
|
children: const <Widget>[],
|
||||||
), throwsAssertionError);
|
), throwsAssertionError);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3789,12 +3789,12 @@ void main() {
|
|||||||
tabs: <Widget>[
|
tabs: <Widget>[
|
||||||
Tab(
|
Tab(
|
||||||
icon: Icon(Icons.check,size: 40),
|
icon: Icon(Icons.check,size: 40),
|
||||||
child: Text('1 - OK',style: TextStyle(fontSize: 25),),
|
|
||||||
height: 85,
|
height: 85,
|
||||||
|
child: Text('1 - OK',style: TextStyle(fontSize: 25),),
|
||||||
), // icon and child
|
), // icon and child
|
||||||
Tab(
|
Tab(
|
||||||
child: Text('2 - OK',style: TextStyle(fontSize: 25),),
|
|
||||||
height: 85,
|
height: 85,
|
||||||
|
child: Text('2 - OK',style: TextStyle(fontSize: 25),),
|
||||||
), // child
|
), // child
|
||||||
Tab(
|
Tab(
|
||||||
icon: Icon(Icons.done,size: 40),
|
icon: Icon(Icons.done,size: 40),
|
||||||
|
@ -16,8 +16,8 @@ void main() {
|
|||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
key: key,
|
key: key,
|
||||||
painter: SimplePainter(),
|
painter: SimplePainter(),
|
||||||
child: const RepaintBoundary(child: Placeholder()),
|
|
||||||
foregroundPainter: SimplePainter(),
|
foregroundPainter: SimplePainter(),
|
||||||
|
child: const RepaintBoundary(child: Placeholder()),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
++dragStartedCount;
|
++dragStartedCount;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -103,8 +103,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -178,8 +178,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -254,8 +254,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -327,8 +327,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -402,8 +402,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
Stack(
|
Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -495,6 +495,7 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
|
feedback: const Text('Dragging'),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@ -502,7 +503,6 @@ void main() {
|
|||||||
},
|
},
|
||||||
child: const Text('Button'),
|
child: const Text('Button'),
|
||||||
),
|
),
|
||||||
feedback: const Text('Dragging'),
|
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -552,8 +552,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const LongPressDraggable<int>(
|
const LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -601,8 +601,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -665,15 +665,15 @@ void main() {
|
|||||||
Container(height: 400.0),
|
Container(height: 400.0),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('H'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
affinity: Axis.horizontal,
|
affinity: Axis.horizontal,
|
||||||
|
child: Text('H'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 2,
|
data: 2,
|
||||||
child: Text('V'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
affinity: Axis.vertical,
|
affinity: Axis.vertical,
|
||||||
|
child: Text('V'),
|
||||||
),
|
),
|
||||||
Container(height: 500.0),
|
Container(height: 500.0),
|
||||||
Container(height: 500.0),
|
Container(height: 500.0),
|
||||||
@ -776,15 +776,15 @@ void main() {
|
|||||||
Container(width: 400.0),
|
Container(width: 400.0),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('H'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
affinity: Axis.horizontal,
|
affinity: Axis.horizontal,
|
||||||
|
child: Text('H'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 2,
|
data: 2,
|
||||||
child: Text('V'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
affinity: Axis.vertical,
|
affinity: Axis.vertical,
|
||||||
|
child: Text('V'),
|
||||||
),
|
),
|
||||||
Container(width: 500.0),
|
Container(width: 500.0),
|
||||||
Container(width: 500.0),
|
Container(width: 500.0),
|
||||||
@ -886,23 +886,23 @@ void main() {
|
|||||||
Container(width: 400.0),
|
Container(width: 400.0),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('H'),
|
|
||||||
feedback: Text('H'),
|
feedback: Text('H'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
axis: Axis.horizontal,
|
axis: Axis.horizontal,
|
||||||
|
child: Text('H'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 2,
|
data: 2,
|
||||||
child: Text('V'),
|
|
||||||
feedback: Text('V'),
|
feedback: Text('V'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
axis: Axis.vertical,
|
axis: Axis.vertical,
|
||||||
|
child: Text('V'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 3,
|
data: 3,
|
||||||
child: Text('N'),
|
|
||||||
feedback: Text('N'),
|
feedback: Text('N'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
|
child: Text('N'),
|
||||||
),
|
),
|
||||||
Container(width: 500.0),
|
Container(width: 500.0),
|
||||||
Container(width: 500.0),
|
Container(width: 500.0),
|
||||||
@ -1009,32 +1009,32 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragUpdate: (DragUpdateDetails details) {
|
onDragUpdate: (DragUpdateDetails details) {
|
||||||
dragDelta += details.delta;
|
dragDelta += details.delta;
|
||||||
updated++;
|
updated++;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 2,
|
data: 2,
|
||||||
child: const Text('Vertical Source'),
|
|
||||||
feedback: const Text('Vertical Dragging'),
|
feedback: const Text('Vertical Dragging'),
|
||||||
onDragUpdate: (DragUpdateDetails details) {
|
onDragUpdate: (DragUpdateDetails details) {
|
||||||
dragDelta += details.delta;
|
dragDelta += details.delta;
|
||||||
updated++;
|
updated++;
|
||||||
},
|
},
|
||||||
axis: Axis.vertical,
|
axis: Axis.vertical,
|
||||||
|
child: const Text('Vertical Source'),
|
||||||
),
|
),
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 3,
|
data: 3,
|
||||||
child: const Text('Horizontal Source'),
|
|
||||||
feedback: const Text('Horizontal Dragging'),
|
feedback: const Text('Horizontal Dragging'),
|
||||||
onDragUpdate: (DragUpdateDetails details) {
|
onDragUpdate: (DragUpdateDetails details) {
|
||||||
dragDelta += details.delta;
|
dragDelta += details.delta;
|
||||||
updated++;
|
updated++;
|
||||||
},
|
},
|
||||||
axis: Axis.horizontal,
|
axis: Axis.horizontal,
|
||||||
|
child: const Text('Horizontal Source'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1157,11 +1157,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
||||||
onDraggableCanceledCalled = true;
|
onDraggableCanceledCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1227,13 +1227,13 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
||||||
onDraggableCanceledCalled = true;
|
onDraggableCanceledCalled = true;
|
||||||
onDraggableCanceledVelocity = velocity;
|
onDraggableCanceledVelocity = velocity;
|
||||||
onDraggableCanceledOffset = offset;
|
onDraggableCanceledOffset = offset;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1303,13 +1303,13 @@ void main() {
|
|||||||
home: Column(children: <Widget>[
|
home: Column(children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Source'),
|
feedback: const Text('Source'),
|
||||||
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
||||||
onDraggableCanceledCalled = true;
|
onDraggableCanceledCalled = true;
|
||||||
onDraggableCanceledVelocity = velocity;
|
onDraggableCanceledVelocity = velocity;
|
||||||
onDraggableCanceledOffset = offset;
|
onDraggableCanceledOffset = offset;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1354,12 +1354,12 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragEnd: (DraggableDetails details) {
|
onDragEnd: (DraggableDetails details) {
|
||||||
onDragEndCalled = true;
|
onDragEndCalled = true;
|
||||||
onDragEndDraggableDetails = details;
|
onDragEndDraggableDetails = details;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1426,8 +1426,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1481,11 +1481,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
onDraggableCanceled: (Velocity velocity, Offset offset) {
|
||||||
numberOfTimesOnDraggableCanceledCalled++;
|
numberOfTimesOnDraggableCanceledCalled++;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1566,11 +1566,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragCompleted: () {
|
onDragCompleted: () {
|
||||||
onDragCompletedCalled = true;
|
onDragCompletedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1637,12 +1637,12 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragEnd: (DraggableDetails details) {
|
onDragEnd: (DraggableDetails details) {
|
||||||
onDragEndCalled = true;
|
onDragEndCalled = true;
|
||||||
onDragEndDraggableDetails = details;
|
onDragEndDraggableDetails = details;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1712,11 +1712,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragEnd: (DraggableDetails details) {
|
onDragEnd: (DraggableDetails details) {
|
||||||
timesOnDragEndCalled++;
|
timesOnDragEndCalled++;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1756,8 +1756,8 @@ void main() {
|
|||||||
children: const <Widget>[
|
children: const <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1779,11 +1779,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragCompleted: () {
|
onDragCompleted: () {
|
||||||
onDragCompletedCalled = true;
|
onDragCompletedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -1848,13 +1848,13 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('IntSource'),
|
|
||||||
feedback: Text('IntDragging'),
|
feedback: Text('IntDragging'),
|
||||||
|
child: Text('IntSource'),
|
||||||
),
|
),
|
||||||
const Draggable<double>(
|
const Draggable<double>(
|
||||||
data: 1.0,
|
data: 1.0,
|
||||||
child: Text('DoubleSource'),
|
|
||||||
feedback: Text('DoubleDragging'),
|
feedback: Text('DoubleDragging'),
|
||||||
|
child: Text('DoubleSource'),
|
||||||
),
|
),
|
||||||
Stack(
|
Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -1982,8 +1982,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<DragTargetData>(
|
Draggable<DragTargetData>(
|
||||||
data: dragTargetData,
|
data: dragTargetData,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
Stack(
|
Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -2050,8 +2050,8 @@ void main() {
|
|||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
maxSimultaneousDrags: maxSimultaneousDrags,
|
maxSimultaneousDrags: maxSimultaneousDrags,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2179,14 +2179,14 @@ void main() {
|
|||||||
didTap = true;
|
didTap = true;
|
||||||
},
|
},
|
||||||
child: Draggable<Object>(
|
child: Draggable<Object>(
|
||||||
child: Container(
|
|
||||||
color: const Color(0xFFFFFF00),
|
|
||||||
),
|
|
||||||
feedback: Container(
|
feedback: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
color: const Color(0xFFFF0000),
|
color: const Color(0xFFFF0000),
|
||||||
),
|
),
|
||||||
|
child: Container(
|
||||||
|
color: const Color(0xFFFFFF00),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2215,14 +2215,14 @@ void main() {
|
|||||||
builder: (BuildContext context) => GestureDetector(
|
builder: (BuildContext context) => GestureDetector(
|
||||||
onTap: () { /* registers a tap recognizer */ },
|
onTap: () { /* registers a tap recognizer */ },
|
||||||
child: Draggable<Object>(
|
child: Draggable<Object>(
|
||||||
child: Container(
|
|
||||||
color: const Color(0xFFFFFF00),
|
|
||||||
),
|
|
||||||
feedback: Container(
|
feedback: Container(
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
color: const Color(0xFFFF0000),
|
color: const Color(0xFFFF0000),
|
||||||
),
|
),
|
||||||
|
child: Container(
|
||||||
|
color: const Color(0xFFFFFF00),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2247,8 +2247,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2288,8 +2288,8 @@ void main() {
|
|||||||
children: const <Widget>[
|
children: const <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -2309,8 +2309,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2415,12 +2415,12 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
LongPressDraggable<int>(
|
LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragEnd: (DraggableDetails details) {
|
onDragEnd: (DraggableDetails details) {
|
||||||
onDragEndCalled = true;
|
onDragEndCalled = true;
|
||||||
onDragEndDraggableDetails = details;
|
onDragEndDraggableDetails = details;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2501,11 +2501,11 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
LongPressDraggable<int>(
|
LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragCompleted: () {
|
onDragCompleted: () {
|
||||||
onDragCompletedCalled = true;
|
onDragCompletedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2573,11 +2573,11 @@ void main() {
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: LongPressDraggable<int>(
|
home: LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
onDragStartedCalled = true;
|
onDragStartedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -2606,11 +2606,11 @@ void main() {
|
|||||||
home: LongPressDraggable<int>(
|
home: LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
delay: const Duration(seconds: 2),
|
delay: const Duration(seconds: 2),
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
onDragStartedCalled = true;
|
onDragStartedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
expect(find.text('Source'), findsOneWidget);
|
expect(find.text('Source'), findsOneWidget);
|
||||||
@ -2639,11 +2639,11 @@ void main() {
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: LongPressDraggable<int>(
|
home: LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
onDragStartedCalled = true;
|
onDragStartedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
expect(find.text('Source'), findsOneWidget);
|
expect(find.text('Source'), findsOneWidget);
|
||||||
@ -2702,9 +2702,9 @@ void main() {
|
|||||||
settings: settings,
|
settings: settings,
|
||||||
builder: (BuildContext context) => const Draggable<int>(
|
builder: (BuildContext context) => const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
rootOverlay: true,
|
rootOverlay: true,
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -2758,8 +2758,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<Object>(
|
DragTarget<Object>(
|
||||||
builder: (BuildContext context, List<Object?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<Object?> data, List<dynamic> rejects) {
|
||||||
@ -2794,8 +2794,8 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<Object>(
|
const Draggable<Object>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2830,8 +2830,8 @@ void main() {
|
|||||||
home: Column(
|
home: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Draggable<Object>(
|
const Draggable<Object>(
|
||||||
child: Text('Source'),
|
|
||||||
feedback: Text('Dragging'),
|
feedback: Text('Dragging'),
|
||||||
|
child: Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
@ -2880,25 +2880,25 @@ void main() {
|
|||||||
Container(width: 400.0),
|
Container(width: 400.0),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: Text('H'),
|
|
||||||
feedback: Text('H'),
|
feedback: Text('H'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
axis: Axis.horizontal,
|
axis: Axis.horizontal,
|
||||||
ignoringFeedbackSemantics: false,
|
ignoringFeedbackSemantics: false,
|
||||||
|
child: Text('H'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 2,
|
data: 2,
|
||||||
child: Text('V'),
|
|
||||||
feedback: Text('V'),
|
feedback: Text('V'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
axis: Axis.vertical,
|
axis: Axis.vertical,
|
||||||
ignoringFeedbackSemantics: false,
|
ignoringFeedbackSemantics: false,
|
||||||
|
child: Text('V'),
|
||||||
),
|
),
|
||||||
const Draggable<int>(
|
const Draggable<int>(
|
||||||
data: 3,
|
data: 3,
|
||||||
child: Text('N'),
|
|
||||||
feedback: Text('N'),
|
feedback: Text('N'),
|
||||||
childWhenDragging: SizedBox(),
|
childWhenDragging: SizedBox(),
|
||||||
|
child: Text('N'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -3038,12 +3038,12 @@ void main() {
|
|||||||
home: Column(
|
home: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Feedback'),
|
feedback: const Text('Feedback'),
|
||||||
dragAnchorStrategy: (Draggable<Object> widget, BuildContext context, Offset position) {
|
dragAnchorStrategy: (Draggable<Object> widget, BuildContext context, Offset position) {
|
||||||
dragAnchorStrategyCalled = true;
|
dragAnchorStrategyCalled = true;
|
||||||
return Offset.zero;
|
return Offset.zero;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -3099,12 +3099,12 @@ void main() {
|
|||||||
const Widget widget1 = Placeholder(key: ValueKey<int>(1));
|
const Widget widget1 = Placeholder(key: ValueKey<int>(1));
|
||||||
const Widget widget2 = Placeholder(key: ValueKey<int>(2));
|
const Widget widget2 = Placeholder(key: ValueKey<int>(2));
|
||||||
Offset dummyStrategy(Draggable<Object> draggable, BuildContext context, Offset position) => Offset.zero;
|
Offset dummyStrategy(Draggable<Object> draggable, BuildContext context, Offset position) => Offset.zero;
|
||||||
expect(const LongPressDraggable<int>(child: widget1, feedback: widget2), isA<Draggable<int>>());
|
expect(const LongPressDraggable<int>(feedback: widget2, child: widget1), isA<Draggable<int>>());
|
||||||
expect(const LongPressDraggable<int>(child: widget1, feedback: widget2).child, widget1);
|
expect(const LongPressDraggable<int>(feedback: widget2, child: widget1).child, widget1);
|
||||||
expect(const LongPressDraggable<int>(child: widget1, feedback: widget2).feedback, widget2);
|
expect(const LongPressDraggable<int>(feedback: widget2, child: widget1).feedback, widget2);
|
||||||
expect(const LongPressDraggable<int>(child: widget1, feedback: widget2).dragAnchor, DragAnchor.child);
|
expect(const LongPressDraggable<int>(feedback: widget2, child: widget1).dragAnchor, DragAnchor.child);
|
||||||
expect(const LongPressDraggable<int>(child: widget1, feedback: widget2, dragAnchor: DragAnchor.pointer).dragAnchor, DragAnchor.pointer);
|
expect(const LongPressDraggable<int>(feedback: widget2, dragAnchor: DragAnchor.pointer, child: widget1).dragAnchor, DragAnchor.pointer);
|
||||||
expect(LongPressDraggable<int>(child: widget1, feedback: widget2, dragAnchorStrategy: dummyStrategy).dragAnchorStrategy, dummyStrategy);
|
expect(LongPressDraggable<int>(feedback: widget2, dragAnchorStrategy: dummyStrategy, child: widget1).dragAnchorStrategy, dummyStrategy);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3121,12 +3121,12 @@ Future<void> _testLongPressDraggableHapticFeedback({ required WidgetTester teste
|
|||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: LongPressDraggable<int>(
|
home: LongPressDraggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
hapticFeedbackOnStart: hapticFeedbackOnStart,
|
hapticFeedbackOnStart: hapticFeedbackOnStart,
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
onDragStartedCalled = true;
|
onDragStartedCalled = true;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -3169,11 +3169,11 @@ Future<void> _testChildAnchorFeedbackPosition({ required WidgetTester tester, do
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Draggable<int>(
|
Draggable<int>(
|
||||||
data: 1,
|
data: 1,
|
||||||
child: const Text('Source'),
|
|
||||||
feedback: const Text('Dragging'),
|
feedback: const Text('Dragging'),
|
||||||
onDragStarted: () {
|
onDragStarted: () {
|
||||||
++dragStartedCount;
|
++dragStartedCount;
|
||||||
},
|
},
|
||||||
|
child: const Text('Source'),
|
||||||
),
|
),
|
||||||
DragTarget<int>(
|
DragTarget<int>(
|
||||||
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
builder: (BuildContext context, List<int?> data, List<dynamic> rejects) {
|
||||||
|
@ -25,9 +25,9 @@ void main() {
|
|||||||
child: SizedBox.fromSize(
|
child: SizedBox.fromSize(
|
||||||
size: size,
|
size: size,
|
||||||
child: PageView(
|
child: PageView(
|
||||||
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onPageChanged: (int page) { },
|
onPageChanged: (int page) { },
|
||||||
|
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -70,9 +70,9 @@ void main() {
|
|||||||
child: SizedBox.fromSize(
|
child: SizedBox.fromSize(
|
||||||
size: size,
|
size: size,
|
||||||
child: PageView(
|
child: PageView(
|
||||||
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onPageChanged: (int page) { },
|
onPageChanged: (int page) { },
|
||||||
|
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -397,8 +397,8 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Transform.translate(
|
Transform.translate(
|
||||||
offset: const Offset(25.0, 25.0),
|
offset: const Offset(25.0, 25.0),
|
||||||
child: const SizedBox(width: 100, height: 100),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: const SizedBox(width: 100, height: 100),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
||||||
@ -408,8 +408,8 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Transform.scale(
|
Transform.scale(
|
||||||
scale: 3.14159,
|
scale: 3.14159,
|
||||||
child: const SizedBox(width: 100, height: 100),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: const SizedBox(width: 100, height: 100),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
||||||
@ -419,8 +419,8 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Transform.rotate(
|
Transform.rotate(
|
||||||
angle: math.pi / 4,
|
angle: math.pi / 4,
|
||||||
child: const SizedBox(width: 100, height: 100),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: const SizedBox(width: 100, height: 100),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
expect(tester.layers.whereType<ImageFilterLayer>().length, 1);
|
||||||
@ -430,8 +430,8 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Transform.rotate(
|
Transform.rotate(
|
||||||
angle: math.pi / 4,
|
angle: math.pi / 4,
|
||||||
child: const SizedBox(width: 100, height: 100),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: const SizedBox(width: 100, height: 100),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(tester.layers.whereType<ImageFilterLayer>(), hasLength(1));
|
expect(tester.layers.whereType<ImageFilterLayer>(), hasLength(1));
|
||||||
@ -455,8 +455,8 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Transform.rotate(
|
Transform.rotate(
|
||||||
angle: math.pi / 4,
|
angle: math.pi / 4,
|
||||||
child: const SizedBox(width: 100, height: 100),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: const SizedBox(width: 100, height: 100),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(tester.layers.whereType<ImageFilterLayer>(), hasLength(1));
|
expect(tester.layers.whereType<ImageFilterLayer>(), hasLength(1));
|
||||||
@ -483,18 +483,18 @@ void main() {
|
|||||||
),
|
),
|
||||||
Transform.rotate(
|
Transform.rotate(
|
||||||
angle: math.pi / 6,
|
angle: math.pi / 6,
|
||||||
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
||||||
),
|
),
|
||||||
Transform.scale(
|
Transform.scale(
|
||||||
scale: 1.5,
|
scale: 1.5,
|
||||||
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
||||||
),
|
),
|
||||||
Transform.translate(
|
Transform.translate(
|
||||||
offset: const Offset(20.0, 60.0),
|
offset: const Offset(20.0, 60.0),
|
||||||
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
|
||||||
filterQuality: FilterQuality.low,
|
filterQuality: FilterQuality.low,
|
||||||
|
child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -106,9 +106,9 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(Center(
|
await tester.pumpWidget(Center(
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
child: testChild,
|
|
||||||
replacement: const Placeholder(),
|
replacement: const Placeholder(),
|
||||||
visible: false,
|
visible: false,
|
||||||
|
child: testChild,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
expect(find.byType(Text, skipOffstage: false), findsNothing);
|
expect(find.byType(Text, skipOffstage: false), findsNothing);
|
||||||
@ -123,8 +123,8 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(Center(
|
await tester.pumpWidget(Center(
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
child: testChild,
|
|
||||||
replacement: const Placeholder(),
|
replacement: const Placeholder(),
|
||||||
|
child: testChild,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
expect(find.byType(Text, skipOffstage: false), findsOneWidget);
|
expect(find.byType(Text, skipOffstage: false), findsOneWidget);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user