mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Enable use_colored_box
lint (#117370)
This commit is contained in:
parent
46bb85376b
commit
81bc54be75
@ -221,7 +221,7 @@ linter:
|
|||||||
- unrelated_type_equality_checks
|
- unrelated_type_equality_checks
|
||||||
- unsafe_html
|
- unsafe_html
|
||||||
- use_build_context_synchronously
|
- use_build_context_synchronously
|
||||||
# - use_colored_box # not yet tested
|
- use_colored_box
|
||||||
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
|
# - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding)
|
||||||
- use_enums
|
- use_enums
|
||||||
- use_full_hex_values_for_flutter_colors
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
@ -524,7 +524,7 @@ class ItemGalleryBox extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(tabName, style: Theme.of(context).textTheme.headlineSmall!.copyWith(color: Colors.white)),
|
child: Text(tabName, style: Theme.of(context).textTheme.headlineSmall!.copyWith(color: Colors.white)),
|
||||||
|
@ -91,7 +91,7 @@ class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProv
|
|||||||
child: addBlur(grid(txt, 17, 5), _blurGroup),
|
child: addBlur(grid(txt, 17, 5), _blurGroup),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child:Row(
|
child:Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -74,9 +74,9 @@ class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with Ti
|
|||||||
),
|
),
|
||||||
getConditionalBackdrop(),
|
getConditionalBackdrop(),
|
||||||
RepaintBoundary(
|
RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child:Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const Text('Include BackdropFilter:'),
|
const Text('Include BackdropFilter:'),
|
||||||
|
@ -88,7 +88,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
|
|||||||
Widget _statusWidget() {
|
Widget _statusWidget() {
|
||||||
assert(_lastTestStatus != _LastTestStatus.pending);
|
assert(_lastTestStatus != _LastTestStatus.pending);
|
||||||
final String? message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
|
final String? message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
|
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
|
||||||
child: Text(
|
child: Text(
|
||||||
message!,
|
message!,
|
||||||
|
@ -520,7 +520,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
|||||||
|
|
||||||
final List<Widget> headings = <Widget>[];
|
final List<Widget> headings = <Widget>[];
|
||||||
for (int index = 0; index < allSections.length; index++) {
|
for (int index = 0; index < allSections.length; index++) {
|
||||||
headings.add(Container(
|
headings.add(ColoredBox(
|
||||||
color: _kAppBackgroundColor,
|
color: _kAppBackgroundColor,
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: _AllSectionsView(
|
child: _AllSectionsView(
|
||||||
|
@ -214,7 +214,7 @@ class Tab1RowItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: CupertinoDynamicColor.resolve(CupertinoColors.systemBackground, context),
|
color: CupertinoDynamicColor.resolve(CupertinoColors.systemBackground, context),
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
|
@ -95,7 +95,7 @@ over water meant for the whole central valley of California? The story will shoc
|
|||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -358,7 +358,7 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
|
|||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
return Container(
|
return ColoredBox(
|
||||||
key: _backdropKey,
|
key: _backdropKey,
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -243,7 +243,7 @@ class _LeaveBehindListItem extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
background: Container(
|
background: ColoredBox(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
@ -251,7 +251,7 @@ class _LeaveBehindListItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
secondaryBackground: Container(
|
secondaryBackground: ColoredBox(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
|
@ -122,7 +122,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
|
|||||||
Widget _statusWidget() {
|
Widget _statusWidget() {
|
||||||
assert(_lastTestStatus != _LastTestStatus.pending);
|
assert(_lastTestStatus != _LastTestStatus.pending);
|
||||||
final String message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError!;
|
final String message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError!;
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
|
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
|
||||||
child: Text(
|
child: Text(
|
||||||
message,
|
message,
|
||||||
|
@ -66,7 +66,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(color: Colors.grey.shade200, child: Options(_model)),
|
ColoredBox(color: Colors.grey.shade200, child: Options(_model)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
@ -508,7 +508,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -577,7 +577,7 @@ class _UnderlinesState extends State<Underlines> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Size size = MediaQuery.of(context).size;
|
final Size size = MediaQuery.of(context).size;
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
@ -680,7 +680,7 @@ class _FallbackState extends State<Fallback> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Size size = MediaQuery.of(context).size;
|
final Size size = MediaQuery.of(context).size;
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -754,7 +754,7 @@ class Bidi extends StatefulWidget {
|
|||||||
class _BidiState extends State<Bidi> {
|
class _BidiState extends State<Bidi> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 20.0),
|
padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 20.0),
|
||||||
@ -862,7 +862,7 @@ class _ZalgoState extends State<Zalgo> with SingleTickerProviderStateMixin {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -988,7 +988,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final Size size = MediaQuery.of(context).size;
|
final Size size = MediaQuery.of(context).size;
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
@ -67,9 +67,9 @@ class ContextMenuExample extends StatelessWidget {
|
|||||||
child: const Text('Delete'),
|
child: const Text('Delete'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.systemYellow,
|
color: CupertinoColors.systemYellow,
|
||||||
child: const FlutterLogo(size: 500.0),
|
child: FlutterLogo(size: 500.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -30,10 +30,10 @@ class DividerExample extends StatelessWidget {
|
|||||||
return Center(
|
return Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
const Expanded(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.amber,
|
color: Colors.amber,
|
||||||
child: const Center(
|
child: Center(
|
||||||
child: Text('Above'),
|
child: Text('Above'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -59,7 +59,7 @@ class DividerExample extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
child: const Center(
|
child: const Center(
|
||||||
child: Text('Below'),
|
child: Text('Below'),
|
||||||
|
@ -42,7 +42,7 @@ class _ReorderableExampleState extends State<ReorderableExample> {
|
|||||||
buildDefaultDragHandles: false,
|
buildDefaultDragHandles: false,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
for (int index = 0; index < _items.length; index++)
|
for (int index = 0; index < _items.length; index++)
|
||||||
Container(
|
ColoredBox(
|
||||||
key: Key('$index'),
|
key: Key('$index'),
|
||||||
color: _items[index].isOdd ? oddItemColor : evenItemColor,
|
color: _items[index].isOdd ? oddItemColor : evenItemColor,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
@ -66,7 +66,7 @@ class _StarBorderExampleState extends State<StarBorderExample> {
|
|||||||
),
|
),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.grey.shade200,
|
color: Colors.grey.shade200,
|
||||||
child: Options(_model),
|
child: Options(_model),
|
||||||
),
|
),
|
||||||
|
@ -49,7 +49,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => _updateSize(),
|
onTap: () => _updateSize(),
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.amberAccent,
|
color: Colors.amberAccent,
|
||||||
child: AnimatedSize(
|
child: AnimatedSize(
|
||||||
curve: Curves.easeIn,
|
curve: Curves.easeIn,
|
||||||
|
@ -34,7 +34,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -69,7 +69,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
onPointerDown: _incrementDown,
|
onPointerDown: _incrementDown,
|
||||||
onPointerMove: _updateLocation,
|
onPointerMove: _updateLocation,
|
||||||
onPointerUp: _incrementUp,
|
onPointerUp: _incrementUp,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.lightBlueAccent,
|
color: Colors.lightBlueAccent,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -67,7 +67,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
onEnter: _incrementEnter,
|
onEnter: _incrementEnter,
|
||||||
onHover: _updateLocation,
|
onHover: _updateLocation,
|
||||||
onExit: _incrementExit,
|
onExit: _incrementExit,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.lightBlueAccent,
|
color: Colors.lightBlueAccent,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -36,7 +36,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Material(
|
return Material(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -125,7 +125,7 @@ class MyStatelessWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: FocusTraversalGroup(
|
child: FocusTraversalGroup(
|
||||||
policy: OrderedTraversalPolicy(),
|
policy: OrderedTraversalPolicy(),
|
||||||
|
@ -47,7 +47,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 200,
|
width: 200,
|
||||||
height: 200,
|
height: 200,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: AnimatedFractionallySizedBox(
|
child: AnimatedFractionallySizedBox(
|
||||||
widthFactor: selected ? 0.25 : 0.75,
|
widthFactor: selected ? 0.25 : 0.75,
|
||||||
@ -55,9 +55,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
alignment: selected ? Alignment.topLeft : Alignment.bottomRight,
|
alignment: selected ? Alignment.topLeft : Alignment.bottomRight,
|
||||||
duration: const Duration(seconds: 1),
|
duration: const Duration(seconds: 1),
|
||||||
curve: Curves.fastOutSlowIn,
|
curve: Curves.fastOutSlowIn,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: const FlutterLogo(size: 75),
|
child: FlutterLogo(size: 75),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -56,9 +56,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||||||
selected = !selected;
|
selected = !selected;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: const Center(child: Text('Tap me')),
|
child: Center(child: Text('Tap me')),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -57,7 +57,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: AlignTransition(
|
child: AlignTransition(
|
||||||
alignment: _animation,
|
alignment: _animation,
|
||||||
|
@ -70,7 +70,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: DecoratedBoxTransition(
|
child: DecoratedBoxTransition(
|
||||||
|
@ -50,7 +50,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: FadeTransition(
|
child: FadeTransition(
|
||||||
opacity: _animation,
|
opacity: _animation,
|
||||||
|
@ -18,8 +18,8 @@ void main() {
|
|||||||
|
|
||||||
expect(find.byType(Divider), findsOneWidget);
|
expect(find.byType(Divider), findsOneWidget);
|
||||||
|
|
||||||
// Divider is positioned horizintally.
|
// Divider is positioned horizontally.
|
||||||
final Offset container = tester.getBottomLeft(find.byType(Container).first);
|
final Offset container = tester.getBottomLeft(find.byType(ColoredBox).first);
|
||||||
expect(container.dy, tester.getTopLeft(find.byType(Divider)).dy);
|
expect(container.dy, tester.getTopLeft(find.byType(Divider)).dy);
|
||||||
|
|
||||||
final Offset subheader = tester.getTopLeft(find.text('Subheader'));
|
final Offset subheader = tester.getTopLeft(find.text('Subheader'));
|
||||||
|
@ -81,9 +81,9 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
|
|||||||
/// final double opacity = (value / 1000).clamp(0, 1);
|
/// final double opacity = (value / 1000).clamp(0, 1);
|
||||||
/// return Opacity(opacity: opacity, child: child);
|
/// return Opacity(opacity: opacity, child: child);
|
||||||
/// },
|
/// },
|
||||||
/// child: Container(
|
/// child: const ColoredBox(
|
||||||
/// color: Colors.red,
|
/// color: Colors.red,
|
||||||
/// child: const Text('Hello, Animation'),
|
/// child: Text('Hello, Animation'),
|
||||||
/// ),
|
/// ),
|
||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
@ -100,9 +100,9 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
|
|||||||
/// opacity: Animation<double>.fromValueListenable(_scrollPosition, transformer: (double value) {
|
/// opacity: Animation<double>.fromValueListenable(_scrollPosition, transformer: (double value) {
|
||||||
/// return (value / 1000).clamp(0, 1);
|
/// return (value / 1000).clamp(0, 1);
|
||||||
/// }),
|
/// }),
|
||||||
/// child: Container(
|
/// child: const ColoredBox(
|
||||||
/// color: Colors.red,
|
/// color: Colors.red,
|
||||||
/// child: const Text('Hello, Animation'),
|
/// child: Text('Hello, Animation'),
|
||||||
/// ),
|
/// ),
|
||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
|
@ -289,7 +289,7 @@ class CupertinoAlertDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: CupertinoDynamicColor.resolve(_kDialogColor, context),
|
color: CupertinoDynamicColor.resolve(_kDialogColor, context),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -555,7 +555,7 @@ class CupertinoActionSheet extends StatelessWidget {
|
|||||||
content.add(Flexible(child: titleSection));
|
content.add(Flexible(child: titleSection));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: CupertinoDynamicColor.resolve(_kActionSheetBackgroundColor, context),
|
color: CupertinoDynamicColor.resolve(_kActionSheetBackgroundColor, context),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -50,7 +50,7 @@ import 'theme_data.dart';
|
|||||||
///
|
///
|
||||||
/// {@tool snippet}
|
/// {@tool snippet}
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.green,
|
/// color: Colors.green,
|
||||||
/// child: Material(
|
/// child: Material(
|
||||||
/// child: CheckboxListTile(
|
/// child: CheckboxListTile(
|
||||||
|
@ -100,9 +100,9 @@ enum ListTileControlAffinity {
|
|||||||
///
|
///
|
||||||
/// {@tool snippet}
|
/// {@tool snippet}
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Container(
|
/// const ColoredBox(
|
||||||
/// color: Colors.green,
|
/// color: Colors.green,
|
||||||
/// child: const Material(
|
/// child: Material(
|
||||||
/// child: ListTile(
|
/// child: ListTile(
|
||||||
/// title: Text('ListTile with red background'),
|
/// title: Text('ListTile with red background'),
|
||||||
/// tileColor: Colors.red,
|
/// tileColor: Colors.red,
|
||||||
|
@ -38,7 +38,7 @@ import 'material_state.dart';
|
|||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return InkWell(
|
/// return InkWell(
|
||||||
/// onFocusChange: updateMaterialState(MaterialState.focused),
|
/// onFocusChange: updateMaterialState(MaterialState.focused),
|
||||||
/// child: Container(
|
/// child: ColoredBox(
|
||||||
/// color: widget.color.resolve(materialStates),
|
/// color: widget.color.resolve(materialStates),
|
||||||
/// child: widget.child,
|
/// child: widget.child,
|
||||||
/// ),
|
/// ),
|
||||||
@ -88,7 +88,7 @@ mixin MaterialStateMixin<T extends StatefulWidget> on State<T> {
|
|||||||
/// class MyWidgetState extends State<MyWidget> with MaterialStateMixin<MyWidget> {
|
/// class MyWidgetState extends State<MyWidget> with MaterialStateMixin<MyWidget> {
|
||||||
/// @override
|
/// @override
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Container(
|
/// return ColoredBox(
|
||||||
/// color: isPressed ? Colors.black : Colors.white,
|
/// color: isPressed ? Colors.black : Colors.white,
|
||||||
/// child: InkWell(
|
/// child: InkWell(
|
||||||
/// onHighlightChanged: updateMaterialState(
|
/// onHighlightChanged: updateMaterialState(
|
||||||
|
@ -574,7 +574,7 @@ class _PopupMenu<T> extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
Widget item = route.items[i];
|
Widget item = route.items[i];
|
||||||
if (route.initialValue != null && route.items[i].represents(route.initialValue)) {
|
if (route.initialValue != null && route.items[i].represents(route.initialValue)) {
|
||||||
item = Container(
|
item = ColoredBox(
|
||||||
color: Theme.of(context).highlightColor,
|
color: Theme.of(context).highlightColor,
|
||||||
child: item,
|
child: item,
|
||||||
);
|
);
|
||||||
|
@ -53,7 +53,7 @@ import 'theme_data.dart';
|
|||||||
///
|
///
|
||||||
/// {@tool snippet}
|
/// {@tool snippet}
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.green,
|
/// color: Colors.green,
|
||||||
/// child: Material(
|
/// child: Material(
|
||||||
/// child: RadioListTile<Meridiem>(
|
/// child: RadioListTile<Meridiem>(
|
||||||
|
@ -57,7 +57,7 @@ enum _SwitchListTileType { material, adaptive }
|
|||||||
///
|
///
|
||||||
/// {@tool snippet}
|
/// {@tool snippet}
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.green,
|
/// color: Colors.green,
|
||||||
/// child: Material(
|
/// child: Material(
|
||||||
/// child: SwitchListTile(
|
/// child: SwitchListTile(
|
||||||
|
@ -1274,7 +1274,7 @@ class PhysicalShape extends SingleChildRenderObjectWidget {
|
|||||||
/// top right corner pinned to its original position.
|
/// top right corner pinned to its original position.
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.black,
|
/// color: Colors.black,
|
||||||
/// child: Transform(
|
/// child: Transform(
|
||||||
/// alignment: Alignment.topRight,
|
/// alignment: Alignment.topRight,
|
||||||
|
@ -501,7 +501,7 @@ abstract class Widget extends DiagnosticableTree {
|
|||||||
///
|
///
|
||||||
/// @override
|
/// @override
|
||||||
/// Widget build(BuildContext context) {
|
/// Widget build(BuildContext context) {
|
||||||
/// return Container(color: color, child: child);
|
/// return ColoredBox(color: color, child: child);
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -68,7 +68,7 @@ import 'viewport.dart';
|
|||||||
/// body: PageView(
|
/// body: PageView(
|
||||||
/// controller: _pageController,
|
/// controller: _pageController,
|
||||||
/// children: <Widget>[
|
/// children: <Widget>[
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.red,
|
/// color: Colors.red,
|
||||||
/// child: Center(
|
/// child: Center(
|
||||||
/// child: ElevatedButton(
|
/// child: ElevatedButton(
|
||||||
@ -85,7 +85,7 @@ import 'viewport.dart';
|
|||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
/// ),
|
/// ),
|
||||||
/// Container(
|
/// ColoredBox(
|
||||||
/// color: Colors.blue,
|
/// color: Colors.blue,
|
||||||
/// child: Center(
|
/// child: Center(
|
||||||
/// child: ElevatedButton(
|
/// child: ElevatedButton(
|
||||||
|
@ -37,9 +37,9 @@ void main() {
|
|||||||
data: const MediaQueryData(),
|
data: const MediaQueryData(),
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.white,
|
color: CupertinoColors.white,
|
||||||
child: const CupertinoActivityIndicator(
|
child: CupertinoActivityIndicator(
|
||||||
animating: false,
|
animating: false,
|
||||||
radius: 35,
|
radius: 35,
|
||||||
),
|
),
|
||||||
@ -60,9 +60,9 @@ void main() {
|
|||||||
data: const MediaQueryData(platformBrightness: Brightness.dark),
|
data: const MediaQueryData(platformBrightness: Brightness.dark),
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.black,
|
color: CupertinoColors.black,
|
||||||
child: const CupertinoActivityIndicator(
|
child: CupertinoActivityIndicator(
|
||||||
animating: false,
|
animating: false,
|
||||||
radius: 35,
|
radius: 35,
|
||||||
),
|
),
|
||||||
@ -84,9 +84,9 @@ void main() {
|
|||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.white,
|
color: CupertinoColors.white,
|
||||||
child: const CupertinoActivityIndicator.partiallyRevealed(
|
child: CupertinoActivityIndicator.partiallyRevealed(
|
||||||
progress: 0,
|
progress: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -106,9 +106,9 @@ void main() {
|
|||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.white,
|
color: CupertinoColors.white,
|
||||||
child: const CupertinoActivityIndicator.partiallyRevealed(
|
child: CupertinoActivityIndicator.partiallyRevealed(
|
||||||
progress: 0.5,
|
progress: 0.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -128,9 +128,9 @@ void main() {
|
|||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.white,
|
color: CupertinoColors.white,
|
||||||
child: const CupertinoActivityIndicator.partiallyRevealed(),
|
child: CupertinoActivityIndicator.partiallyRevealed(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -165,9 +165,9 @@ void main() {
|
|||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
key: key,
|
key: key,
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: CupertinoColors.white,
|
color: CupertinoColors.white,
|
||||||
child: const CupertinoActivityIndicator(
|
child: CupertinoActivityIndicator(
|
||||||
animating: false,
|
animating: false,
|
||||||
color: Color(0xFF5D3FD3),
|
color: Color(0xFF5D3FD3),
|
||||||
radius: 100,
|
radius: 100,
|
||||||
|
@ -52,7 +52,7 @@ void main() {
|
|||||||
final Key outerKey = UniqueKey();
|
final Key outerKey = UniqueKey();
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
key: outerKey,
|
key: outerKey,
|
||||||
color: const Color.fromARGB(255, 0, 255, 179),
|
color: const Color.fromARGB(255, 0, 255, 179),
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
|
@ -208,7 +208,7 @@ Widget buildDropdownWithHint({
|
|||||||
selectedItemBuilder: enableSelectedItemBuilder
|
selectedItemBuilder: enableSelectedItemBuilder
|
||||||
? (BuildContext context) {
|
? (BuildContext context) {
|
||||||
return menuItems.map<Widget>((String item) {
|
return menuItems.map<Widget>((String item) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: const Color(0xff00ff00),
|
color: const Color(0xff00ff00),
|
||||||
child: Text(item),
|
child: Text(item),
|
||||||
);
|
);
|
||||||
|
@ -119,17 +119,18 @@ void main() {
|
|||||||
));
|
));
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: const Color.fromARGB(255, 0, 255, 179),
|
color: const Color.fromARGB(255, 0, 255, 179),
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
home: Center(
|
home: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
key: textField,
|
key: textField,
|
||||||
width: 10,
|
width: 10,
|
||||||
height: 10,
|
height: 10,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Placeholder(),
|
child: const Placeholder(),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,7 @@ class _MyWidgetState extends State<_MyWidget> with MaterialStateMixin {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
key: key,
|
key: key,
|
||||||
color: widget.evaluator(this) ? trueColor : falseColor,
|
color: widget.evaluator(this) ? trueColor : falseColor,
|
||||||
child: _InnerWidget(
|
child: _InnerWidget(
|
||||||
@ -70,18 +70,17 @@ class _MyWidgetState extends State<_MyWidget> with MaterialStateMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
Future<void> verify(WidgetTester tester, Widget widget, StreamController<bool> controller,) async {
|
Future<void> verify(WidgetTester tester, Widget widget, StreamController<bool> controller,) async {
|
||||||
await tester.pumpWidget(MaterialApp(home: Scaffold(body: widget)));
|
await tester.pumpWidget(MaterialApp(home: Scaffold(body: widget)));
|
||||||
// Set the value to True
|
// Set the value to True
|
||||||
controller.sink.add(true);
|
controller.sink.add(true);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(tester.widget<Container>(find.byKey(key)).color, trueColor);
|
expect(tester.widget<ColoredBox>(find.byKey(key)).color, trueColor);
|
||||||
|
|
||||||
// Set the value to False
|
// Set the value to False
|
||||||
controller.sink.add(false);
|
controller.sink.add(false);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(tester.widget<Container>(find.byKey(key)).color, falseColor);
|
expect(tester.widget<ColoredBox>(find.byKey(key)).color, falseColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
testWidgets('MaterialState.pressed is tracked', (WidgetTester tester) async {
|
testWidgets('MaterialState.pressed is tracked', (WidgetTester tester) async {
|
||||||
|
@ -78,7 +78,7 @@ class _NestedTabBarContainer extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -11639,7 +11639,7 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Container(
|
body: ColoredBox(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -1874,7 +1874,7 @@ void main() {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: const MediaQueryData(),
|
data: const MediaQueryData(),
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: const Color(0xFF000000),
|
color: const Color(0xFF000000),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -12,7 +12,7 @@ void main() {
|
|||||||
testWidgets('ImageFiltered avoids repainting child as it animates', (WidgetTester tester) async {
|
testWidgets('ImageFiltered avoids repainting child as it animates', (WidgetTester tester) async {
|
||||||
RenderTestObject.paintCount = 0;
|
RenderTestObject.paintCount = 0;
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: ImageFiltered(
|
child: ImageFiltered(
|
||||||
imageFilter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
imageFilter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
||||||
@ -24,7 +24,7 @@ void main() {
|
|||||||
expect(RenderTestObject.paintCount, 1);
|
expect(RenderTestObject.paintCount, 1);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: ImageFiltered(
|
child: ImageFiltered(
|
||||||
imageFilter: ImageFilter.blur(sigmaX: 6, sigmaY: 6),
|
imageFilter: ImageFilter.blur(sigmaX: 6, sigmaY: 6),
|
||||||
|
@ -12,7 +12,7 @@ void main() {
|
|||||||
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
||||||
final Tween<double> opacityTween = Tween<double>(begin: 0, end: 1);
|
final Tween<double> opacityTween = Tween<double>(begin: 0, end: 1);
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: FadeTransition(
|
child: FadeTransition(
|
||||||
opacity: controller.drive(opacityTween),
|
opacity: controller.drive(opacityTween),
|
||||||
@ -45,7 +45,7 @@ void main() {
|
|||||||
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
||||||
final Tween<double> opacityTween = Tween<double>(begin: 0, end: 0.99); // Layer is dropped at 1
|
final Tween<double> opacityTween = Tween<double>(begin: 0, end: 0.99); // Layer is dropped at 1
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: FadeTransition(
|
child: FadeTransition(
|
||||||
opacity: controller.drive(opacityTween),
|
opacity: controller.drive(opacityTween),
|
||||||
@ -78,7 +78,7 @@ void main() {
|
|||||||
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
final AnimationController controller = AnimationController(vsync: const TestVSync(), duration: const Duration(seconds: 1));
|
||||||
final Tween<double> opacityTween = Tween<double>(begin: 0.99, end: 0);
|
final Tween<double> opacityTween = Tween<double>(begin: 0.99, end: 0);
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: FadeTransition(
|
child: FadeTransition(
|
||||||
opacity: controller.drive(opacityTween),
|
opacity: controller.drive(opacityTween),
|
||||||
|
@ -360,7 +360,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -370,9 +370,9 @@ void main() {
|
|||||||
child: Transform.rotate(
|
child: Transform.rotate(
|
||||||
angle: 1.0, // radians
|
angle: 1.0, // radians
|
||||||
child: ClipRect(
|
child: ClipRect(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -442,7 +442,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -458,9 +458,9 @@ void main() {
|
|||||||
bottomLeft: Radius.elliptical(2.5, 12.0),
|
bottomLeft: Radius.elliptical(2.5, 12.0),
|
||||||
bottomRight: Radius.elliptical(15.0, 6.0),
|
bottomRight: Radius.elliptical(15.0, 6.0),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -491,7 +491,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -501,9 +501,9 @@ void main() {
|
|||||||
child: Transform.rotate(
|
child: Transform.rotate(
|
||||||
angle: 1.0, // radians
|
angle: 1.0, // radians
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -534,7 +534,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -549,9 +549,9 @@ void main() {
|
|||||||
borderRadius: BorderRadius.all(Radius.circular(20.0)),
|
borderRadius: BorderRadius.all(Radius.circular(20.0)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -581,7 +581,7 @@ void main() {
|
|||||||
Center genPhysicalModel(Clip clipBehavior) {
|
Center genPhysicalModel(Clip clipBehavior) {
|
||||||
return Center(
|
return Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -594,7 +594,7 @@ void main() {
|
|||||||
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -645,7 +645,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -657,7 +657,7 @@ void main() {
|
|||||||
child: PhysicalModel(
|
child: PhysicalModel(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -686,7 +686,7 @@ void main() {
|
|||||||
Center genPhysicalShape(Clip clipBehavior) {
|
Center genPhysicalShape(Clip clipBehavior) {
|
||||||
return Center(
|
return Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -703,7 +703,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
@ -752,7 +752,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(100.0),
|
padding: const EdgeInsets.all(100.0),
|
||||||
@ -768,7 +768,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
child: Center(
|
child: Center(
|
||||||
|
@ -45,7 +45,7 @@ void main() {
|
|||||||
builder: (BuildContext context, ScrollController scrollController) {
|
builder: (BuildContext context, ScrollController scrollController) {
|
||||||
return NotificationListener<ScrollNotification>(
|
return NotificationListener<ScrollNotification>(
|
||||||
onNotification: onScrollNotification,
|
onNotification: onScrollNotification,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: containerKey,
|
key: containerKey,
|
||||||
color: const Color(0xFFABCDEF),
|
color: const Color(0xFFABCDEF),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
|
@ -242,7 +242,7 @@ void main() {
|
|||||||
Container(
|
Container(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
),
|
),
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: textController,
|
controller: textController,
|
||||||
|
@ -14578,7 +14578,7 @@ class _CustomTextSelectionToolbar extends StatelessWidget {
|
|||||||
anchorAbove: anchorAbove,
|
anchorAbove: anchorAbove,
|
||||||
anchorBelow: anchorBelow,
|
anchorBelow: anchorBelow,
|
||||||
toolbarBuilder: (BuildContext context, Widget child) {
|
toolbarBuilder: (BuildContext context, Widget child) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.pink,
|
color: Colors.pink,
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
@ -12,7 +12,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Directionality(
|
Directionality(
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: const Color(0xFF00FF00),
|
color: const Color(0xFF00FF00),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -901,7 +901,7 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const SwapKeyWidget(childKey: ValueKey<int>(0)),
|
const SwapKeyWidget(childKey: ValueKey<int>(0)),
|
||||||
Container(key: const ValueKey<int>(1)),
|
Container(key: const ValueKey<int>(1)),
|
||||||
Container(color: Colors.green, child: SizedBox(key: key)),
|
ColoredBox(color: Colors.green, child: SizedBox(key: key)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
await tester.pumpWidget(stack);
|
await tester.pumpWidget(stack);
|
||||||
@ -1234,7 +1234,7 @@ void main() {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(),
|
Container(),
|
||||||
Container(key: GlobalKey()),
|
Container(key: GlobalKey()),
|
||||||
Container(color: Colors.green, child: Container()),
|
ColoredBox(color: Colors.green, child: Container()),
|
||||||
Container(key: GlobalKey()),
|
Container(key: GlobalKey()),
|
||||||
Container(),
|
Container(),
|
||||||
],
|
],
|
||||||
@ -1252,11 +1252,10 @@ void main() {
|
|||||||
'├Container-[GlobalKey#00000]\n'
|
'├Container-[GlobalKey#00000]\n'
|
||||||
'│└LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up1)\n'
|
'│└LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up1)\n'
|
||||||
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up2)\n'
|
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up2)\n'
|
||||||
'├Container(bg: MaterialColor(primary value: Color(0xff4caf50)))\n'
|
'├ColoredBox(color: MaterialColor(primary value: Color(0xff4caf50)), renderObject: _RenderColoredBox#00000 relayoutBoundary=up1)\n'
|
||||||
'│└ColoredBox(color: MaterialColor(primary value: Color(0xff4caf50)), renderObject: _RenderColoredBox#00000 relayoutBoundary=up1)\n'
|
'│└Container\n'
|
||||||
'│ └Container\n'
|
'│ └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up2)\n'
|
||||||
'│ └LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up2)\n'
|
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up3)\n'
|
||||||
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up3)\n'
|
|
||||||
'├Container-[GlobalKey#00000]\n'
|
'├Container-[GlobalKey#00000]\n'
|
||||||
'│└LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up1)\n'
|
'│└LimitedBox(maxWidth: 0.0, maxHeight: 0.0, renderObject: RenderLimitedBox#00000 relayoutBoundary=up1)\n'
|
||||||
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up2)\n'
|
'│ └ConstrainedBox(BoxConstraints(biggest), renderObject: RenderConstrainedBox#00000 relayoutBoundary=up2)\n'
|
||||||
|
@ -78,7 +78,7 @@ void main() {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
log.add(state);
|
log.add(state);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: const Color(0xFF0000FF),
|
color: const Color(0xFF0000FF),
|
||||||
child: Text(state),
|
child: Text(state),
|
||||||
),
|
),
|
||||||
@ -151,7 +151,7 @@ void main() {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
log.add(state);
|
log.add(state);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: const Color(0xFF0000FF),
|
color: const Color(0xFF0000FF),
|
||||||
child: Text(state),
|
child: Text(state),
|
||||||
),
|
),
|
||||||
|
@ -167,7 +167,7 @@ void main() {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
itemExtent: 200.0,
|
itemExtent: 200.0,
|
||||||
children: List<Widget>.generate(20, (int i) {
|
children: List<Widget>.generate(20, (int i) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Text('$i'),
|
child: Text('$i'),
|
||||||
);
|
);
|
||||||
@ -176,7 +176,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final RenderBox box = tester.renderObject<RenderBox>(find.byType(Container).first);
|
final RenderBox box = tester.renderObject<RenderBox>(find.byType(ColoredBox).first);
|
||||||
expect(box.size.height, equals(200.0));
|
expect(box.size.height, equals(200.0));
|
||||||
|
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
@ -446,6 +446,7 @@ void main() {
|
|||||||
key: outerContainerKey,
|
key: outerContainerKey,
|
||||||
child: LookupBoundary(
|
child: LookupBoundary(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Container(
|
child: Container(
|
||||||
key: innerContainerKey,
|
key: innerContainerKey,
|
||||||
@ -963,6 +964,7 @@ void main() {
|
|||||||
testWidgets('is hiding', (WidgetTester tester) async {
|
testWidgets('is hiding', (WidgetTester tester) async {
|
||||||
bool? isHidden;
|
bool? isHidden;
|
||||||
await tester.pumpWidget(Container(
|
await tester.pumpWidget(Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: LookupBoundary(
|
child: LookupBoundary(
|
||||||
child: Builder(
|
child: Builder(
|
||||||
@ -979,9 +981,11 @@ void main() {
|
|||||||
testWidgets('is not hiding entity within boundary', (WidgetTester tester) async {
|
testWidgets('is not hiding entity within boundary', (WidgetTester tester) async {
|
||||||
bool? isHidden;
|
bool? isHidden;
|
||||||
await tester.pumpWidget(Container(
|
await tester.pumpWidget(Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: LookupBoundary(
|
child: LookupBoundary(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -998,6 +1002,7 @@ void main() {
|
|||||||
testWidgets('is not hiding if no boundary exists', (WidgetTester tester) async {
|
testWidgets('is not hiding if no boundary exists', (WidgetTester tester) async {
|
||||||
bool? isHidden;
|
bool? isHidden;
|
||||||
await tester.pumpWidget(Container(
|
await tester.pumpWidget(Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -18,9 +18,9 @@ class FirstWidget extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, '/second');
|
Navigator.pushNamed(context, '/second');
|
||||||
},
|
},
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: const Color(0xFFFFFF00),
|
color: Color(0xFFFFFF00),
|
||||||
child: const Text('X'),
|
child: Text('X'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -37,9 +37,9 @@ class SecondWidgetState extends State<SecondWidget> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => Navigator.pop(context),
|
onTap: () => Navigator.pop(context),
|
||||||
child: Container(
|
child: const ColoredBox(
|
||||||
color: const Color(0xFFFF00FF),
|
color: Color(0xFFFF00FF),
|
||||||
child: const Text('Y'),
|
child: Text('Y'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,9 @@ void main() {
|
|||||||
testWidgets('RenderOpacity avoids repainting and does not drop layer at fully opaque', (WidgetTester tester) async {
|
testWidgets('RenderOpacity avoids repainting and does not drop layer at fully opaque', (WidgetTester tester) async {
|
||||||
RenderTestObject.paintCount = 0;
|
RenderTestObject.paintCount = 0;
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
const ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Opacity(
|
child: Opacity(
|
||||||
opacity: 0.0,
|
opacity: 0.0,
|
||||||
child: TestWidget(),
|
child: TestWidget(),
|
||||||
),
|
),
|
||||||
@ -22,9 +22,9 @@ void main() {
|
|||||||
expect(RenderTestObject.paintCount, 0);
|
expect(RenderTestObject.paintCount, 0);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
const ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Opacity(
|
child: Opacity(
|
||||||
opacity: 0.1,
|
opacity: 0.1,
|
||||||
child: TestWidget(),
|
child: TestWidget(),
|
||||||
),
|
),
|
||||||
@ -34,9 +34,9 @@ void main() {
|
|||||||
expect(RenderTestObject.paintCount, 1);
|
expect(RenderTestObject.paintCount, 1);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
const ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Opacity(
|
child: Opacity(
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
child: TestWidget(),
|
child: TestWidget(),
|
||||||
),
|
),
|
||||||
@ -50,9 +50,9 @@ void main() {
|
|||||||
RenderTestObject.paintCount = 0;
|
RenderTestObject.paintCount = 0;
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
const ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Opacity(
|
child: Opacity(
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
child: TestWidget(),
|
child: TestWidget(),
|
||||||
),
|
),
|
||||||
@ -62,9 +62,9 @@ void main() {
|
|||||||
expect(RenderTestObject.paintCount, 1);
|
expect(RenderTestObject.paintCount, 1);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
const ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: const Opacity(
|
child: Opacity(
|
||||||
opacity: 0.0,
|
opacity: 0.0,
|
||||||
child: TestWidget(),
|
child: TestWidget(),
|
||||||
),
|
),
|
||||||
|
@ -136,9 +136,9 @@ void main() {
|
|||||||
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
||||||
'/': (_) => Scaffold(
|
'/': (_) => Scaffold(
|
||||||
key: containerKey1,
|
key: containerKey1,
|
||||||
body: Container(
|
body: const ColoredBox(
|
||||||
color: const Color(0xff00ffff),
|
color: Color(0xff00ffff),
|
||||||
child: const Hero(
|
child: Hero(
|
||||||
tag: kHeroTag,
|
tag: kHeroTag,
|
||||||
child: Text('Home'),
|
child: Text('Home'),
|
||||||
),
|
),
|
||||||
|
@ -59,11 +59,11 @@ void main() {
|
|||||||
Stack(
|
Stack(
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(key: left),
|
child: StateMarker(key: left),
|
||||||
),
|
),
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(
|
child: StateMarker(
|
||||||
key: right,
|
key: right,
|
||||||
@ -88,14 +88,14 @@ void main() {
|
|||||||
Stack(
|
Stack(
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(
|
child: StateMarker(
|
||||||
key: right,
|
key: right,
|
||||||
child: newGrandchild,
|
child: newGrandchild,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(key: left),
|
child: StateMarker(key: left),
|
||||||
),
|
),
|
||||||
@ -115,7 +115,7 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(
|
child: StateMarker(
|
||||||
key: left,
|
key: left,
|
||||||
@ -183,7 +183,7 @@ void main() {
|
|||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StateMarker(
|
child: StateMarker(
|
||||||
key: left,
|
key: left,
|
||||||
|
@ -108,17 +108,17 @@ void main() {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: StatefulBuilder(
|
child: StatefulBuilder(
|
||||||
builder: (BuildContext context, StateSetter setState) {
|
builder: (BuildContext context, StateSetter setState) {
|
||||||
|
@ -143,7 +143,7 @@ void main() {
|
|||||||
Directionality(
|
Directionality(
|
||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: IntrinsicHeight(
|
child: IntrinsicHeight(
|
||||||
child: RichText(
|
child: RichText(
|
||||||
|
@ -17,7 +17,7 @@ Future<void> pumpTest(WidgetTester tester, TargetPlatform platform) async {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
platform: platform,
|
platform: platform,
|
||||||
),
|
),
|
||||||
home: Container(
|
home: ColoredBox(
|
||||||
color: const Color(0xFF111111),
|
color: const Color(0xFF111111),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
dragStartBehavior: DragStartBehavior.down,
|
dragStartBehavior: DragStartBehavior.down,
|
||||||
|
@ -184,7 +184,7 @@ void main() {
|
|||||||
sliverBox,
|
sliverBox,
|
||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
hasScrollBody: false,
|
hasScrollBody: false,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: key,
|
key: key,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Align(
|
child: Align(
|
||||||
@ -387,7 +387,7 @@ void main() {
|
|||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
hasScrollBody: false,
|
hasScrollBody: false,
|
||||||
fillOverscroll: true,
|
fillOverscroll: true,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: key,
|
key: key,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Align(
|
child: Align(
|
||||||
@ -673,7 +673,7 @@ void main() {
|
|||||||
SliverFillRemaining(
|
SliverFillRemaining(
|
||||||
hasScrollBody: false,
|
hasScrollBody: false,
|
||||||
fillOverscroll: true,
|
fillOverscroll: true,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: key,
|
key: key,
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('SliverFillViewport control test', (WidgetTester tester) async {
|
testWidgets('SliverFillViewport control test', (WidgetTester tester) async {
|
||||||
final List<Widget> children = List<Widget>.generate(20, (int i) {
|
final List<Widget> children = List<Widget>.generate(20, (int i) {
|
||||||
return Container(color: Colors.green, child: Text('$i', textDirection: TextDirection.ltr));
|
return ColoredBox(color: Colors.green, child: Text('$i', textDirection: TextDirection.ltr));
|
||||||
});
|
});
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
@ -25,7 +25,7 @@ void main() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final RenderBox box = tester.renderObject<RenderBox>(find.byType(Container).first);
|
final RenderBox box = tester.renderObject<RenderBox>(find.byType(ColoredBox).first);
|
||||||
expect(box.size.height, equals(600.0));
|
expect(box.size.height, equals(600.0));
|
||||||
|
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
@ -52,7 +52,7 @@ void main() {
|
|||||||
await tester.drag(find.byType(Scrollable), const Offset(0.0, 700.0));
|
await tester.drag(find.byType(Scrollable), const Offset(0.0, 700.0));
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|
||||||
final RenderBox box2 = tester.renderObject<RenderBox>(find.byType(Container).first);
|
final RenderBox box2 = tester.renderObject<RenderBox>(find.byType(ColoredBox).first);
|
||||||
expect(box2.size.height, equals(600.0));
|
expect(box2.size.height, equals(600.0));
|
||||||
|
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.text('0'), findsOneWidget);
|
||||||
|
@ -193,7 +193,7 @@ void main() {
|
|||||||
itemExtent: 100.0,
|
itemExtent: 100.0,
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(BuildContext context, int index) {
|
(BuildContext context, int index) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Text(index.toString()),
|
child: Text(index.toString()),
|
||||||
);
|
);
|
||||||
@ -209,8 +209,8 @@ void main() {
|
|||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|
||||||
// Screen is 600px high. Moved bottom item 500px up. It's now at the top.
|
// Screen is 600px high. Moved bottom item 500px up. It's now at the top.
|
||||||
expect(tester.getTopLeft(find.widgetWithText(Container, '5')).dy, 0.0);
|
expect(tester.getTopLeft(find.widgetWithText(ColoredBox, '5')).dy, 0.0);
|
||||||
expect(tester.getBottomLeft(find.widgetWithText(Container, '10')).dy, 600.0);
|
expect(tester.getBottomLeft(find.widgetWithText(ColoredBox, '10')).dy, 600.0);
|
||||||
|
|
||||||
// Stop returning the first 3 items.
|
// Stop returning the first 3 items.
|
||||||
await tester.pumpWidget(MaterialApp(
|
await tester.pumpWidget(MaterialApp(
|
||||||
@ -222,7 +222,7 @@ void main() {
|
|||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(BuildContext context, int index) {
|
(BuildContext context, int index) {
|
||||||
if (index > 3) {
|
if (index > 3) {
|
||||||
return Container(
|
return ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Text(index.toString()),
|
child: Text(index.toString()),
|
||||||
);
|
);
|
||||||
@ -242,10 +242,10 @@ void main() {
|
|||||||
// Move up by 4 items, meaning item 1 would have been at the top but
|
// Move up by 4 items, meaning item 1 would have been at the top but
|
||||||
// 0 through 3 no longer exist, so item 4, 3 items down, is the first one.
|
// 0 through 3 no longer exist, so item 4, 3 items down, is the first one.
|
||||||
// Item 4 is also shifted to the top.
|
// Item 4 is also shifted to the top.
|
||||||
expect(tester.getTopLeft(find.widgetWithText(Container, '4')).dy, 0.0);
|
expect(tester.getTopLeft(find.widgetWithText(ColoredBox, '4')).dy, 0.0);
|
||||||
|
|
||||||
// Because the screen is still 600px, item 9 is now visible at the bottom instead
|
// Because the screen is still 600px, item 9 is now visible at the bottom instead
|
||||||
// of what's supposed to be item 6 had we not re-shifted.
|
// of what's supposed to be item 6 had we not re-shifted.
|
||||||
expect(tester.getBottomLeft(find.widgetWithText(Container, '9')).dy, 600.0);
|
expect(tester.getBottomLeft(find.widgetWithText(ColoredBox, '9')).dy, 600.0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,9 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('no change', (WidgetTester tester) async {
|
testWidgets('no change', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: TestWidget(
|
child: TestWidget(
|
||||||
persistentState: 1,
|
persistentState: 1,
|
||||||
@ -69,9 +69,9 @@ void main() {
|
|||||||
expect(state.updates, equals(0));
|
expect(state.updates, equals(0));
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: TestWidget(
|
child: TestWidget(
|
||||||
persistentState: 2,
|
persistentState: 2,
|
||||||
@ -90,9 +90,9 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('remove one', (WidgetTester tester) async {
|
testWidgets('remove one', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
child: TestWidget(
|
child: TestWidget(
|
||||||
persistentState: 10,
|
persistentState: 10,
|
||||||
@ -109,7 +109,7 @@ void main() {
|
|||||||
expect(state.updates, equals(0));
|
expect(state.updates, equals(0));
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Container(
|
ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: TestWidget(
|
child: TestWidget(
|
||||||
persistentState: 11,
|
persistentState: 11,
|
||||||
|
@ -536,7 +536,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
RepaintBoundary(
|
RepaintBoundary(
|
||||||
key: repaintBoundaryKey,
|
key: repaintBoundaryKey,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
child: Transform(
|
child: Transform(
|
||||||
transform: mainTransform,
|
transform: mainTransform,
|
||||||
@ -544,7 +544,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: WidgetInspector(
|
child: WidgetInspector(
|
||||||
selectButtonBuilder: null,
|
selectButtonBuilder: null,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -3862,7 +3862,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
Center(
|
Center(
|
||||||
child: RepaintBoundaryWithDebugPaint(
|
child: RepaintBoundaryWithDebugPaint(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: outerContainerKey,
|
key: outerContainerKey,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@ -3881,10 +3881,10 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||||||
bottomLeft: Radius.elliptical(2.5, 12.0),
|
bottomLeft: Radius.elliptical(2.5, 12.0),
|
||||||
bottomRight: Radius.elliptical(15.0, 6.0),
|
bottomRight: Radius.elliptical(15.0, 6.0),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: redContainerKey,
|
key: redContainerKey,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
key: whiteContainerKey,
|
key: whiteContainerKey,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: RepaintBoundary(
|
child: RepaintBoundary(
|
||||||
@ -4166,14 +4166,14 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: const <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: const Text('a'),
|
child: Text('a'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Text('b'),
|
Text('b'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -897,7 +897,7 @@ void main() {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: IntrinsicHeight(
|
child: IntrinsicHeight(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -929,7 +929,7 @@ void main() {
|
|||||||
textDirection: TextDirection.ltr,
|
textDirection: TextDirection.ltr,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: IntrinsicWidth(
|
child: IntrinsicWidth(
|
||||||
child: Container(
|
child: ColoredBox(
|
||||||
color: Colors.green,
|
color: Colors.green,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
direction: Axis.vertical,
|
direction: Axis.vertical,
|
||||||
|
Loading…
Reference in New Issue
Block a user