From c3b2175a404ff6364479596c968f4b8cf41cd065 Mon Sep 17 00:00:00 2001 From: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com> Date: Thu, 15 Jun 2023 20:09:43 +0000 Subject: [PATCH] Update golden tests (#128914) --- .../text_magnifier/text_magnifier.0.dart | 1 + .../test/painting/linear_gradient.0_test.dart | 5 +- .../flutter/test/cupertino/dialog_test.dart | 3 + .../test/rendering/localized_fonts_test.dart | 3 + .../test/widgets/backdrop_filter_test.dart | 2 + .../test/widgets/page_route_builder_test.dart | 1 + .../test/widgets/selectable_text_test.dart | 10 +- .../test/widgets/text_golden_test.dart | 825 +++++++++--------- 8 files changed, 439 insertions(+), 411 deletions(-) diff --git a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart index 3aa5f35c5d..9bc068aa13 100644 --- a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart +++ b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart @@ -20,6 +20,7 @@ class TextMagnifierExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( + theme: ThemeData(useMaterial3: false), home: Scaffold( body: Padding( padding: const EdgeInsets.symmetric(horizontal: 48.0), diff --git a/examples/api/test/painting/linear_gradient.0_test.dart b/examples/api/test/painting/linear_gradient.0_test.dart index a3ced8c877..966efcd1e2 100644 --- a/examples/api/test/painting/linear_gradient.0_test.dart +++ b/examples/api/test/painting/linear_gradient.0_test.dart @@ -20,8 +20,9 @@ void main() { testWidgets('gradient matches golden', (WidgetTester tester) async { await tester.pumpWidget( - const MaterialApp( - home: SizedBox( + MaterialApp( + theme: ThemeData(useMaterial3: false), + home: const SizedBox( width: 800, height: 600, child: RepaintBoundary( diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 7f19ba217c..fb906561e8 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -1183,6 +1183,7 @@ void main() { testWidgets('Default cupertino dialog golden', (WidgetTester tester) async { await tester.pumpWidget( createAppWithButtonThatLaunchesDialog( + useMaterial3: false, dialogBuilder: (BuildContext context) { return MediaQuery( data: MediaQuery.of(context).copyWith(textScaleFactor: 3.0), @@ -1523,8 +1524,10 @@ RenderBox findScrollableActionsSectionRenderBox(WidgetTester tester) { Widget createAppWithButtonThatLaunchesDialog({ required WidgetBuilder dialogBuilder, + bool? useMaterial3, }) { return MaterialApp( + theme: ThemeData(useMaterial3: useMaterial3), home: Material( child: Center( child: Builder(builder: (BuildContext context) { diff --git a/packages/flutter/test/rendering/localized_fonts_test.dart b/packages/flutter/test/rendering/localized_fonts_test.dart index b1cbc5eb12..79e9c7cd79 100644 --- a/packages/flutter/test/rendering/localized_fonts_test.dart +++ b/packages/flutter/test/rendering/localized_fonts_test.dart @@ -20,6 +20,7 @@ void main() { await tester.pumpWidget( MaterialApp( + theme: ThemeData(useMaterial3: false), supportedLocales: const [ Locale('en', 'US'), Locale('ja'), @@ -64,6 +65,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( + theme: ThemeData(useMaterial3: false), supportedLocales: const [ Locale('en', 'US'), Locale('ja'), @@ -115,6 +117,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( + theme: ThemeData(useMaterial3: false), supportedLocales: const [ Locale('en', 'US'), Locale('ja'), diff --git a/packages/flutter/test/widgets/backdrop_filter_test.dart b/packages/flutter/test/widgets/backdrop_filter_test.dart index ebc77b1d06..7cafc612e2 100644 --- a/packages/flutter/test/widgets/backdrop_filter_test.dart +++ b/packages/flutter/test/widgets/backdrop_filter_test.dart @@ -16,6 +16,7 @@ void main() { testWidgets("BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( + theme: ThemeData(useMaterial3: false), home: Scaffold( body: Stack( fit: StackFit.expand, @@ -53,6 +54,7 @@ void main() { testWidgets('BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( + theme: ThemeData(useMaterial3: false), home: Scaffold( body: Opacity( opacity: 0.9, diff --git a/packages/flutter/test/widgets/page_route_builder_test.dart b/packages/flutter/test/widgets/page_route_builder_test.dart index 6bf6b7c9b9..9e73e10445 100644 --- a/packages/flutter/test/widgets/page_route_builder_test.dart +++ b/packages/flutter/test/widgets/page_route_builder_test.dart @@ -18,6 +18,7 @@ class TestPage extends StatelessWidget { return MaterialApp( title: 'Test', theme: ThemeData( + useMaterial3: false, primarySwatch: Colors.blue, ), home: const HomePage(), diff --git a/packages/flutter/test/widgets/selectable_text_test.dart b/packages/flutter/test/widgets/selectable_text_test.dart index 137c8553a2..d1fa4ae5fb 100644 --- a/packages/flutter/test/widgets/selectable_text_test.dart +++ b/packages/flutter/test/widgets/selectable_text_test.dart @@ -5080,8 +5080,9 @@ void main() { testWidgets('text selection style 1', (WidgetTester tester) async { await tester.pumpWidget( - const MaterialApp( - home: Material( + MaterialApp( + theme: ThemeData(useMaterial3: false), + home: const Material( child: Center( child: Column( children: [ @@ -5132,8 +5133,9 @@ void main() { testWidgets('text selection style 2', (WidgetTester tester) async { await tester.pumpWidget( - const MaterialApp( - home: Material( + MaterialApp( + theme: ThemeData(useMaterial3: false), + home: const Material( child: Center( child: Column( children: [ diff --git a/packages/flutter/test/widgets/text_golden_test.dart b/packages/flutter/test/widgets/text_golden_test.dart index fe8661d0cd..21856e4994 100644 --- a/packages/flutter/test/widgets/text_golden_test.dart +++ b/packages/flutter/test/widgets/text_golden_test.dart @@ -788,97 +788,100 @@ void main() { testWidgets('Text Inline widget baseline', (WidgetTester tester) async { await tester.pumpWidget( - Center( - child: RepaintBoundary( - child: Material( - child: Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 400.0, - height: 200.0, - decoration: const BoxDecoration( - color: Color(0xff00ff00), - ), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), - child: const Text.rich( - TextSpan( - text: 'C ', - style: TextStyle( - fontSize: 16, - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: true, onChanged: null), + Theme( + data: ThemeData(useMaterial3: false), + child: Center( + child: RepaintBoundary( + child: Material( + child: Directionality( + textDirection: TextDirection.ltr, + child: Container( + width: 400.0, + height: 200.0, + decoration: const BoxDecoration( + color: Color(0xff00ff00), + ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), + child: const Text.rich( + TextSpan( + text: 'C ', + style: TextStyle( + fontSize: 16, ), - WidgetSpan( - child: Checkbox(value: false, onChanged: null), - ), - TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 50.0, - height: 55.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffffff00), - ), - child: Center( - child:SizedBox( - width: 10.0, - height: 15.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffff0000), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: true, onChanged: null), + ), + WidgetSpan( + child: Checkbox(value: false, onChanged: null), + ), + TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 50.0, + height: 55.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffffff00), + ), + child: Center( + child:SizedBox( + width: 10.0, + height: 15.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffff0000), + ), ), ), ), ), ), ), - ), - TextSpan(text: 'hello world! seize the day!'), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + TextSpan(text: 'hello world! seize the day!'), + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.baseline, - baseline: TextBaseline.alphabetic, - child: Text('embedded'), - ), - TextSpan(text: 'ref'), - ], + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), + ), + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), + ), + WidgetSpan( + alignment: PlaceholderAlignment.baseline, + baseline: TextBaseline.alphabetic, + child: Text('embedded'), + ), + TextSpan(text: 'ref'), + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, ), ), ), @@ -895,97 +898,100 @@ void main() { testWidgets('Text Inline widget aboveBaseline', (WidgetTester tester) async { await tester.pumpWidget( - Center( - child: RepaintBoundary( - child: Material( - child: Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 400.0, - height: 200.0, - decoration: const BoxDecoration( - color: Color(0xff00ff00), - ), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), - child: const Text.rich( - TextSpan( - text: 'C ', - style: TextStyle( - fontSize: 16, - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: true, onChanged: null), + Theme( + data: ThemeData(useMaterial3: false), + child: Center( + child: RepaintBoundary( + child: Material( + child: Directionality( + textDirection: TextDirection.ltr, + child: Container( + width: 400.0, + height: 200.0, + decoration: const BoxDecoration( + color: Color(0xff00ff00), + ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), + child: const Text.rich( + TextSpan( + text: 'C ', + style: TextStyle( + fontSize: 16, ), - WidgetSpan( - child: Checkbox(value: false, onChanged: null), - ), - TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 50.0, - height: 55.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffffff00), - ), - child: Center( - child:SizedBox( - width: 10.0, - height: 15.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffff0000), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: true, onChanged: null), + ), + WidgetSpan( + child: Checkbox(value: false, onChanged: null), + ), + TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 50.0, + height: 55.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffffff00), + ), + child: Center( + child:SizedBox( + width: 10.0, + height: 15.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffff0000), + ), ), ), ), ), ), ), - ), - TextSpan(text: 'hello world! seize the day!'), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + TextSpan(text: 'hello world! seize the day!'), + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.aboveBaseline, - baseline: TextBaseline.alphabetic, - child: Text('embedded'), - ), - TextSpan(text: 'ref'), - ], + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), + ), + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), + ), + WidgetSpan( + alignment: PlaceholderAlignment.aboveBaseline, + baseline: TextBaseline.alphabetic, + child: Text('embedded'), + ), + TextSpan(text: 'ref'), + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, ), ), ), @@ -1002,97 +1008,100 @@ void main() { testWidgets('Text Inline widget belowBaseline', (WidgetTester tester) async { await tester.pumpWidget( - Center( - child: RepaintBoundary( - child: Material( - child: Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 400.0, - height: 200.0, - decoration: const BoxDecoration( - color: Color(0xff00ff00), - ), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), - child: const Text.rich( - TextSpan( - text: 'C ', - style: TextStyle( - fontSize: 16, - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: true, onChanged: null), + Theme( + data: ThemeData(useMaterial3: false), + child: Center( + child: RepaintBoundary( + child: Material( + child: Directionality( + textDirection: TextDirection.ltr, + child: Container( + width: 400.0, + height: 200.0, + decoration: const BoxDecoration( + color: Color(0xff00ff00), + ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), + child: const Text.rich( + TextSpan( + text: 'C ', + style: TextStyle( + fontSize: 16, ), - WidgetSpan( - child: Checkbox(value: false, onChanged: null), - ), - TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 50.0, - height: 55.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffffff00), - ), - child: Center( - child:SizedBox( - width: 10.0, - height: 15.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffff0000), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: true, onChanged: null), + ), + WidgetSpan( + child: Checkbox(value: false, onChanged: null), + ), + TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 50.0, + height: 55.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffffff00), + ), + child: Center( + child:SizedBox( + width: 10.0, + height: 15.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffff0000), + ), ), ), ), ), ), ), - ), - TextSpan(text: 'hello world! seize the day!'), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + TextSpan(text: 'hello world! seize the day!'), + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.belowBaseline, - baseline: TextBaseline.alphabetic, - child: Text('embedded'), - ), - TextSpan(text: 'ref'), - ], + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), + ), + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), + ), + WidgetSpan( + alignment: PlaceholderAlignment.belowBaseline, + baseline: TextBaseline.alphabetic, + child: Text('embedded'), + ), + TextSpan(text: 'ref'), + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, ), ), ), @@ -1109,97 +1118,100 @@ void main() { testWidgets('Text Inline widget top', (WidgetTester tester) async { await tester.pumpWidget( - Center( - child: RepaintBoundary( - child: Material( - child: Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 400.0, - height: 200.0, - decoration: const BoxDecoration( - color: Color(0xff00ff00), - ), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), - child: const Text.rich( - TextSpan( - text: 'C ', - style: TextStyle( - fontSize: 16, - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: true, onChanged: null), + Theme( + data: ThemeData(useMaterial3: false), + child: Center( + child: RepaintBoundary( + child: Material( + child: Directionality( + textDirection: TextDirection.ltr, + child: Container( + width: 400.0, + height: 200.0, + decoration: const BoxDecoration( + color: Color(0xff00ff00), + ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), + child: const Text.rich( + TextSpan( + text: 'C ', + style: TextStyle( + fontSize: 16, ), - WidgetSpan( - child: Checkbox(value: false, onChanged: null), - ), - TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 50.0, - height: 55.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffffff00), - ), - child: Center( - child:SizedBox( - width: 10.0, - height: 15.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffff0000), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: true, onChanged: null), + ), + WidgetSpan( + child: Checkbox(value: false, onChanged: null), + ), + TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 50.0, + height: 55.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffffff00), + ), + child: Center( + child:SizedBox( + width: 10.0, + height: 15.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffff0000), + ), ), ), ), ), ), ), - ), - TextSpan(text: 'hello world! seize the day!'), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + TextSpan(text: 'hello world! seize the day!'), + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.top, - baseline: TextBaseline.alphabetic, - child: Text('embedded'), - ), - TextSpan(text: 'ref'), - ], + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), + ), + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), + ), + WidgetSpan( + alignment: PlaceholderAlignment.top, + baseline: TextBaseline.alphabetic, + child: Text('embedded'), + ), + TextSpan(text: 'ref'), + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, ), ), ), @@ -1216,97 +1228,100 @@ void main() { testWidgets('Text Inline widget middle', (WidgetTester tester) async { await tester.pumpWidget( - Center( - child: RepaintBoundary( - child: Material( - child: Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 400.0, - height: 200.0, - decoration: const BoxDecoration( - color: Color(0xff00ff00), - ), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), - child: const Text.rich( - TextSpan( - text: 'C ', - style: TextStyle( - fontSize: 16, - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: true, onChanged: null), + Theme( + data: ThemeData(useMaterial3: false), + child: Center( + child: RepaintBoundary( + child: Material( + child: Directionality( + textDirection: TextDirection.ltr, + child: Container( + width: 400.0, + height: 200.0, + decoration: const BoxDecoration( + color: Color(0xff00ff00), + ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), + child: const Text.rich( + TextSpan( + text: 'C ', + style: TextStyle( + fontSize: 16, ), - WidgetSpan( - child: Checkbox(value: false, onChanged: null), - ), - TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 50.0, - height: 55.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffffff00), - ), - child: Center( - child:SizedBox( - width: 10.0, - height: 15.0, - child: DecoratedBox( - decoration: BoxDecoration( - color: Color(0xffff0000), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: true, onChanged: null), + ), + WidgetSpan( + child: Checkbox(value: false, onChanged: null), + ), + TextSpan(text: 'He ', style: TextStyle(fontSize: 20)), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 50.0, + height: 55.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffffff00), + ), + child: Center( + child:SizedBox( + width: 10.0, + height: 15.0, + child: DecoratedBox( + decoration: BoxDecoration( + color: Color(0xffff0000), + ), ), ), ), ), ), ), - ), - TextSpan(text: 'hello world! seize the day!'), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + TextSpan(text: 'hello world! seize the day!'), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: Checkbox(value: false, onChanged: null), - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: SizedBox( - width: 20, - height: 20, - child: Checkbox(value: true, onChanged: null), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), ), - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - baseline: TextBaseline.alphabetic, - child: Text('embedded'), - ), - TextSpan(text: 'ref'), - ], + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: Checkbox(value: false, onChanged: null), + ), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: SizedBox( + width: 20, + height: 20, + child: Checkbox(value: true, onChanged: null), + ), + ), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + baseline: TextBaseline.alphabetic, + child: Text('embedded'), + ), + TextSpan(text: 'ref'), + ], + ), + textDirection: TextDirection.ltr, ), - textDirection: TextDirection.ltr, ), ), ),