File tree 2 files changed +30
-0
lines changed 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1024,6 +1024,7 @@ class _TabBarState extends State<TabBar> {
1024
1024
} else if (widget.indicatorColor != oldWidget.indicatorColor ||
1025
1025
widget.indicatorWeight != oldWidget.indicatorWeight ||
1026
1026
widget.indicatorSize != oldWidget.indicatorSize ||
1027
+ widget.indicatorPadding != oldWidget.indicatorPadding ||
1027
1028
widget.indicator != oldWidget.indicator) {
1028
1029
_initIndicatorPainter ();
1029
1030
}
Original file line number Diff line number Diff line change @@ -238,6 +238,35 @@ void main() {
238
238
debugResetSemanticsIdCounter ();
239
239
});
240
240
241
+ testWidgets ('indicatorPadding update test' , (WidgetTester tester) async {
242
+ // Regressing test for https://github.com/flutter/flutter/issues/108102
243
+ const Tab tab = Tab (text: 'A' );
244
+ const EdgeInsets indicatorPadding = EdgeInsets .only (left: 7.0 , right: 7.0 );
245
+
246
+ await tester.pumpWidget (boilerplate (
247
+ child: const DefaultTabController (
248
+ length: 1 ,
249
+ child: TabBar (
250
+ tabs: < Tab > [tab],
251
+ indicatorPadding: indicatorPadding,
252
+ ),
253
+ ),
254
+ ));
255
+
256
+ // Change the indicatorPadding
257
+ await tester.pumpWidget (boilerplate (
258
+ child: DefaultTabController (
259
+ length: 1 ,
260
+ child: TabBar (
261
+ tabs: const < Tab > [tab],
262
+ indicatorPadding: indicatorPadding + const EdgeInsets .all (7.0 ),
263
+ ),
264
+ ),
265
+ ), Duration .zero, EnginePhase .build);
266
+
267
+ expect (tester.renderObject (find.byType (CustomPaint )).debugNeedsPaint, true );
268
+ });
269
+
241
270
testWidgets ('Tab sizing - icon' , (WidgetTester tester) async {
242
271
await tester.pumpWidget (
243
272
const MaterialApp (home: Center (child: Material (child: Tab (icon: SizedBox (width: 10.0 , height: 10.0 ))))),
You can’t perform that action at this time.
0 commit comments