mirror of
https://github.com/flutter/flutter
synced 2024-09-13 13:21:36 +00:00
end of sort_child_properties_last (#82457)
This commit is contained in:
parent
d9db3ea6e6
commit
157bc92d4a
|
@ -87,8 +87,8 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
|
|||
children: List<Widget>.generate(rows, (int r) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: List<Widget>.generate(cols, (int c) => Container(
|
||||
child: Text('text', style: TextStyle(fontSize: fontSize)),
|
||||
decoration: decoration,
|
||||
child: Text('text', style: TextStyle(fontSize: fontSize)),
|
||||
)),
|
||||
)),
|
||||
),
|
||||
|
@ -138,8 +138,8 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
|
|||
return RepaintBoundary(
|
||||
child: AnimatedBuilder(
|
||||
animation: _controller,
|
||||
child: protectChild ? RepaintBoundary(child: child) : child,
|
||||
builder: builder,
|
||||
child: protectChild ? RepaintBoundary(child: child) : child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -75,16 +75,16 @@ class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable>
|
|||
key: ValueKey<int>(widgetCounter + label),
|
||||
color: Color.lerp(
|
||||
Colors.white, baseColor, label / totalLength),
|
||||
child: Text('${widgetCounter + label}'),
|
||||
constraints: BoxConstraints.expand(height: height),
|
||||
child: Text('${widgetCounter + label}'),
|
||||
)
|
||||
: MyContainer(
|
||||
// This key forces rebuilding the element
|
||||
key: ValueKey<int>(widgetCounter + label),
|
||||
color: Color.lerp(
|
||||
Colors.white, baseColor, label / totalLength),
|
||||
child: Text('${widgetCounter + label}'),
|
||||
constraints: BoxConstraints.expand(height: height),
|
||||
child: Text('${widgetCounter + label}'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -109,8 +109,8 @@ class MyContainer extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: color,
|
||||
child: child,
|
||||
constraints: constraints,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -310,9 +310,9 @@ class StockHomeState extends State<StockHome> {
|
|||
Widget buildFloatingActionButton() {
|
||||
return FloatingActionButton(
|
||||
tooltip: 'Create company',
|
||||
child: const Icon(Icons.add),
|
||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||
onPressed: _handleCreateCompany,
|
||||
child: const Icon(Icons.add),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ class StockRow extends StatelessWidget {
|
|||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: DefaultTextStyle.of(context).style.textBaseline,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 2,
|
||||
|
@ -77,8 +79,6 @@ class StockRow extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
],
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: DefaultTextStyle.of(context).style.textBaseline,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -28,8 +28,10 @@ class _StockSymbolView extends StatelessWidget {
|
|||
return Container(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
stock.symbol,
|
||||
|
@ -38,7 +40,6 @@ class _StockSymbolView extends StatelessWidget {
|
|||
),
|
||||
arrow,
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
),
|
||||
Text('Last Sale', style: headings),
|
||||
Text('$lastSale ($changeInPrice)'),
|
||||
|
@ -61,7 +62,6 @@ class _StockSymbolView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
],
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -82,8 +82,8 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
|||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text('RECORD'),
|
||||
onPressed: listenToFlutterViewEvents,
|
||||
child: const Text('RECORD'),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
|
|
@ -57,20 +57,20 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
|
|||
if (viewChannel != null) ... <Widget>[
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('ShowAlertDialog'),
|
||||
child: const Text('SHOW ALERT DIALOG'),
|
||||
onPressed: onShowAlertDialogPressed,
|
||||
child: const Text('SHOW ALERT DIALOG'),
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('AddWindow'),
|
||||
child: const Text('ADD WINDOW'),
|
||||
onPressed: onAddWindowPressed,
|
||||
child: const Text('ADD WINDOW'),
|
||||
),
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('TapWindow'),
|
||||
child: const Text('TAP WINDOW'),
|
||||
onPressed: onTapWindowPressed,
|
||||
child: const Text('TAP WINDOW'),
|
||||
),
|
||||
if (windowClickCount > 0)
|
||||
Text(
|
||||
|
|
|
@ -157,8 +157,8 @@ Press play to produce texture frames.''';
|
|||
),
|
||||
floatingActionButton: _icon == null ? null : FloatingActionButton(
|
||||
key: const ValueKey<String>('fab'),
|
||||
child: Icon(_icon),
|
||||
onPressed: _nextState,
|
||||
child: Icon(_icon),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -70,20 +70,20 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||
),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
CupertinoButton.filled(
|
||||
child: const Text('Alert with Title'),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||
child: const Text('Alert with Title'),
|
||||
onPressed: () => _onAlertWithTitlePress(context),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
CupertinoButton.filled(
|
||||
child: const Text('Alert with Buttons'),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||
child: const Text('Alert with Buttons'),
|
||||
onPressed: () => _onAlertWithButtonsPress(context),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
CupertinoButton.filled(
|
||||
child: const Text('Alert Buttons Only'),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||
child: const Text('Alert Buttons Only'),
|
||||
onPressed: () {
|
||||
showDemoDialog(
|
||||
context: context,
|
||||
|
@ -93,8 +93,8 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||
),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
CupertinoButton.filled(
|
||||
child: const Text('Action Sheet'),
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||
child: const Text('Action Sheet'),
|
||||
onPressed: () => _onActionSheetPress(context),
|
||||
),
|
||||
],
|
||||
|
@ -120,13 +120,13 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||
title: const Text('Discard draft?'),
|
||||
actions: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: const Text('Discard'),
|
||||
isDestructiveAction: true,
|
||||
child: const Text('Discard'),
|
||||
onPressed: () => Navigator.pop(context, 'Discard'),
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text('Cancel'),
|
||||
isDefaultAction: true,
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||
),
|
||||
],
|
||||
|
@ -188,8 +188,8 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||
),
|
||||
],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
child: const Text('Cancel'),
|
||||
isDefaultAction: true,
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||
),
|
||||
),
|
||||
|
@ -252,8 +252,8 @@ class CupertinoDessertDialog extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: const Text('Cancel'),
|
||||
isDestructiveAction: true,
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, 'Cancel');
|
||||
},
|
||||
|
|
|
@ -61,8 +61,8 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
|
|||
},
|
||||
),
|
||||
const CupertinoButton(
|
||||
child: Text('Disabled'),
|
||||
onPressed: null,
|
||||
child: Text('Disabled'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -76,8 +76,8 @@ class _CupertinoButtonDemoState extends State<CupertinoButtonsDemo> {
|
|||
),
|
||||
const Padding(padding: EdgeInsets.all(12.0)),
|
||||
const CupertinoButton.filled(
|
||||
child: Text('Disabled'),
|
||||
onPressed: null,
|
||||
child: Text('Disabled'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -113,8 +113,8 @@ class ExitButton extends StatelessWidget {
|
|||
padding: EdgeInsets.zero,
|
||||
child: const Tooltip(
|
||||
message: 'Back',
|
||||
child: Text('Exit'),
|
||||
excludeFromSemantics: true,
|
||||
child: Text('Exit'),
|
||||
),
|
||||
onPressed: () {
|
||||
// The demo is on the root navigator.
|
||||
|
@ -808,8 +808,8 @@ class Tab3Dialog extends StatelessWidget {
|
|||
return CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
leading: CupertinoButton(
|
||||
child: const Text('Cancel'),
|
||||
padding: EdgeInsets.zero,
|
||||
child: const Text('Cancel'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop(false);
|
||||
},
|
||||
|
|
|
@ -45,13 +45,13 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
|
|||
padding: const EdgeInsets.symmetric(horizontal: 2.0),
|
||||
child: CupertinoButton(
|
||||
minSize: 0.0,
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
onPressed: () => setState(() => _chatTextController!.clear()),
|
||||
child: const Icon(
|
||||
CupertinoIcons.arrow_up_circle_fill,
|
||||
size: 28.0,
|
||||
color: CupertinoColors.activeGreen,
|
||||
),
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
onPressed: ()=> setState(()=> _chatTextController!.clear()),
|
||||
),
|
||||
),
|
||||
autofocus: true,
|
||||
|
|
|
@ -35,8 +35,8 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
|
|||
label: 'circular floating action button',
|
||||
value: FloatingActionButton(
|
||||
onPressed: _showSnackbar,
|
||||
child: Icon(Icons.add, semanticLabel: 'Action'),
|
||||
backgroundColor: Colors.orange,
|
||||
child: Icon(Icons.add, semanticLabel: 'Action'),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -431,6 +431,7 @@ class _DiamondFab extends StatelessWidget {
|
|||
return Material(
|
||||
shape: const _DiamondBorder(),
|
||||
color: Colors.orange,
|
||||
elevation: 6.0,
|
||||
child: InkWell(
|
||||
onTap: onPressed,
|
||||
child: SizedBox(
|
||||
|
@ -442,7 +443,6 @@ class _DiamondFab extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
elevation: 6.0,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,8 +138,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||
},
|
||||
),
|
||||
const ElevatedButton(
|
||||
child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 1'),
|
||||
onPressed: null,
|
||||
child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 1'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -185,8 +185,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||
},
|
||||
),
|
||||
const TextButton(
|
||||
child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 3',),
|
||||
onPressed: null,
|
||||
child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 3',),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -233,8 +233,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||
),
|
||||
OutlinedButton(
|
||||
style: style,
|
||||
child: const Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 5'),
|
||||
onPressed: null,
|
||||
child: const Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 5'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -376,11 +376,11 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
|||
return Align(
|
||||
alignment: const Alignment(0.0, -0.2),
|
||||
child: FloatingActionButton(
|
||||
tooltip: 'floating action button',
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () {
|
||||
// Perform some action
|
||||
},
|
||||
tooltip: 'floating action button',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class _PageSelector extends StatelessWidget {
|
|||
Container(
|
||||
margin: const EdgeInsets.only(top: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.chevron_left),
|
||||
|
@ -44,7 +45,6 @@ class _PageSelector extends StatelessWidget {
|
|||
tooltip: 'Page forward',
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
|
|
@ -96,7 +96,10 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
|
|||
];
|
||||
return Column(
|
||||
children: indicators
|
||||
.map<Widget>((Widget c) => Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
|
||||
.map<Widget>((Widget c) => Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0),
|
||||
child: c,
|
||||
))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -150,8 +150,9 @@ class _ListDemoState extends State<ReorderableListDemo> {
|
|||
key: Key(item.value),
|
||||
height: 100.0,
|
||||
width: 100.0,
|
||||
child: CircleAvatar(child: Text(item.value),
|
||||
child: CircleAvatar(
|
||||
backgroundColor: Colors.green,
|
||||
child: Text(item.value),
|
||||
),
|
||||
);
|
||||
break;
|
||||
|
|
|
@ -84,8 +84,8 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
|||
builder: buildBody
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.add),
|
||||
tooltip: 'Create',
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () {
|
||||
print('Floating Action Button was pressed');
|
||||
},
|
||||
|
|
|
@ -125,8 +125,8 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
|
|||
key: page.fabKey,
|
||||
tooltip: 'Show explanation',
|
||||
backgroundColor: page.fabColor,
|
||||
child: page.fabIcon,
|
||||
onPressed: _showExplanatoryText,
|
||||
child: page.fabIcon,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -280,8 +280,8 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
|||
const SizedBox(height: 24.0),
|
||||
Center(
|
||||
child: ElevatedButton(
|
||||
child: const Text('SUBMIT'),
|
||||
onPressed: _handleSubmitted,
|
||||
child: const Text('SUBMIT'),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24.0),
|
||||
|
|
|
@ -277,8 +277,8 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
|
|||
children: <Widget>[
|
||||
AnimatedPadding(
|
||||
padding: _cartPaddingFor(numProducts),
|
||||
child: const Icon(Icons.shopping_cart),
|
||||
duration: const Duration(milliseconds: 225),
|
||||
child: const Icon(Icons.shopping_cart),
|
||||
),
|
||||
Container(
|
||||
// Accounts for the overflow number
|
||||
|
|
|
@ -40,7 +40,7 @@ class HomePage extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
if (backdrop != null)
|
||||
backdrop!,
|
||||
Align(child: expandingBottomSheet, alignment: Alignment.bottomRight),
|
||||
Align(alignment: Alignment.bottomRight, child: expandingBottomSheet),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -133,8 +133,8 @@ class PrimaryColorOverride extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Theme(
|
||||
child: child!,
|
||||
data: Theme.of(context).copyWith(primaryColor: color),
|
||||
child: child!,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ class AsymmetricView extends StatelessWidget {
|
|||
return ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.fromLTRB(0.0, 34.0, 16.0, 44.0),
|
||||
children: _buildColumns(context),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
children: _buildColumns(context),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,9 +68,6 @@ class _TransformationsDemoState extends State<TransformationsDemo> {
|
|||
_reset = false;
|
||||
});
|
||||
},
|
||||
child: CustomPaint(
|
||||
painter: painter,
|
||||
),
|
||||
boundaryRect: Rect.fromLTWH(
|
||||
-visibleSize.width / 2,
|
||||
-visibleSize.height / 2,
|
||||
|
@ -83,6 +80,9 @@ class _TransformationsDemoState extends State<TransformationsDemo> {
|
|||
initialTranslation: Offset(size.width / 2, size.height / 2),
|
||||
onTapUp: _onTapUp,
|
||||
size: size,
|
||||
child: CustomPaint(
|
||||
painter: painter,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
@ -288,9 +288,9 @@ class _GestureTransformableState extends State<GestureTransformable> with Ticker
|
|||
child: Transform(
|
||||
transform: _transform,
|
||||
child: SizedBox(
|
||||
child: widget.child,
|
||||
height: widget.size.height,
|
||||
width: widget.size.width,
|
||||
child: widget.child,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -127,11 +127,11 @@ class _VideoPlayerLoadingState extends State<VideoPlayerLoading> {
|
|||
return VideoPlayer(widget.controller!);
|
||||
}
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: <Widget>[
|
||||
VideoPlayer(widget.controller!),
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
],
|
||||
fit: StackFit.expand,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -419,6 +419,7 @@ class _VideoDemoState extends State<VideoDemo> with SingleTickerProviderStateMix
|
|||
),
|
||||
body: isSupported
|
||||
? ConnectivityOverlay(
|
||||
connectedCompleter: connectedCompleter,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
|
@ -435,7 +436,6 @@ class _VideoDemoState extends State<VideoDemo> with SingleTickerProviderStateMix
|
|||
],
|
||||
),
|
||||
),
|
||||
connectedCompleter: connectedCompleter,
|
||||
)
|
||||
: const Center(
|
||||
child: Text(
|
||||
|
|
|
@ -296,9 +296,9 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
|||
AnimationStatus.dismissed,
|
||||
controller: _controller,
|
||||
child: Visibility(
|
||||
child: widget.backLayer!,
|
||||
visible: _controller!.status != AnimationStatus.completed,
|
||||
maintainState: true,
|
||||
child: widget.backLayer!,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -26,8 +26,8 @@ ElevatedButton(
|
|||
// Buttons are disabled when onPressed isn't
|
||||
// specified or is null.
|
||||
const ElevatedButton(
|
||||
child: Text('BUTTON TITLE'),
|
||||
onPressed: null,
|
||||
child: Text('BUTTON TITLE'),
|
||||
);
|
||||
|
||||
// Create a button with an icon and a
|
||||
|
@ -54,8 +54,8 @@ OutlinedButton(
|
|||
// Buttons are disabled when onPressed isn't
|
||||
// specified or is null.
|
||||
const OutlinedButton(
|
||||
child: Text('BUTTON TITLE'),
|
||||
onPressed: null,
|
||||
child: Text('BUTTON TITLE'),
|
||||
);
|
||||
|
||||
// Create a button with an icon and a
|
||||
|
@ -82,8 +82,8 @@ TextButton(
|
|||
// Buttons are disabled when onPressed isn't
|
||||
// specified or is null.
|
||||
const TextButton(
|
||||
child: Text('BUTTON TITLE'),
|
||||
onPressed: null,
|
||||
child: Text('BUTTON TITLE'),
|
||||
);
|
||||
// END
|
||||
|
||||
|
@ -136,8 +136,8 @@ Scaffold(
|
|||
title: const Text('Demo'),
|
||||
),
|
||||
floatingActionButton: const FloatingActionButton(
|
||||
child: Icon(Icons.add),
|
||||
onPressed: null,
|
||||
child: Icon(Icons.add),
|
||||
),
|
||||
);
|
||||
// END
|
||||
|
|
|
@ -288,11 +288,11 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
|||
|
||||
static Widget _topHomeLayout(Widget? currentChild, List<Widget> previousChildren) {
|
||||
return Stack(
|
||||
alignment: Alignment.topCenter,
|
||||
children: <Widget>[
|
||||
...previousChildren,
|
||||
if (currentChild != null) currentChild,
|
||||
],
|
||||
alignment: Alignment.topCenter,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -400,8 +400,8 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
|||
);
|
||||
}
|
||||
home = AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
child: home,
|
||||
value: SystemUiOverlayStyle.light,
|
||||
child: home,
|
||||
);
|
||||
|
||||
return home;
|
||||
|
|
|
@ -203,8 +203,8 @@ class _Heading extends StatelessWidget {
|
|||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
child: Semantics(
|
||||
child: Text(text),
|
||||
header: true,
|
||||
child: Text(text),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -66,8 +66,8 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
|||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
child: const Text('RECORD'),
|
||||
onPressed: listenToFlutterViewEvents,
|
||||
child: const Text('RECORD'),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
|
|
@ -61,25 +61,25 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
|
|||
if (viewChannel != null) ... <Widget>[
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('ShowAlertDialog'),
|
||||
child: const Text('SHOW ALERT DIALOG'),
|
||||
onPressed: onShowAlertDialogPressed,
|
||||
child: const Text('SHOW ALERT DIALOG'),
|
||||
),
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('TogglePlatformView'),
|
||||
child: const Text('TOGGLE PLATFORM VIEW'),
|
||||
onPressed: onTogglePlatformView,
|
||||
child: const Text('TOGGLE PLATFORM VIEW'),
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('AddChildView'),
|
||||
child: const Text('ADD CHILD VIEW'),
|
||||
onPressed: onChildViewPressed,
|
||||
child: const Text('ADD CHILD VIEW'),
|
||||
),
|
||||
ElevatedButton(
|
||||
key: const ValueKey<String>('TapChildView'),
|
||||
child: const Text('TAP CHILD VIEW'),
|
||||
onPressed: onTapChildViewPressed,
|
||||
child: const Text('TAP CHILD VIEW'),
|
||||
),
|
||||
if (nestedViewClickCount > 0)
|
||||
Text(
|
||||
|
|
|
@ -83,8 +83,8 @@ class PlatformViewPage extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
const Expanded(
|
||||
child: SizedBox(
|
||||
child: UiKitView(viewType: 'platform_view'),
|
||||
width: 300,
|
||||
child: UiKitView(viewType: 'platform_view'),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
|
|
|
@ -455,23 +455,23 @@ class _FocusDemoState extends State<FocusDemo> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
child: const Text('UNDO'),
|
||||
onPressed: canUndo
|
||||
? () {
|
||||
Actions.invoke(context, const UndoIntent());
|
||||
}
|
||||
: null,
|
||||
child: const Text('UNDO'),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: ElevatedButton(
|
||||
child: const Text('REDO'),
|
||||
onPressed: canRedo
|
||||
? () {
|
||||
Actions.invoke(context, const RedoIntent());
|
||||
}
|
||||
: null,
|
||||
child: const Text('REDO'),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -366,7 +366,7 @@ class CardCollectionState extends State<CardCollection> {
|
|||
cardCollection = Stack(
|
||||
children: <Widget>[
|
||||
Column(children: <Widget>[Image.network(_sunshineURL)]),
|
||||
ShaderMask(child: cardCollection, shaderCallback: _createShader),
|
||||
ShaderMask(shaderCallback: _createShader, child: cardCollection),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -309,12 +309,12 @@ class _OptionsState extends State<Options> {
|
|||
},
|
||||
items: const <DropdownMenuItem<String>>[
|
||||
DropdownMenuItem<String>(
|
||||
child: Text('Standard'),
|
||||
value: 'standard',
|
||||
child: Text('Standard'),
|
||||
),
|
||||
DropdownMenuItem<String>(child: Text('Comfortable'), value: 'comfortable'),
|
||||
DropdownMenuItem<String>(child: Text('Compact'), value: 'compact'),
|
||||
DropdownMenuItem<String>(child: Text('Custom'), value: 'custom'),
|
||||
DropdownMenuItem<String>(value: 'comfortable', child: Text('Comfortable')),
|
||||
DropdownMenuItem<String>(value: 'compact', child: Text('Compact')),
|
||||
DropdownMenuItem<String>(value: 'custom', child: Text('Custom')),
|
||||
],
|
||||
value: _densityToProfile(widget.model.density),
|
||||
),
|
||||
|
|
|
@ -65,13 +65,13 @@ class _HoverDemoState extends State<HoverDemo> {
|
|||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
style: overrideFocusColor,
|
||||
child: const Text('Button'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => print('Button pressed.'),
|
||||
child: const Text('Button'),
|
||||
style: overrideFocusColor,
|
||||
child: const Text('Button'),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => print('Button pressed'),
|
||||
|
|
|
@ -121,9 +121,9 @@ class PageViewAppState extends State<PageViewApp> {
|
|||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
return PageView(
|
||||
children: cardModels.map<Widget>(buildCard).toList(),
|
||||
// TODO(abarth): itemsWrap: itemsWrap,
|
||||
scrollDirection: scrollDirection,
|
||||
children: cardModels.map<Widget>(buildCard).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -255,8 +255,8 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
|||
Text(_status),
|
||||
Center(
|
||||
child: ElevatedButton(
|
||||
child: Text(_label),
|
||||
onPressed: _handleButtonPressed,
|
||||
child: Text(_label),
|
||||
),
|
||||
),
|
||||
Text(_result),
|
||||
|
|
|
@ -173,6 +173,7 @@ class GestureDemoState extends State<GestureDemo> {
|
|||
child: Container(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
|
@ -211,7 +212,6 @@ class GestureDemoState extends State<GestureDemo> {
|
|||
],
|
||||
),
|
||||
],
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -92,10 +92,12 @@ class SectorAppState extends State<SectorApp> {
|
|||
|
||||
Widget buildBody() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 25.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
onPressed: _enabledAdd ? addSector : null,
|
||||
|
@ -128,7 +130,6 @@ class SectorAppState extends State<SectorApp> {
|
|||
),
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
@ -145,7 +146,6 @@ class SectorAppState extends State<SectorApp> {
|
|||
),
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
|
|||
child: SizedBox(
|
||||
height: 300.0,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
const Rectangle(Color(0xFF00FFFF)),
|
||||
Material(
|
||||
|
@ -48,6 +49,7 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
|
|||
padding: const EdgeInsets.all(10.0),
|
||||
margin: const EdgeInsets.all(10.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
child: Row(
|
||||
|
@ -63,13 +65,11 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
|
|||
),
|
||||
CircularProgressIndicator(value: value),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Rectangle(Color(0xFFFFFF00)),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -68,8 +68,8 @@ class _PlatformChannelState extends State<PlatformChannel> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ElevatedButton(
|
||||
child: const Text('Refresh'),
|
||||
onPressed: _getBatteryLevel,
|
||||
child: const Text('Refresh'),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -68,8 +68,8 @@ class _PlatformChannelState extends State<PlatformChannel> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ElevatedButton(
|
||||
child: const Text('Refresh'),
|
||||
onPressed: _getBatteryLevel,
|
||||
child: const Text('Refresh'),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -75,10 +75,10 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.all(18.0),
|
||||
child: ElevatedButton(
|
||||
onPressed: _launchPlatformCount,
|
||||
child: Platform.isIOS
|
||||
? const Text('Continue in iOS view')
|
||||
: const Text('Continue in Android view'),
|
||||
onPressed: _launchPlatformCount,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -295,8 +295,8 @@ class _BottomSheetState extends State<BottomSheet> {
|
|||
onVerticalDragStart: _handleDragStart,
|
||||
onVerticalDragUpdate: _handleDragUpdate,
|
||||
onVerticalDragEnd: _handleDragEnd,
|
||||
child: bottomSheet,
|
||||
excludeFromSemantics: true,
|
||||
child: bottomSheet,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,9 +225,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
bottomNavigationBar: ShapeListener(
|
||||
BottomAppBar(
|
||||
child: SizedBox(height: 100.0),
|
||||
shape: RectangularNotch(),
|
||||
notchMargin: 0.0,
|
||||
child: SizedBox(height: 100.0),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
|
@ -277,9 +277,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
bottomNavigationBar: ShapeListener(
|
||||
BottomAppBar(
|
||||
child: SizedBox(height: 100.0),
|
||||
shape: RectangularNotch(),
|
||||
notchMargin: 6.0,
|
||||
child: SizedBox(height: 100.0),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
|
@ -353,9 +353,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
bottomNavigationBar:
|
||||
BottomAppBar(
|
||||
child: SizedBox(height: 100.0),
|
||||
shape: RectangularNotch(),
|
||||
notchMargin: 0.0,
|
||||
child: SizedBox(height: 100.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -369,10 +369,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
bottomNavigationBar:
|
||||
BottomAppBar(
|
||||
child: SizedBox(height: 100.0),
|
||||
shape: RectangularNotch(),
|
||||
notchMargin: 0.0,
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
child: SizedBox(height: 100.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -467,8 +467,8 @@ class ShapeListenerState extends State<ShapeListener> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomPaint(
|
||||
child: widget.child,
|
||||
painter: cache,
|
||||
child: widget.child,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -791,9 +791,9 @@ void main() {
|
|||
),
|
||||
builder: (BuildContext context) {
|
||||
return MaterialButton(
|
||||
child: const Text('BottomSheet'),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
key: tapTargetToClose,
|
||||
child: const Text('BottomSheet'),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -361,9 +361,9 @@ void main() {
|
|||
),
|
||||
textTheme: ButtonTextTheme.primary,
|
||||
child: FlatButton(
|
||||
child: const Text('FlatButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('FlatButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -180,8 +180,8 @@ void main() {
|
|||
|
||||
testWidgets('SimpleDialog custom clipBehavior', (WidgetTester tester) async {
|
||||
const SimpleDialog dialog = SimpleDialog(
|
||||
children: <Widget>[],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[],
|
||||
);
|
||||
await tester.pumpWidget(_buildAppWithDialog(dialog));
|
||||
|
||||
|
@ -327,8 +327,8 @@ void main() {
|
|||
children: <Widget>[
|
||||
SimpleDialogOption(
|
||||
onPressed: () {},
|
||||
child: const Text('First option'),
|
||||
padding: customPadding,
|
||||
child: const Text('First option'),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -1263,8 +1263,8 @@ void main() {
|
|||
viewInsets: EdgeInsets.zero,
|
||||
),
|
||||
child: Dialog(
|
||||
child: Placeholder(),
|
||||
insetPadding: null,
|
||||
child: Placeholder(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -650,8 +650,8 @@ void main() {
|
|||
},
|
||||
items: items.map((String string) {
|
||||
return DropdownMenuItem<String>(
|
||||
child: Text(string),
|
||||
value: string,
|
||||
child: Text(string),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
|
|
@ -604,12 +604,12 @@ void main() {
|
|||
value: 1,
|
||||
items: const <DropdownMenuItem<int>>[
|
||||
DropdownMenuItem<int>(
|
||||
child: Text('First Item'),
|
||||
value: 1,
|
||||
child: Text('First Item'),
|
||||
),
|
||||
DropdownMenuItem<int>(
|
||||
child: Text('Second Item'),
|
||||
value: 2,
|
||||
child: Text('Second Item'),
|
||||
),
|
||||
],
|
||||
onChanged: (_) { },
|
||||
|
@ -1512,12 +1512,12 @@ void main() {
|
|||
hint: hint,
|
||||
items: const <DropdownMenuItem<String>>[
|
||||
DropdownMenuItem<String>(
|
||||
child: Text('one'),
|
||||
value: 'one',
|
||||
child: Text('one'),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
child: Text('two'),
|
||||
value: 'two',
|
||||
child: Text('two'),
|
||||
),
|
||||
],
|
||||
value: value,
|
||||
|
@ -2107,8 +2107,8 @@ void main() {
|
|||
},
|
||||
items: items.map((String string) {
|
||||
return DropdownMenuItem<String>(
|
||||
child: Text(string),
|
||||
value: string,
|
||||
child: Text(string),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
@ -2163,8 +2163,8 @@ void main() {
|
|||
},
|
||||
items: items.map((String item) {
|
||||
return DropdownMenuItem<String>(
|
||||
child: Text(item),
|
||||
value: item,
|
||||
child: Text(item),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
@ -2523,8 +2523,8 @@ void main() {
|
|||
},
|
||||
items: items.map((MapEntry<String?, String> item) {
|
||||
return DropdownMenuItem<String>(
|
||||
child: Text(item.value),
|
||||
value: item.key,
|
||||
child: Text(item.value),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
|
|
|
@ -154,9 +154,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: ElevatedButton(
|
||||
child: const Text('ElevatedButton'),
|
||||
onPressed: () { },
|
||||
focusNode: focusNode,
|
||||
child: const Text('ElevatedButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -221,9 +221,9 @@ void main() {
|
|||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return ElevatedButton(
|
||||
child: const Text('ElevatedButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('ElevatedButton'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -348,9 +348,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: ElevatedButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -119,9 +119,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: FlatButton(
|
||||
child: const Text('FlatButton'),
|
||||
onPressed: () { },
|
||||
focusNode: focusNode,
|
||||
child: const Text('FlatButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -182,10 +182,10 @@ void main() {
|
|||
colorScheme: colorScheme,
|
||||
textTheme: ButtonTextTheme.primary,
|
||||
child: FlatButton(
|
||||
child: const Text('FlatButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
child: const Text('FlatButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -248,10 +248,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: FlatButton(
|
||||
child: const Text('FlatButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
child: const Text('FlatButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -374,10 +374,10 @@ void main() {
|
|||
body: Center(
|
||||
child: FlatButton(
|
||||
onPressed: null,
|
||||
child: const Text('FlatButton'),
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
disabledTextColor: unusedDisabledTextColor,
|
||||
child: const Text('FlatButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -697,9 +697,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: FlatButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -652,9 +652,9 @@ void main() {
|
|||
const SnackBar(content: Text('Snacky!')),
|
||||
);
|
||||
},
|
||||
child: const Text('FAB'),
|
||||
mini: mini,
|
||||
key: key,
|
||||
child: const Text('FAB'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -1593,8 +1593,8 @@ Widget _singleFabScaffold(
|
|||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {},
|
||||
child: const Icon(Icons.beach_access),
|
||||
mini: mini,
|
||||
child: const Icon(Icons.beach_access),
|
||||
),
|
||||
floatingActionButtonLocation: location,
|
||||
floatingActionButtonAnimator: animator,
|
||||
|
|
|
@ -96,7 +96,6 @@ void main() {
|
|||
home: Scaffold(
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () { },
|
||||
child: const Icon(Icons.add),
|
||||
backgroundColor: backgroundColor,
|
||||
foregroundColor: foregroundColor,
|
||||
splashColor: splashColor,
|
||||
|
@ -104,6 +103,7 @@ void main() {
|
|||
disabledElevation: disabledElevation,
|
||||
highlightElevation: highlightElevation,
|
||||
shape: shape,
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
|
|
@ -530,11 +530,11 @@ void main() {
|
|||
final Widget toggleButtons = Scaffold(
|
||||
body: Center(
|
||||
child: ToggleButtons(
|
||||
isSelected: const <bool>[true, false],
|
||||
children: const <Widget>[
|
||||
Text('selected'),
|
||||
Text('unselected'),
|
||||
],
|
||||
isSelected: const <bool>[true, false],
|
||||
onPressed: (int index) { },
|
||||
),
|
||||
),
|
||||
|
@ -622,7 +622,7 @@ void main() {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
const RaisedButton(child: Text('disabled'), onPressed: null),
|
||||
const RaisedButton(onPressed: null, child: Text('disabled')),
|
||||
RaisedButton(child: const Text('enabled'), onPressed: () { }),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -624,8 +624,8 @@ void main() {
|
|||
child: Material(
|
||||
child: InkWell(
|
||||
onTap: () { },
|
||||
child: const Text('Button'),
|
||||
excludeFromSemantics: true,
|
||||
child: const Text('Button'),
|
||||
),
|
||||
),
|
||||
));
|
||||
|
|
|
@ -307,9 +307,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: MaterialButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -622,8 +622,8 @@ void main() {
|
|||
child: Material(
|
||||
child: Center(
|
||||
child: MaterialButton(
|
||||
child: Text('Button'),
|
||||
onPressed: null, // button is disabled
|
||||
child: Text('Button'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -426,8 +426,8 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.transparency,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -441,8 +441,8 @@ void main() {
|
|||
key: materialKey,
|
||||
type: MaterialType.transparency,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10.0)),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -461,8 +461,8 @@ void main() {
|
|||
key: materialKey,
|
||||
type: MaterialType.transparency,
|
||||
shape: const StadiumBorder(),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -481,8 +481,8 @@ void main() {
|
|||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
shape: shape,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
);
|
||||
}
|
||||
final Widget material = buildMaterial();
|
||||
|
@ -563,8 +563,8 @@ void main() {
|
|||
key: materialKey,
|
||||
type: MaterialType.canvas,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(5.0)),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
elevation: 1.0,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -582,8 +582,8 @@ void main() {
|
|||
key: materialKey,
|
||||
type: MaterialType.canvas,
|
||||
shape: const StadiumBorder(),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
elevation: 1.0,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -653,8 +653,8 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.circle,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -670,8 +670,8 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.button,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
color: const Color(0xFF0000FF),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -688,10 +688,10 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.button,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
color: const Color(0xFF0000FF),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6.0)),
|
||||
elevation: 4.0,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -708,10 +708,10 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.button,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
color: const Color(0xFF0000FF),
|
||||
shape: const StadiumBorder(),
|
||||
elevation: 4.0,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -729,7 +729,6 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.button,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
color: const Color(0xFF0000FF),
|
||||
shape: const CircleBorder(
|
||||
side: BorderSide(
|
||||
|
@ -737,6 +736,7 @@ void main() {
|
|||
color: Color(0xFF0000FF),
|
||||
),
|
||||
),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -750,13 +750,13 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.transparency,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
shape: const CircleBorder(
|
||||
side: BorderSide(
|
||||
width: 2.0,
|
||||
color: Color(0xFF0000FF),
|
||||
),
|
||||
),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -770,8 +770,8 @@ void main() {
|
|||
Material(
|
||||
key: materialKey,
|
||||
type: MaterialType.transparency,
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
shape: const CircleBorder(),
|
||||
child: const SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -259,9 +259,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -322,10 +322,10 @@ void main() {
|
|||
colorScheme: colorScheme,
|
||||
textTheme: ButtonTextTheme.primary,
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -388,10 +388,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -514,10 +514,10 @@ void main() {
|
|||
body: Center(
|
||||
child: OutlineButton(
|
||||
onPressed: null,
|
||||
child: const Text('OutlineButton'),
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
disabledTextColor: unusedDisabledTextColor,
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -559,10 +559,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)),
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -613,10 +613,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: () {},
|
||||
borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)),
|
||||
highlightedBorderColor: ignoredPressedColor,
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -651,10 +651,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlineButton(
|
||||
child: const Text('OutlineButton'),
|
||||
onPressed: null,
|
||||
borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)),
|
||||
highlightedBorderColor: ignoredDisabledColor,
|
||||
child: const Text('OutlineButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -674,9 +674,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: OutlineButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -259,9 +259,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: OutlinedButton(
|
||||
child: const Text('OutlinedButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('OutlinedButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -327,9 +327,9 @@ void main() {
|
|||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return OutlinedButton(
|
||||
child: const Text('OutlinedButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('OutlinedButton'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -578,9 +578,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: OutlinedButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -147,8 +147,8 @@ void main() {
|
|||
child: Column(
|
||||
children: <Widget>[
|
||||
PopupMenuButton<int>(
|
||||
child: Text('Tap Me', key: popupButtonKey),
|
||||
enabled: false,
|
||||
child: Text('Tap Me', key: popupButtonKey),
|
||||
itemBuilder: (BuildContext context) {
|
||||
itemBuilderCalled = true;
|
||||
return <PopupMenuEntry<int>>[
|
||||
|
@ -222,8 +222,8 @@ void main() {
|
|||
children: <Widget>[
|
||||
PopupMenuButton<int>(
|
||||
key: popupButtonKey,
|
||||
child: Container(key: childKey),
|
||||
enabled: false,
|
||||
child: Container(key: childKey),
|
||||
itemBuilder: (BuildContext context) {
|
||||
itemBuilderCalled = true;
|
||||
return <PopupMenuEntry<int>>[
|
||||
|
@ -264,8 +264,8 @@ void main() {
|
|||
children: <Widget>[
|
||||
PopupMenuButton<int>(
|
||||
key: popupButtonKey,
|
||||
child: Container(key: childKey),
|
||||
enabled: false,
|
||||
child: Container(key: childKey),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return <PopupMenuEntry<int>>[
|
||||
const PopupMenuItem<int>(
|
||||
|
@ -365,22 +365,22 @@ void main() {
|
|||
onSelected: (String value) { selected = value; },
|
||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||
PopupMenuItem<String>(
|
||||
child: const Text('First option'),
|
||||
value: 'first',
|
||||
child: const Text('First option'),
|
||||
onTap: () {
|
||||
menuItemTapCounters[0] += 1;
|
||||
},
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
child: const Text('Second option'),
|
||||
value: 'second',
|
||||
child: const Text('Second option'),
|
||||
onTap: () {
|
||||
menuItemTapCounters[1] += 1;
|
||||
},
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
child: Text('Option without onTap'),
|
||||
value: 'third',
|
||||
child: Text('Option without onTap'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1289,17 +1289,17 @@ void main() {
|
|||
onSelected: (String result) {
|
||||
selectedValue = result;
|
||||
},
|
||||
child: const Text('Menu Button'),
|
||||
initialValue: '1',
|
||||
child: const Text('Menu Button'),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||
const PopupMenuItem<String>(
|
||||
child: Text('1'),
|
||||
value: '1',
|
||||
child: Text('1'),
|
||||
),
|
||||
const PopupMenuDivider(),
|
||||
const PopupMenuItem<String>(
|
||||
child: Text('2'),
|
||||
value: '2',
|
||||
child: Text('2'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -2166,8 +2166,8 @@ void main() {
|
|||
),
|
||||
),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<int>>[
|
||||
const PopupMenuItem<int>(child: Text('-1-'), value: 1),
|
||||
const PopupMenuItem<int>(child: Text('-2-'), value: 2),
|
||||
const PopupMenuItem<int>(value: 1, child: Text('-1-')),
|
||||
const PopupMenuItem<int>(value: 2, child: Text('-2-')),
|
||||
],
|
||||
)],
|
||||
),
|
||||
|
@ -2364,8 +2364,8 @@ void main() {
|
|||
),
|
||||
),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<int>>[
|
||||
const PopupMenuItem<int>(child: Text('-1-'), value: 1),
|
||||
const PopupMenuItem<int>(child: Text('-2-'), value: 2),
|
||||
const PopupMenuItem<int>(value: 1, child: Text('-1-')),
|
||||
const PopupMenuItem<int>(value: 2, child: Text('-2-')),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 600),
|
||||
|
|
|
@ -121,9 +121,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: RaisedButton(
|
||||
child: const Text('RaisedButton'),
|
||||
onPressed: () { },
|
||||
focusNode: focusNode,
|
||||
child: const Text('RaisedButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -185,10 +185,10 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: RaisedButton(
|
||||
child: const Text('RaisedButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
child: const Text('RaisedButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -312,10 +312,10 @@ void main() {
|
|||
body: Center(
|
||||
child: RaisedButton(
|
||||
onPressed: null,
|
||||
child: const Text('RaisedButton'),
|
||||
focusNode: focusNode,
|
||||
textColor: MaterialStateColor.resolveWith(getTextColor),
|
||||
disabledTextColor: unusedDisabledTextColor,
|
||||
child: const Text('RaisedButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -340,9 +340,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: RaisedButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -447,9 +447,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: RawMaterialButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -47,11 +47,11 @@ void main() {
|
|||
width: itemHeight * 10,
|
||||
child: ReorderableListView(
|
||||
header: header,
|
||||
children: listItems.map<Widget>(listItemToWidget).toList(),
|
||||
scrollDirection: scrollDirection,
|
||||
onReorder: onReorder,
|
||||
reverse: reverse,
|
||||
padding: padding,
|
||||
children: listItems.map<Widget>(listItemToWidget).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -69,9 +69,9 @@ void main() {
|
|||
final List<String> currentListItems = listItems.take(1).toList();
|
||||
final ReorderableListView reorderableListView = ReorderableListView(
|
||||
header: const Text('Header'),
|
||||
children: currentListItems.map<Widget>(listItemToWidget).toList(),
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (_, __) => onReorderWasCalled = true,
|
||||
children: currentListItems.map<Widget>(listItemToWidget).toList(),
|
||||
);
|
||||
final List<String> currentOriginalListItems = originalListItems.take(1).toList();
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
|
@ -156,6 +156,8 @@ void main() {
|
|||
|
||||
testWidgets('properly determines the vertical drop area extents', (WidgetTester tester) async {
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: const <Widget>[
|
||||
SizedBox(
|
||||
key: Key('Normal item'),
|
||||
|
@ -173,8 +175,6 @@ void main() {
|
|||
child: Text('Last item'),
|
||||
),
|
||||
],
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: SizedBox(
|
||||
|
@ -359,9 +359,9 @@ void main() {
|
|||
final ScrollController primary = ScrollController();
|
||||
final Widget reorderableList = ReorderableListView(
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')),
|
||||
],
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
|
@ -408,9 +408,9 @@ void main() {
|
|||
scrollController: customController,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: firstBox),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: secondBox),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: thirdBox),
|
||||
SizedBox(width: 100.0, height: 100.0, key: firstBox, child: Text('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: secondBox, child: Text('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: thirdBox, child: Text('A')),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -459,9 +459,9 @@ void main() {
|
|||
testWidgets('Still builds when no PrimaryScrollController is available', (WidgetTester tester) async {
|
||||
final Widget reorderableList = ReorderableListView(
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')),
|
||||
],
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
|
@ -621,6 +621,8 @@ void main() {
|
|||
testWidgets("Doesn't hide accessibility when a child declares its own semantics", (WidgetTester tester) async {
|
||||
final SemanticsHandle handle = tester.ensureSemantics();
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: <Widget>[
|
||||
const SizedBox(
|
||||
key: Key('List tile 1'),
|
||||
|
@ -644,8 +646,6 @@ void main() {
|
|||
child: Text('List tile 2'),
|
||||
),
|
||||
],
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: SizedBox(
|
||||
|
@ -684,9 +684,9 @@ void main() {
|
|||
final List<String> currentListItems = listItems.take(1).toList();
|
||||
final ReorderableListView reorderableListView = ReorderableListView(
|
||||
header: const Text('Header'),
|
||||
children: currentListItems.map<Widget>(listItemToWidget).toList(),
|
||||
scrollDirection: Axis.horizontal,
|
||||
onReorder: (_, __) => onReorderWasCalled = true,
|
||||
children: currentListItems.map<Widget>(listItemToWidget).toList(),
|
||||
);
|
||||
final List<String> currentOriginalListItems = originalListItems.take(1).toList();
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
|
@ -767,6 +767,8 @@ void main() {
|
|||
|
||||
testWidgets('properly determines the horizontal drop area extents', (WidgetTester tester) async {
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: const <Widget>[
|
||||
SizedBox(
|
||||
key: Key('Normal item'),
|
||||
|
@ -784,8 +786,6 @@ void main() {
|
|||
child: Text('Last item'),
|
||||
),
|
||||
],
|
||||
scrollDirection: Axis.horizontal,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: SizedBox(
|
||||
|
@ -836,6 +836,8 @@ void main() {
|
|||
testWidgets('Horizontal drag in progress golden image', (WidgetTester tester) async {
|
||||
debugDisableShadows = false;
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: <Widget>[
|
||||
Container(
|
||||
key: const Key('pink'),
|
||||
|
@ -856,8 +858,6 @@ void main() {
|
|||
color: Colors.green,
|
||||
),
|
||||
],
|
||||
scrollDirection: Axis.horizontal,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Container(
|
||||
|
@ -907,13 +907,13 @@ void main() {
|
|||
}
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: ReorderableListView(
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
_Stateful(key: const Key('A')),
|
||||
_Stateful(key: const Key('B')),
|
||||
_Stateful(key: const Key('C')),
|
||||
],
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
));
|
||||
await tester.tap(find.byKey(const Key('A')));
|
||||
|
@ -925,13 +925,13 @@ void main() {
|
|||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: ReorderableListView(
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
_Stateful(key: const Key('B')),
|
||||
_Stateful(key: const Key('C')),
|
||||
_Stateful(key: const Key('A')),
|
||||
],
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
scrollDirection: Axis.horizontal,
|
||||
),
|
||||
));
|
||||
// Only the 'A' widget should be checked.
|
||||
|
@ -1291,6 +1291,8 @@ void main() {
|
|||
|
||||
testWidgets('ReorderableListView can be reversed', (WidgetTester tester) async {
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
reverse: true,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: const <Widget>[
|
||||
SizedBox(
|
||||
key: Key('A'),
|
||||
|
@ -1305,8 +1307,6 @@ void main() {
|
|||
child: Text('C'),
|
||||
),
|
||||
],
|
||||
reverse: true,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: reorderableListView,
|
||||
|
@ -1317,6 +1317,8 @@ void main() {
|
|||
testWidgets('Animation test when placing an item in place', (WidgetTester tester) async {
|
||||
const Key testItemKey = Key('Test item');
|
||||
final Widget reorderableListView = ReorderableListView(
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
children: const <Widget>[
|
||||
SizedBox(
|
||||
key: Key('First item'),
|
||||
|
@ -1334,8 +1336,6 @@ void main() {
|
|||
child: Text('Last item'),
|
||||
),
|
||||
],
|
||||
scrollDirection: Axis.vertical,
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: SizedBox(
|
||||
|
@ -1411,13 +1411,13 @@ void main() {
|
|||
key: ValueKey<int>(items[index]),
|
||||
height: 100,
|
||||
child: ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('item ${items[index]}'),
|
||||
],
|
||||
),
|
||||
index: index,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -1477,9 +1477,9 @@ void main() {
|
|||
testWidgets('Throws an error if no overlay present', (WidgetTester tester) async {
|
||||
final Widget reorderableList = ReorderableListView(
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')),
|
||||
SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')),
|
||||
],
|
||||
onReorder: (int oldIndex, int newIndex) { },
|
||||
);
|
||||
|
|
|
@ -149,9 +149,9 @@ void main() {
|
|||
home: Scaffold(
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
child: const Text('TextButton'),
|
||||
onPressed: () { },
|
||||
focusNode: focusNode,
|
||||
child: const Text('TextButton'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -216,9 +216,9 @@ void main() {
|
|||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return TextButton(
|
||||
child: const Text('TextButton'),
|
||||
onPressed: () {},
|
||||
focusNode: focusNode,
|
||||
child: const Text('TextButton'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -631,9 +631,9 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: TextButton(
|
||||
child: const Text('button'),
|
||||
onPressed: onPressed,
|
||||
onLongPress: onLongPress,
|
||||
child: const Text('button'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@ void main() {
|
|||
builder: (BuildContext context, StateSetter setter) {
|
||||
setState = setter;
|
||||
return TextSelectionToolbarTextButton(
|
||||
child: const Text('button'),
|
||||
padding: TextSelectionToolbarTextButton.getPadding(index, total),
|
||||
child: const Text('button'),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
@ -1159,8 +1159,8 @@ void main() {
|
|||
home: Center(
|
||||
child: Tooltip(
|
||||
message: 'Foo',
|
||||
child: Text('Bar'),
|
||||
excludeFromSemantics: true,
|
||||
child: Text('Bar'),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -9,15 +9,15 @@ void main() {
|
|||
testWidgets('Align smoke test', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
Align(
|
||||
child: Container(),
|
||||
alignment: const Alignment(0.50, 0.50),
|
||||
child: Container(),
|
||||
),
|
||||
);
|
||||
|
||||
await tester.pumpWidget(
|
||||
Align(
|
||||
child: Container(),
|
||||
alignment: Alignment.center,
|
||||
child: Container(),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -43,8 +43,8 @@ void main() {
|
|||
await tester.pumpWidget(const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Align(
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
alignment: AlignmentDirectional.topStart,
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
),
|
||||
));
|
||||
|
||||
|
@ -54,8 +54,8 @@ void main() {
|
|||
await tester.pumpWidget(const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Align(
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
alignment: Alignment.topLeft,
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
),
|
||||
));
|
||||
|
||||
|
@ -67,8 +67,8 @@ void main() {
|
|||
await tester.pumpWidget(const Directionality(
|
||||
textDirection: TextDirection.rtl,
|
||||
child: Align(
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
alignment: AlignmentDirectional.topStart,
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
),
|
||||
));
|
||||
|
||||
|
@ -78,8 +78,8 @@ void main() {
|
|||
await tester.pumpWidget(const Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: Align(
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
alignment: Alignment.topLeft,
|
||||
child: SizedBox(width: 100.0, height: 80.0),
|
||||
),
|
||||
));
|
||||
|
||||
|
@ -93,11 +93,11 @@ void main() {
|
|||
SingleChildScrollView(
|
||||
child: Align(
|
||||
key: alignKey,
|
||||
alignment: Alignment.center,
|
||||
child: const SizedBox(
|
||||
width: 10.0,
|
||||
height: 10.0,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -294,9 +294,9 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: SizedBox(key: target, width: 100.0, height: 200.0),
|
||||
transform: Matrix4.diagonal3Values(0.5, 0.5, 1),
|
||||
transformAlignment: Alignment.topLeft,
|
||||
child: SizedBox(key: target, width: 100.0, height: 200.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -311,9 +311,9 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: SizedBox(key: target, width: 100.0, height: 200.0),
|
||||
transform: Matrix4.diagonal3Values(0.5, 0.5, 1),
|
||||
transformAlignment: Alignment.bottomRight,
|
||||
child: SizedBox(key: target, width: 100.0, height: 200.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -30,12 +30,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 50.0,
|
||||
top: 30.0,
|
||||
width: 70.0,
|
||||
height: 110.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -54,12 +54,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 37.0,
|
||||
top: 31.0,
|
||||
width: 59.0,
|
||||
height: 71.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -113,12 +113,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 50.0,
|
||||
top: 30.0,
|
||||
width: 70.0,
|
||||
height: 110.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -139,12 +139,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 37.0,
|
||||
top: 31.0,
|
||||
width: 59.0,
|
||||
height: 71.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -199,12 +199,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 50.0,
|
||||
top: 30.0,
|
||||
width: 70.0,
|
||||
height: 110.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -225,12 +225,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 37.0,
|
||||
top: 31.0,
|
||||
width: 59.0,
|
||||
height: 71.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -284,12 +284,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -308,12 +308,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 100.0,
|
||||
top: 100.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -332,12 +332,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 150.0,
|
||||
top: 150.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -367,12 +367,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -391,12 +391,12 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
AnimatedPositioned(
|
||||
child: Container(key: key),
|
||||
left: 0.0,
|
||||
top: 100.0,
|
||||
right: 100.0, // 700.0 from the left
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -427,12 +427,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -453,12 +453,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 100.0,
|
||||
top: 100.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -479,12 +479,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 150.0,
|
||||
top: 150.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -516,12 +516,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -542,12 +542,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 100.0,
|
||||
end: 100.0, // 700.0 from the start
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -579,12 +579,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -605,12 +605,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 100.0,
|
||||
top: 100.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -631,12 +631,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 150.0,
|
||||
top: 150.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -668,12 +668,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 0.0,
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -694,12 +694,12 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
AnimatedPositionedDirectional(
|
||||
child: Container(key: key),
|
||||
start: 0.0,
|
||||
top: 100.0,
|
||||
end: 100.0, // 700.0 from the start
|
||||
height: 100.0,
|
||||
duration: const Duration(seconds: 2),
|
||||
child: Container(key: key),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -13,9 +13,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: containerOne, color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: containerOne, color: const Color(0x00000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -26,9 +26,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: containerTwo, color: const Color(0xff000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: containerTwo, color: const Color(0xff000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -40,9 +40,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: containerThree, color: const Color(0xffff0000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: containerThree, color: const Color(0xffff0000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -63,9 +63,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: container1),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: container1),
|
||||
),
|
||||
);
|
||||
expect(find.byKey(container1), findsOneWidget);
|
||||
|
@ -75,9 +75,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: container2),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: container2),
|
||||
),
|
||||
);
|
||||
expect(find.byKey(container1), findsOneWidget);
|
||||
|
@ -87,9 +87,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: container3),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(key: container3),
|
||||
),
|
||||
);
|
||||
expect(find.byKey(container1), findsOneWidget);
|
||||
|
@ -101,9 +101,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -114,9 +114,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -142,9 +142,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -156,9 +156,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -198,8 +198,8 @@ void main() {
|
|||
testWidgets("AnimatedSwitcher doesn't start any animations after dispose.", (WidgetTester tester) async {
|
||||
await tester.pumpWidget(AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
child: Container(color: const Color(0xff000000)),
|
||||
));
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
|
||||
|
@ -221,9 +221,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -252,10 +252,10 @@ void main() {
|
|||
textDirection: TextDirection.rtl,
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
transitionBuilder: newTransitionBuilder,
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -298,9 +298,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: StatefulTest(key: statefulOne),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: StatefulTest(key: statefulOne),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -312,9 +312,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: StatefulTest(key: statefulTwo),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: StatefulTest(key: statefulTwo),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -327,9 +327,9 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: StatefulTest(key: statefulThree),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: StatefulTest(key: statefulThree),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -352,9 +352,9 @@ void main() {
|
|||
textDirection: TextDirection.rtl,
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: child,
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -392,10 +392,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
child: Container(key: containerOne, color: const Color(0xFFFF0000)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -404,10 +404,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
child: Container(key: containerTwo, color: const Color(0xFF00FF00)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -416,10 +416,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(key: containerThree, color: const Color(0xFF0000FF)),
|
||||
switchInCurve: Curves.linear,
|
||||
switchOutCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
child: Container(key: containerThree, color: const Color(0xFF0000FF)),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -446,10 +446,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
switchInCurve: Curves.linear,
|
||||
layoutBuilder: newLayoutBuilder,
|
||||
transitionBuilder: newTransitionBuilder,
|
||||
child: Container(color: const Color(0x00000000)),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ void main() {
|
|||
testWidgets('provides a value to the layer tree', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
const AnnotatedRegion<int>(
|
||||
child: SizedBox(width: 100.0, height: 100.0),
|
||||
value: 1,
|
||||
child: SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
);
|
||||
final List<Layer> layers = tester.layers;
|
||||
|
@ -25,8 +25,8 @@ void main() {
|
|||
Transform.translate(
|
||||
offset: const Offset(25.0, 25.0),
|
||||
child: const AnnotatedRegion<int>(
|
||||
child: SizedBox(width: 100.0, height: 100.0),
|
||||
value: 1,
|
||||
child: SizedBox(width: 100.0, height: 100.0),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -389,10 +389,10 @@ void main() {
|
|||
width: 100.0,
|
||||
height: 100.0,
|
||||
child: ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Container(
|
||||
color: Colors.blue,
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
@ -835,8 +835,8 @@ void main() {
|
|||
|
||||
await tester.pumpWidget(
|
||||
ClipRect(
|
||||
child: const Placeholder(),
|
||||
clipper: NotifyClipper<Rect>(clip: clip),
|
||||
child: const Placeholder(),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ class TestMultiChildLayoutDelegate extends MultiChildLayoutDelegate {
|
|||
Widget buildFrame(MultiChildLayoutDelegate delegate) {
|
||||
return Center(
|
||||
child: CustomMultiChildLayout(
|
||||
delegate: delegate,
|
||||
children: <Widget>[
|
||||
LayoutId(id: 0, child: const SizedBox(width: 150.0, height: 100.0)),
|
||||
LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)),
|
||||
],
|
||||
delegate: delegate,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -208,20 +208,20 @@ void main() {
|
|||
final TestMultiChildLayoutDelegate delegate = TestMultiChildLayoutDelegate();
|
||||
await tester.pumpWidget(Center(
|
||||
child: CustomMultiChildLayout(
|
||||
delegate: delegate,
|
||||
children: <Widget>[
|
||||
LayoutId(
|
||||
id: 0,
|
||||
child: CustomMultiChildLayout(
|
||||
delegate: delegate,
|
||||
children: <Widget>[
|
||||
LayoutId(id: 0, child: const SizedBox(width: 150.0, height: 100.0)),
|
||||
LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)),
|
||||
],
|
||||
delegate: delegate,
|
||||
),
|
||||
),
|
||||
LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)),
|
||||
],
|
||||
delegate: delegate,
|
||||
),
|
||||
));
|
||||
|
||||
|
@ -276,8 +276,8 @@ void main() {
|
|||
Widget buildSingleChildFrame(MultiChildLayoutDelegate delegate) {
|
||||
return Center(
|
||||
child: CustomMultiChildLayout(
|
||||
children: <Widget>[LayoutId(id: 0, child: const SizedBox())],
|
||||
delegate: delegate,
|
||||
children: <Widget>[LayoutId(id: 0, child: const SizedBox())],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -361,8 +361,8 @@ void main() {
|
|||
await expectFlutterErrorMessage(
|
||||
widget: Center(
|
||||
child: CustomMultiChildLayout(
|
||||
children: <Widget>[LayoutWithMissingId(child: Container(width: 100))],
|
||||
delegate: PreferredSizeDelegate(preferredSize: const Size(10, 10)),
|
||||
children: <Widget>[LayoutWithMissingId(child: Container(width: 100))],
|
||||
),
|
||||
),
|
||||
tester: tester,
|
||||
|
@ -384,12 +384,12 @@ void main() {
|
|||
await expectFlutterErrorMessage(
|
||||
widget: Center(
|
||||
child: CustomMultiChildLayout(
|
||||
delegate: ZeroAndOneIdLayoutDelegate(),
|
||||
children: <Widget>[
|
||||
LayoutId(id: 0, child: Container(width: 100)),
|
||||
LayoutId(id: 1, child: Container(width: 100)),
|
||||
LayoutId(id: 2, child: Container(width: 100)),
|
||||
],
|
||||
delegate: ZeroAndOneIdLayoutDelegate(),
|
||||
),
|
||||
),
|
||||
tester: tester,
|
||||
|
@ -406,13 +406,13 @@ void main() {
|
|||
await expectFlutterErrorMessage(
|
||||
widget: Center(
|
||||
child: CustomMultiChildLayout(
|
||||
delegate: ZeroAndOneIdLayoutDelegate(),
|
||||
children: <Widget>[
|
||||
LayoutId(id: 0, child: Container(width: 100)),
|
||||
LayoutId(id: 1, child: Container(width: 100)),
|
||||
LayoutId(id: 2, child: Container(width: 100)),
|
||||
LayoutId(id: 3, child: Container(width: 100)),
|
||||
],
|
||||
delegate: ZeroAndOneIdLayoutDelegate(),
|
||||
),
|
||||
),
|
||||
tester: tester,
|
||||
|
|
|
@ -125,10 +125,6 @@ void _defineTests() {
|
|||
),
|
||||
),
|
||||
),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
child: const Text('Hello', textDirection: TextDirection.ltr),
|
||||
),
|
||||
foregroundPainter: _PainterWithSemantics(
|
||||
semantics: const CustomPainterSemantics(
|
||||
rect: Rect.fromLTRB(1.0, 1.0, 2.0, 2.0),
|
||||
|
@ -138,6 +134,10 @@ void _defineTests() {
|
|||
),
|
||||
),
|
||||
),
|
||||
child: Semantics(
|
||||
container: true,
|
||||
child: const Text('Hello', textDirection: TextDirection.ltr),
|
||||
),
|
||||
));
|
||||
|
||||
expect(semanticsTester, hasSemantics(
|
||||
|
|
|
@ -58,8 +58,8 @@ void main() {
|
|||
|
||||
await tester.pumpWidget(const AnimatedDefaultTextStyle(
|
||||
style: s1,
|
||||
child: textWidget,
|
||||
duration: Duration(milliseconds: 1000),
|
||||
child: textWidget,
|
||||
));
|
||||
|
||||
final RichText text1 = tester.firstWidget(find.byType(RichText));
|
||||
|
@ -80,8 +80,8 @@ void main() {
|
|||
maxLines: 3,
|
||||
textWidthBasis: TextWidthBasis.longestLine,
|
||||
textHeightBehavior: ui.TextHeightBehavior(applyHeightToFirstAscent: false),
|
||||
child: textWidget,
|
||||
duration: Duration(milliseconds: 1000),
|
||||
child: textWidget,
|
||||
));
|
||||
|
||||
final RichText text2 = tester.firstWidget(find.byType(RichText));
|
||||
|
|
|
@ -23,8 +23,8 @@ void main() {
|
|||
child: Stack(
|
||||
children: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('TapHere'),
|
||||
onPressed: onButtonPressed,
|
||||
child: const Text('TapHere'),
|
||||
),
|
||||
DraggableScrollableSheet(
|
||||
maxChildSize: maxChildSize,
|
||||
|
|
|
@ -244,10 +244,10 @@ void main() {
|
|||
color: Colors.red,
|
||||
),
|
||||
Container(
|
||||
color: Colors.green,
|
||||
child: TextField(
|
||||
controller: textController,
|
||||
),
|
||||
color: Colors.green,
|
||||
),
|
||||
Container(
|
||||
color: Colors.red,
|
||||
|
|
|
@ -729,7 +729,7 @@ void main() {
|
|||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(-3), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(-2), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(-1), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(0), width: 200.0, height: 200.0), key: ValueKey<String>('center')),
|
||||
SliverToBoxAdapter(key: ValueKey<String>('center'), child: SizedBox(key: ValueKey<int>(0), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(1), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(2), width: 200.0, height: 200.0)),
|
||||
SliverToBoxAdapter(child: SizedBox(key: ValueKey<int>(3), width: 200.0, height: 200.0)),
|
||||
|
|
|
@ -481,7 +481,7 @@ void main() {
|
|||
final RenderFittedBox renderObject = tester.allRenderObjects.whereType<RenderFittedBox>().first;
|
||||
expect(renderObject.clipBehavior, equals(Clip.none));
|
||||
|
||||
await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container(), clipBehavior: Clip.antiAlias));
|
||||
await tester.pumpWidget(FittedBox(fit: BoxFit.none, clipBehavior: Clip.antiAlias, child: Container()));
|
||||
expect(renderObject.clipBehavior, equals(Clip.antiAlias));
|
||||
});
|
||||
|
||||
|
|
|
@ -175,10 +175,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
Flow(
|
||||
delegate: OpacityFlowDelegate(opacity),
|
||||
clipBehavior: clip,
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0),
|
||||
],
|
||||
clipBehavior: clip,
|
||||
),
|
||||
);
|
||||
expect(renderObject.clipBehavior, clip);
|
||||
|
@ -204,10 +204,10 @@ void main() {
|
|||
await tester.pumpWidget(
|
||||
Flow.unwrapped(
|
||||
delegate: OpacityFlowDelegate(opacity),
|
||||
clipBehavior: clip,
|
||||
children: const <Widget>[
|
||||
SizedBox(width: 100.0, height: 100.0),
|
||||
],
|
||||
clipBehavior: clip,
|
||||
),
|
||||
);
|
||||
expect(renderObject.clipBehavior, clip);
|
||||
|
|
|
@ -762,8 +762,8 @@ void main() {
|
|||
},
|
||||
),
|
||||
},
|
||||
child: Container(),
|
||||
semantics: _EmptySemanticsGestureDelegate(),
|
||||
child: Container(),
|
||||
));
|
||||
key.currentState!.debugFillProperties(builder);
|
||||
|
||||
|
@ -785,9 +785,9 @@ void main() {
|
|||
await tester.pumpWidget(RawGestureDetector(
|
||||
key: key,
|
||||
gestures: const <Type, GestureRecognizerFactory>{},
|
||||
child: Container(),
|
||||
semantics: _EmptySemanticsGestureDelegate(),
|
||||
excludeFromSemantics: true,
|
||||
child: Container(),
|
||||
));
|
||||
key.currentState!.debugFillProperties(builder);
|
||||
|
||||
|
|
|
@ -632,8 +632,8 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: GridView(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3),
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -684,8 +684,8 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: GridView.count(
|
||||
crossAxisCount: 3,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -699,8 +699,8 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: GridView.extent(
|
||||
maxCrossAxisExtent: 1000,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -148,7 +148,7 @@ class ThreeRoute extends MaterialPageRoute<void> {
|
|||
class MutatingRoute extends MaterialPageRoute<void> {
|
||||
MutatingRoute()
|
||||
: super(builder: (BuildContext context) {
|
||||
return Hero(tag: 'a', child: const Text('MutatingRoute'), key: UniqueKey());
|
||||
return Hero(tag: 'a', key: UniqueKey(), child: const Text('MutatingRoute'));
|
||||
});
|
||||
|
||||
void markNeedsBuild() {
|
||||
|
|
|
@ -406,10 +406,10 @@ class _TestAnimatedContainerWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedContainer(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
width: toggle ? 10 : 20,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -418,11 +418,11 @@ class _TestAnimatedPaddingWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedPadding(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
padding:
|
||||
toggle ? const EdgeInsets.all(8.0) : const EdgeInsets.all(16.0),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -431,10 +431,10 @@ class _TestAnimatedAlignWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedAlign(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
alignment: toggle ? Alignment.topLeft : Alignment.bottomRight,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -443,10 +443,10 @@ class _TestAnimatedPositionedWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedPositioned(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
left: toggle ? 10 : 20,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -455,10 +455,10 @@ class _TestAnimatedPositionedDirectionalWidgetState extends _TestAnimatedWidgetS
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedPositionedDirectional(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
start: toggle ? 10 : 20,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -467,10 +467,10 @@ class _TestAnimatedOpacityWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedOpacity(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
opacity: toggle ? 1.0 : 0.0,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -514,12 +514,12 @@ class _TestAnimatedDefaultTextStyleWidgetState extends _TestAnimatedWidgetState
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedDefaultTextStyle(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
style: toggle
|
||||
? const TextStyle(fontStyle: FontStyle.italic)
|
||||
: const TextStyle(fontStyle: FontStyle.normal),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -528,13 +528,13 @@ class _TestAnimatedPhysicalModelWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedPhysicalModel(
|
||||
child: child,
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
color: toggle ? Colors.red : Colors.green,
|
||||
elevation: 0,
|
||||
shadowColor: Colors.blue,
|
||||
shape: BoxShape.rectangle,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -543,15 +543,15 @@ class _TestTweenAnimationBuilderWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return TweenAnimationBuilder<double>(
|
||||
child: child,
|
||||
tween: Tween<double>(begin: 1, end: 2),
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
child: child,
|
||||
builder: (BuildContext context, double? size, Widget? child) {
|
||||
return SizedBox(
|
||||
child: child,
|
||||
width: size,
|
||||
height: size,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -562,10 +562,10 @@ class _TestAnimatedThemeWidgetState extends _TestAnimatedWidgetState {
|
|||
@override
|
||||
Widget getAnimatedWidget() {
|
||||
return AnimatedTheme(
|
||||
child: child,
|
||||
data: toggle ? ThemeData.dark() : ThemeData.light(),
|
||||
duration: duration,
|
||||
onEnd: widget.callback,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,12 +73,12 @@ void main() {
|
|||
|
||||
expect(log, equals(<TestInherited>[first]));
|
||||
|
||||
final TestInherited second = TestInherited(child: builder, shouldNotify: false);
|
||||
final TestInherited second = TestInherited(shouldNotify: false, child: builder);
|
||||
await tester.pumpWidget(second);
|
||||
|
||||
expect(log, equals(<TestInherited>[first]));
|
||||
|
||||
final TestInherited third = TestInherited(child: builder, shouldNotify: true);
|
||||
final TestInherited third = TestInherited(shouldNotify: true, child: builder);
|
||||
await tester.pumpWidget(third);
|
||||
|
||||
expect(log, equals(<TestInherited>[first, third]));
|
||||
|
|
|
@ -589,8 +589,8 @@ void main() {
|
|||
Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: ListView(
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -36,8 +36,8 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: ListWheelScrollView(
|
||||
itemExtent: 2000.0, // huge extent to trigger clip
|
||||
children: <Widget>[Container()],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container()],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -598,14 +598,14 @@ void main() {
|
|||
return Container(
|
||||
alignment: Alignment.topLeft,
|
||||
child: MouseRegion(
|
||||
onEnter: onEnter,
|
||||
onHover: onHover,
|
||||
onExit: onExit,
|
||||
child: Container(
|
||||
color: const Color.fromARGB(0xff, 0xff, 0x00, 0x00),
|
||||
width: 100.0,
|
||||
height: 100.0,
|
||||
),
|
||||
onEnter: onEnter,
|
||||
onHover: onHover,
|
||||
onExit: onExit,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ void main() {
|
|||
if (opaque == null) {
|
||||
return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, child: child);
|
||||
}
|
||||
return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, child: child, opaque: opaque);
|
||||
return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, opaque: opaque, child: child);
|
||||
}
|
||||
|
||||
return Directionality(
|
||||
|
|
|
@ -16,8 +16,8 @@ void main() {
|
|||
// Opacity 1.0: Semantics and painting
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 1.0,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -37,8 +37,8 @@ void main() {
|
|||
// Opacity 0.0: Nothing
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.0,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -49,9 +49,9 @@ void main() {
|
|||
// Opacity 0.0 with semantics: Just semantics
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.0,
|
||||
alwaysIncludeSemantics: true,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -71,9 +71,9 @@ void main() {
|
|||
// Opacity 0.0 without semantics: Nothing
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.0,
|
||||
alwaysIncludeSemantics: false,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -84,8 +84,8 @@ void main() {
|
|||
// Opacity 0.1: Semantics and painting
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.1,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -105,9 +105,9 @@ void main() {
|
|||
// Opacity 0.1 without semantics: Still has semantics and painting
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.1,
|
||||
alwaysIncludeSemantics: false,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
@ -127,9 +127,9 @@ void main() {
|
|||
// Opacity 0.1 with semantics: Semantics and painting
|
||||
await tester.pumpWidget(
|
||||
const Opacity(
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
opacity: 0.1,
|
||||
alwaysIncludeSemantics: true,
|
||||
child: Text('a', textDirection: TextDirection.rtl),
|
||||
),
|
||||
);
|
||||
expect(semantics, hasSemantics(
|
||||
|
|
|
@ -545,9 +545,9 @@ class TestScrollBehavior1 extends ScrollBehavior {
|
|||
@override
|
||||
Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
|
||||
return GlowingOverscrollIndicator(
|
||||
child: child,
|
||||
axisDirection: details.direction,
|
||||
color: const Color(0xFF00FF00),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -558,9 +558,9 @@ class TestScrollBehavior2 extends ScrollBehavior {
|
|||
@override
|
||||
Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) {
|
||||
return GlowingOverscrollIndicator(
|
||||
child: child,
|
||||
axisDirection: details.direction,
|
||||
color: const Color(0xFF0000FF),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -343,11 +343,11 @@ void main() {
|
|||
|
||||
if (size != null) {
|
||||
return OverflowBox(
|
||||
child: pageView,
|
||||
minWidth: size.width,
|
||||
minHeight: size.height,
|
||||
maxWidth: size.width,
|
||||
maxHeight: size.height,
|
||||
child: pageView,
|
||||
);
|
||||
} else {
|
||||
return pageView;
|
||||
|
@ -699,8 +699,8 @@ void main() {
|
|||
child: SizedBox.fromSize(
|
||||
size: size,
|
||||
child: PageView(
|
||||
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||
controller: controller,
|
||||
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||
onPageChanged: (int page) { },
|
||||
),
|
||||
),
|
||||
|
@ -736,9 +736,8 @@ void main() {
|
|||
return Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: PageView(
|
||||
children:
|
||||
kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||
controller: controller,
|
||||
children: kStates.map<Widget>((String state) => Text(state)).toList(),
|
||||
onPageChanged: (int page) {
|
||||
changeIndex = page;
|
||||
},
|
||||
|
@ -844,8 +843,8 @@ void main() {
|
|||
controller: controller,
|
||||
children: List<Widget>.generate(3, (int i) {
|
||||
return Semantics(
|
||||
child: Text('Page #$i'),
|
||||
container: true,
|
||||
child: Text('Page #$i'),
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
@ -898,8 +897,8 @@ void main() {
|
|||
controller: pageController,
|
||||
children: List<Widget>.generate(3, (int i) {
|
||||
return Semantics(
|
||||
child: Text('Page #$i'),
|
||||
container: true,
|
||||
child: Text('Page #$i'),
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
@ -917,13 +916,13 @@ void main() {
|
|||
textDirection: TextDirection.ltr,
|
||||
child: PageView(
|
||||
controller: controller,
|
||||
allowImplicitScrolling: true,
|
||||
children: List<Widget>.generate(4, (int i) {
|
||||
return Semantics(
|
||||
child: Text('Page #$i'),
|
||||
container: true,
|
||||
child: Text('Page #$i'),
|
||||
);
|
||||
}),
|
||||
allowImplicitScrolling: true,
|
||||
),
|
||||
));
|
||||
expect(controller.page, 0);
|
||||
|
@ -975,8 +974,8 @@ void main() {
|
|||
Directionality(
|
||||
textDirection: TextDirection.ltr,
|
||||
child: PageView(
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
clipBehavior: Clip.antiAlias,
|
||||
children: <Widget>[Container(height: 2000.0)],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -2520,7 +2520,7 @@ void main() {
|
|||
Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
SizedBox(child: platformViewLink, width: 300, height: 300),
|
||||
SizedBox(width: 300, height: 300, child: platformViewLink),
|
||||
Focus(
|
||||
debugLabel: 'container',
|
||||
child: Container(key: containerKey),
|
||||
|
|
|
@ -40,8 +40,8 @@ class _ExpandingBoxState extends State<ExpandingBox> with AutomaticKeepAliveClie
|
|||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: TextButton(
|
||||
child: const Text('Collapse'),
|
||||
onPressed: toggleSize,
|
||||
child: const Text('Collapse'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -418,8 +418,8 @@ void main() {
|
|||
key: ValueKey<int>(items[index]),
|
||||
height: 100,
|
||||
child: ReorderableDragStartListener(
|
||||
child: Text('item ${items[index]}'),
|
||||
index: index,
|
||||
child: Text('item ${items[index]}'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -464,9 +464,9 @@ void main() {
|
|||
key: ValueKey<int>(items[index]),
|
||||
height: 100,
|
||||
child: ReorderableDragStartListener(
|
||||
child: Text('item ${items[index]}'),
|
||||
index: index,
|
||||
enabled: false,
|
||||
child: Text('item ${items[index]}'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -513,8 +513,8 @@ void main() {
|
|||
key: ValueKey<int>(items[index]),
|
||||
height: 100,
|
||||
child: ReorderableDelayedDragStartListener(
|
||||
child: Text('item ${items[index]}'),
|
||||
index: index,
|
||||
child: Text('item ${items[index]}'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -560,9 +560,9 @@ void main() {
|
|||
key: ValueKey<int>(items[index]),
|
||||
height: 100,
|
||||
child: ReorderableDelayedDragStartListener(
|
||||
child: Text('item ${items[index]}'),
|
||||
index: index,
|
||||
enabled: false,
|
||||
child: Text('item ${items[index]}'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
@ -626,6 +626,7 @@ class _TestListState extends State<TestList> {
|
|||
height: 100,
|
||||
color: items[index].isOdd ? Colors.red : Colors.green,
|
||||
child: ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
|
@ -633,7 +634,6 @@ class _TestListState extends State<TestList> {
|
|||
const Icon(Icons.drag_handle),
|
||||
],
|
||||
),
|
||||
index: index,
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1937,9 +1937,9 @@ class _TestDialogRouteWithCustomBarrierCurve<T> extends PopupRoute<T> {
|
|||
@override
|
||||
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
|
||||
return Semantics(
|
||||
child: _child,
|
||||
scopesRoute: true,
|
||||
explicitChildNodes: true,
|
||||
child: _child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@ List<Widget> children(int n) {
|
|||
void main() {
|
||||
testWidgets('Scrolling with list view changes', (WidgetTester tester) async {
|
||||
final ScrollController controller = ScrollController();
|
||||
await tester.pumpWidget(MaterialApp(home: ListView(children: children(30), controller: controller)));
|
||||
await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(30))));
|
||||
final double thirty = controller.position.maxScrollExtent;
|
||||
controller.jumpTo(thirty);
|
||||
await tester.pump();
|
||||
controller.jumpTo(thirty + 100.0); // past the end
|
||||
await tester.pump();
|
||||
await tester.pumpWidget(MaterialApp(home: ListView(children: children(31), controller: controller)));
|
||||
await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(31))));
|
||||
expect(controller.position.pixels, thirty + 200.0); // same distance past the end
|
||||
expect(await tester.pumpAndSettle(), 7); // now it goes ballistic...
|
||||
expect(controller.position.pixels, thirty + 100.0); // and ends up at the end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue