Unverified Commit c3b2175a authored by Qun Cheng's avatar Qun Cheng Committed by GitHub

Update golden tests (#128914)

parent c7167765
...@@ -20,6 +20,7 @@ class TextMagnifierExampleApp extends StatelessWidget { ...@@ -20,6 +20,7 @@ class TextMagnifierExampleApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData(useMaterial3: false),
home: Scaffold( home: Scaffold(
body: Padding( body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 48.0), padding: const EdgeInsets.symmetric(horizontal: 48.0),
......
...@@ -20,8 +20,9 @@ void main() { ...@@ -20,8 +20,9 @@ void main() {
testWidgets('gradient matches golden', (WidgetTester tester) async { testWidgets('gradient matches golden', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const MaterialApp( MaterialApp(
home: SizedBox( theme: ThemeData(useMaterial3: false),
home: const SizedBox(
width: 800, width: 800,
height: 600, height: 600,
child: RepaintBoundary( child: RepaintBoundary(
......
...@@ -1183,6 +1183,7 @@ void main() { ...@@ -1183,6 +1183,7 @@ void main() {
testWidgets('Default cupertino dialog golden', (WidgetTester tester) async { testWidgets('Default cupertino dialog golden', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
createAppWithButtonThatLaunchesDialog( createAppWithButtonThatLaunchesDialog(
useMaterial3: false,
dialogBuilder: (BuildContext context) { dialogBuilder: (BuildContext context) {
return MediaQuery( return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 3.0), data: MediaQuery.of(context).copyWith(textScaleFactor: 3.0),
...@@ -1523,8 +1524,10 @@ RenderBox findScrollableActionsSectionRenderBox(WidgetTester tester) { ...@@ -1523,8 +1524,10 @@ RenderBox findScrollableActionsSectionRenderBox(WidgetTester tester) {
Widget createAppWithButtonThatLaunchesDialog({ Widget createAppWithButtonThatLaunchesDialog({
required WidgetBuilder dialogBuilder, required WidgetBuilder dialogBuilder,
bool? useMaterial3,
}) { }) {
return MaterialApp( return MaterialApp(
theme: ThemeData(useMaterial3: useMaterial3),
home: Material( home: Material(
child: Center( child: Center(
child: Builder(builder: (BuildContext context) { child: Builder(builder: (BuildContext context) {
......
...@@ -20,6 +20,7 @@ void main() { ...@@ -20,6 +20,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(useMaterial3: false),
supportedLocales: const <Locale>[ supportedLocales: const <Locale>[
Locale('en', 'US'), Locale('en', 'US'),
Locale('ja'), Locale('ja'),
...@@ -64,6 +65,7 @@ void main() { ...@@ -64,6 +65,7 @@ void main() {
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(useMaterial3: false),
supportedLocales: const <Locale>[ supportedLocales: const <Locale>[
Locale('en', 'US'), Locale('en', 'US'),
Locale('ja'), Locale('ja'),
...@@ -115,6 +117,7 @@ void main() { ...@@ -115,6 +117,7 @@ void main() {
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(useMaterial3: false),
supportedLocales: const <Locale>[ supportedLocales: const <Locale>[
Locale('en', 'US'), Locale('en', 'US'),
Locale('ja'), Locale('ja'),
......
...@@ -16,6 +16,7 @@ void main() { ...@@ -16,6 +16,7 @@ void main() {
testWidgets("BackdropFilter's cull rect does not shrink", (WidgetTester tester) async { testWidgets("BackdropFilter's cull rect does not shrink", (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(useMaterial3: false),
home: Scaffold( home: Scaffold(
body: Stack( body: Stack(
fit: StackFit.expand, fit: StackFit.expand,
...@@ -53,6 +54,7 @@ void main() { ...@@ -53,6 +54,7 @@ void main() {
testWidgets('BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { testWidgets('BackdropFilter blendMode on saveLayer', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: ThemeData(useMaterial3: false),
home: Scaffold( home: Scaffold(
body: Opacity( body: Opacity(
opacity: 0.9, opacity: 0.9,
......
...@@ -18,6 +18,7 @@ class TestPage extends StatelessWidget { ...@@ -18,6 +18,7 @@ class TestPage extends StatelessWidget {
return MaterialApp( return MaterialApp(
title: 'Test', title: 'Test',
theme: ThemeData( theme: ThemeData(
useMaterial3: false,
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
), ),
home: const HomePage(), home: const HomePage(),
......
...@@ -5080,8 +5080,9 @@ void main() { ...@@ -5080,8 +5080,9 @@ void main() {
testWidgets('text selection style 1', (WidgetTester tester) async { testWidgets('text selection style 1', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const MaterialApp( MaterialApp(
home: Material( theme: ThemeData(useMaterial3: false),
home: const Material(
child: Center( child: Center(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...@@ -5132,8 +5133,9 @@ void main() { ...@@ -5132,8 +5133,9 @@ void main() {
testWidgets('text selection style 2', (WidgetTester tester) async { testWidgets('text selection style 2', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const MaterialApp( MaterialApp(
home: Material( theme: ThemeData(useMaterial3: false),
home: const Material(
child: Center( child: Center(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
......
...@@ -788,97 +788,100 @@ void main() { ...@@ -788,97 +788,100 @@ void main() {
testWidgets('Text Inline widget baseline', (WidgetTester tester) async { testWidgets('Text Inline widget baseline', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( Theme(
child: RepaintBoundary( data: ThemeData(useMaterial3: false),
child: Material( child: Center(
child: Directionality( child: RepaintBoundary(
textDirection: TextDirection.ltr, child: Material(
child: Container( child: Directionality(
width: 400.0, textDirection: TextDirection.ltr,
height: 200.0, child: Container(
decoration: const BoxDecoration( width: 400.0,
color: Color(0xff00ff00), height: 200.0,
), decoration: const BoxDecoration(
child: ConstrainedBox( color: Color(0xff00ff00),
constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), ),
child: const Text.rich( child: ConstrainedBox(
TextSpan( constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100),
text: 'C ', child: const Text.rich(
style: TextStyle( TextSpan(
fontSize: 16, text: 'C ',
), style: TextStyle(
children: <InlineSpan>[ fontSize: 16,
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)), children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.baseline, alignment: PlaceholderAlignment.baseline,
baseline: TextBaseline.alphabetic, baseline: TextBaseline.alphabetic,
child: SizedBox( child: Checkbox(value: true, onChanged: null),
width: 50.0, ),
height: 55.0, WidgetSpan(
child: DecoratedBox( child: Checkbox(value: false, onChanged: null),
decoration: BoxDecoration( ),
color: Color(0xffffff00), TextSpan(text: 'He ', style: TextStyle(fontSize: 20)),
), WidgetSpan(
child: Center( alignment: PlaceholderAlignment.baseline,
child:SizedBox( baseline: TextBaseline.alphabetic,
width: 10.0, child: SizedBox(
height: 15.0, width: 50.0,
child: DecoratedBox( height: 55.0,
decoration: BoxDecoration( child: DecoratedBox(
color: Color(0xffff0000), 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!'),
TextSpan(text: 'hello world! seize the day!'), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.baseline,
alignment: PlaceholderAlignment.baseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
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(
WidgetSpan( alignment: PlaceholderAlignment.baseline,
alignment: PlaceholderAlignment.baseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: SizedBox(
child: Checkbox(value: false, onChanged: null), width: 20,
), height: 20,
WidgetSpan( child: Checkbox(value: true, onChanged: null),
alignment: PlaceholderAlignment.baseline, ),
baseline: TextBaseline.alphabetic,
child: SizedBox(
width: 20,
height: 20,
child: Checkbox(value: true, onChanged: null),
), ),
), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.baseline,
alignment: PlaceholderAlignment.baseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
child: Text('embedded'), ),
), WidgetSpan(
TextSpan(text: 'ref'), 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() { ...@@ -895,97 +898,100 @@ void main() {
testWidgets('Text Inline widget aboveBaseline', (WidgetTester tester) async { testWidgets('Text Inline widget aboveBaseline', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( Theme(
child: RepaintBoundary( data: ThemeData(useMaterial3: false),
child: Material( child: Center(
child: Directionality( child: RepaintBoundary(
textDirection: TextDirection.ltr, child: Material(
child: Container( child: Directionality(
width: 400.0, textDirection: TextDirection.ltr,
height: 200.0, child: Container(
decoration: const BoxDecoration( width: 400.0,
color: Color(0xff00ff00), height: 200.0,
), decoration: const BoxDecoration(
child: ConstrainedBox( color: Color(0xff00ff00),
constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), ),
child: const Text.rich( child: ConstrainedBox(
TextSpan( constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100),
text: 'C ', child: const Text.rich(
style: TextStyle( TextSpan(
fontSize: 16, text: 'C ',
), style: TextStyle(
children: <InlineSpan>[ fontSize: 16,
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)), children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.aboveBaseline, alignment: PlaceholderAlignment.aboveBaseline,
baseline: TextBaseline.alphabetic, baseline: TextBaseline.alphabetic,
child: SizedBox( child: Checkbox(value: true, onChanged: null),
width: 50.0, ),
height: 55.0, WidgetSpan(
child: DecoratedBox( child: Checkbox(value: false, onChanged: null),
decoration: BoxDecoration( ),
color: Color(0xffffff00), TextSpan(text: 'He ', style: TextStyle(fontSize: 20)),
), WidgetSpan(
child: Center( alignment: PlaceholderAlignment.aboveBaseline,
child:SizedBox( baseline: TextBaseline.alphabetic,
width: 10.0, child: SizedBox(
height: 15.0, width: 50.0,
child: DecoratedBox( height: 55.0,
decoration: BoxDecoration( child: DecoratedBox(
color: Color(0xffff0000), 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!'),
TextSpan(text: 'hello world! seize the day!'), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.aboveBaseline,
alignment: PlaceholderAlignment.aboveBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
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(
WidgetSpan( alignment: PlaceholderAlignment.aboveBaseline,
alignment: PlaceholderAlignment.aboveBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: SizedBox(
child: Checkbox(value: false, onChanged: null), width: 20,
), height: 20,
WidgetSpan( child: Checkbox(value: true, onChanged: null),
alignment: PlaceholderAlignment.aboveBaseline, ),
baseline: TextBaseline.alphabetic,
child: SizedBox(
width: 20,
height: 20,
child: Checkbox(value: true, onChanged: null),
), ),
), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.aboveBaseline,
alignment: PlaceholderAlignment.aboveBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
child: Text('embedded'), ),
), WidgetSpan(
TextSpan(text: 'ref'), 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() { ...@@ -1002,97 +1008,100 @@ void main() {
testWidgets('Text Inline widget belowBaseline', (WidgetTester tester) async { testWidgets('Text Inline widget belowBaseline', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( Theme(
child: RepaintBoundary( data: ThemeData(useMaterial3: false),
child: Material( child: Center(
child: Directionality( child: RepaintBoundary(
textDirection: TextDirection.ltr, child: Material(
child: Container( child: Directionality(
width: 400.0, textDirection: TextDirection.ltr,
height: 200.0, child: Container(
decoration: const BoxDecoration( width: 400.0,
color: Color(0xff00ff00), height: 200.0,
), decoration: const BoxDecoration(
child: ConstrainedBox( color: Color(0xff00ff00),
constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), ),
child: const Text.rich( child: ConstrainedBox(
TextSpan( constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100),
text: 'C ', child: const Text.rich(
style: TextStyle( TextSpan(
fontSize: 16, text: 'C ',
), style: TextStyle(
children: <InlineSpan>[ fontSize: 16,
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)), children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.belowBaseline, alignment: PlaceholderAlignment.belowBaseline,
baseline: TextBaseline.alphabetic, baseline: TextBaseline.alphabetic,
child: SizedBox( child: Checkbox(value: true, onChanged: null),
width: 50.0, ),
height: 55.0, WidgetSpan(
child: DecoratedBox( child: Checkbox(value: false, onChanged: null),
decoration: BoxDecoration( ),
color: Color(0xffffff00), TextSpan(text: 'He ', style: TextStyle(fontSize: 20)),
), WidgetSpan(
child: Center( alignment: PlaceholderAlignment.belowBaseline,
child:SizedBox( baseline: TextBaseline.alphabetic,
width: 10.0, child: SizedBox(
height: 15.0, width: 50.0,
child: DecoratedBox( height: 55.0,
decoration: BoxDecoration( child: DecoratedBox(
color: Color(0xffff0000), 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!'),
TextSpan(text: 'hello world! seize the day!'), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.belowBaseline,
alignment: PlaceholderAlignment.belowBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
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(
WidgetSpan( alignment: PlaceholderAlignment.belowBaseline,
alignment: PlaceholderAlignment.belowBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: SizedBox(
child: Checkbox(value: false, onChanged: null), width: 20,
), height: 20,
WidgetSpan( child: Checkbox(value: true, onChanged: null),
alignment: PlaceholderAlignment.belowBaseline, ),
baseline: TextBaseline.alphabetic,
child: SizedBox(
width: 20,
height: 20,
child: Checkbox(value: true, onChanged: null),
), ),
), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.belowBaseline,
alignment: PlaceholderAlignment.belowBaseline, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
child: Text('embedded'), ),
), WidgetSpan(
TextSpan(text: 'ref'), 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() { ...@@ -1109,97 +1118,100 @@ void main() {
testWidgets('Text Inline widget top', (WidgetTester tester) async { testWidgets('Text Inline widget top', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( Theme(
child: RepaintBoundary( data: ThemeData(useMaterial3: false),
child: Material( child: Center(
child: Directionality( child: RepaintBoundary(
textDirection: TextDirection.ltr, child: Material(
child: Container( child: Directionality(
width: 400.0, textDirection: TextDirection.ltr,
height: 200.0, child: Container(
decoration: const BoxDecoration( width: 400.0,
color: Color(0xff00ff00), height: 200.0,
), decoration: const BoxDecoration(
child: ConstrainedBox( color: Color(0xff00ff00),
constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), ),
child: const Text.rich( child: ConstrainedBox(
TextSpan( constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100),
text: 'C ', child: const Text.rich(
style: TextStyle( TextSpan(
fontSize: 16, text: 'C ',
), style: TextStyle(
children: <InlineSpan>[ fontSize: 16,
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)), children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.top, alignment: PlaceholderAlignment.top,
baseline: TextBaseline.alphabetic, baseline: TextBaseline.alphabetic,
child: SizedBox( child: Checkbox(value: true, onChanged: null),
width: 50.0, ),
height: 55.0, WidgetSpan(
child: DecoratedBox( child: Checkbox(value: false, onChanged: null),
decoration: BoxDecoration( ),
color: Color(0xffffff00), TextSpan(text: 'He ', style: TextStyle(fontSize: 20)),
), WidgetSpan(
child: Center( alignment: PlaceholderAlignment.top,
child:SizedBox( baseline: TextBaseline.alphabetic,
width: 10.0, child: SizedBox(
height: 15.0, width: 50.0,
child: DecoratedBox( height: 55.0,
decoration: BoxDecoration( child: DecoratedBox(
color: Color(0xffff0000), 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!'),
TextSpan(text: 'hello world! seize the day!'), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.top,
alignment: PlaceholderAlignment.top, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
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(
WidgetSpan( alignment: PlaceholderAlignment.top,
alignment: PlaceholderAlignment.top, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: SizedBox(
child: Checkbox(value: false, onChanged: null), width: 20,
), height: 20,
WidgetSpan( child: Checkbox(value: true, onChanged: null),
alignment: PlaceholderAlignment.top, ),
baseline: TextBaseline.alphabetic,
child: SizedBox(
width: 20,
height: 20,
child: Checkbox(value: true, onChanged: null),
), ),
), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.top,
alignment: PlaceholderAlignment.top, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
child: Text('embedded'), ),
), WidgetSpan(
TextSpan(text: 'ref'), 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() { ...@@ -1216,97 +1228,100 @@ void main() {
testWidgets('Text Inline widget middle', (WidgetTester tester) async { testWidgets('Text Inline widget middle', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( Theme(
child: RepaintBoundary( data: ThemeData(useMaterial3: false),
child: Material( child: Center(
child: Directionality( child: RepaintBoundary(
textDirection: TextDirection.ltr, child: Material(
child: Container( child: Directionality(
width: 400.0, textDirection: TextDirection.ltr,
height: 200.0, child: Container(
decoration: const BoxDecoration( width: 400.0,
color: Color(0xff00ff00), height: 200.0,
), decoration: const BoxDecoration(
child: ConstrainedBox( color: Color(0xff00ff00),
constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), ),
child: const Text.rich( child: ConstrainedBox(
TextSpan( constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100),
text: 'C ', child: const Text.rich(
style: TextStyle( TextSpan(
fontSize: 16, text: 'C ',
), style: TextStyle(
children: <InlineSpan>[ fontSize: 16,
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)), children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
baseline: TextBaseline.alphabetic, baseline: TextBaseline.alphabetic,
child: SizedBox( child: Checkbox(value: true, onChanged: null),
width: 50.0, ),
height: 55.0, WidgetSpan(
child: DecoratedBox( child: Checkbox(value: false, onChanged: null),
decoration: BoxDecoration( ),
color: Color(0xffffff00), TextSpan(text: 'He ', style: TextStyle(fontSize: 20)),
), WidgetSpan(
child: Center( alignment: PlaceholderAlignment.middle,
child:SizedBox( baseline: TextBaseline.alphabetic,
width: 10.0, child: SizedBox(
height: 15.0, width: 50.0,
child: DecoratedBox( height: 55.0,
decoration: BoxDecoration( child: DecoratedBox(
color: Color(0xffff0000), 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!'),
TextSpan(text: 'hello world! seize the day!'), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.middle,
alignment: PlaceholderAlignment.middle, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
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(
WidgetSpan( alignment: PlaceholderAlignment.middle,
alignment: PlaceholderAlignment.middle, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: SizedBox(
child: Checkbox(value: false, onChanged: null), width: 20,
), height: 20,
WidgetSpan( child: Checkbox(value: true, onChanged: null),
alignment: PlaceholderAlignment.middle, ),
baseline: TextBaseline.alphabetic,
child: SizedBox(
width: 20,
height: 20,
child: Checkbox(value: true, onChanged: null),
), ),
), WidgetSpan(
WidgetSpan( alignment: PlaceholderAlignment.middle,
alignment: PlaceholderAlignment.middle, baseline: TextBaseline.alphabetic,
baseline: TextBaseline.alphabetic, child: Checkbox(value: false, onChanged: null),
child: Text('embedded'), ),
), WidgetSpan(
TextSpan(text: 'ref'), 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,
), ),
), ),
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment