@@ -3076,7 +3076,6 @@ void main() {
3076
3076
final RenderObject inkFeatures = tester.allRenderObjects.firstWhere (
3077
3077
(RenderObject object) => object.runtimeType.toString () == '_RenderInkFeatures' ,
3078
3078
);
3079
-
3080
3079
const Rect indicatorRect = Rect .fromLTRB (12.0 , 0.0 , 68.0 , 32.0 );
3081
3080
const Rect includedRect = indicatorRect;
3082
3081
final Rect excludedRect = includedRect.inflate (10 );
@@ -3102,7 +3101,7 @@ void main() {
3102
3101
)
3103
3102
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3104
3103
..rrect (
3105
- rrect: RRect .fromLTRBR (12.0 , 0 .0 , 68.0 , 32 .0 , const Radius .circular (16 )),
3104
+ rrect: RRect .fromLTRBR (12.0 , 72 .0 , 68.0 , 104 .0 , const Radius .circular (16 )),
3106
3105
color: const Color (0xffe8def8 ),
3107
3106
),
3108
3107
);
@@ -3164,7 +3163,7 @@ void main() {
3164
3163
)
3165
3164
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3166
3165
..rrect (
3167
- rrect: RRect .fromLTRBR (12.0 , 6 .0 , 68.0 , 38 .0 , const Radius .circular (16 )),
3166
+ rrect: RRect .fromLTRBR (12.0 , 58 .0 , 68.0 , 90 .0 , const Radius .circular (16 )),
3168
3167
color: const Color (0xffe8def8 ),
3169
3168
),
3170
3169
);
@@ -3230,7 +3229,7 @@ void main() {
3230
3229
)
3231
3230
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3232
3231
..rrect (
3233
- rrect: RRect .fromLTRBR (30.0 , 24 .0 , 86.0 , 56 .0 , const Radius .circular (16 )),
3232
+ rrect: RRect .fromLTRBR (30.0 , 96 .0 , 86.0 , 128 .0 , const Radius .circular (16 )),
3234
3233
color: const Color (0xffe8def8 ),
3235
3234
),
3236
3235
);
@@ -3295,7 +3294,7 @@ void main() {
3295
3294
)
3296
3295
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3297
3296
..rrect (
3298
- rrect: RRect .fromLTRBR (0.0 , 6 .0 , 50.0 , 38 .0 , const Radius .circular (16 )),
3297
+ rrect: RRect .fromLTRBR (0.0 , 58 .0 , 50.0 , 90 .0 , const Radius .circular (16 )),
3299
3298
color: const Color (0xffe8def8 ),
3300
3299
),
3301
3300
);
@@ -3362,7 +3361,7 @@ void main() {
3362
3361
)
3363
3362
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3364
3363
..rrect (
3365
- rrect: RRect .fromLTRBR (140.0 , 24 .0 , 196.0 , 56 .0 , const Radius .circular (16 )),
3364
+ rrect: RRect .fromLTRBR (140.0 , 96 .0 , 196.0 , 128 .0 , const Radius .circular (16 )),
3366
3365
color: const Color (0xffe8def8 ),
3367
3366
),
3368
3367
);
@@ -3402,11 +3401,13 @@ void main() {
3402
3401
);
3403
3402
3404
3403
// Default values from M3 specification.
3405
- const double railMinWidth = 80.0 ;
3406
3404
const double indicatorHeight = 32.0 ;
3407
3405
const double destinationWidth = 72.0 ;
3408
3406
const double destinationHorizontalPadding = 8.0 ;
3409
3407
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3408
+ const double verticalSpacer = 8.0 ;
3409
+ const double verticalIconLabelSpacing = 4.0 ;
3410
+ const double verticalDestinationSpacing = 12.0 ;
3410
3411
3411
3412
// The navigation rail width is larger than default because of the first destination long label.
3412
3413
final double railWidth = tester.getSize (find.byType (NavigationRail )).width;
@@ -3417,7 +3418,13 @@ void main() {
3417
3418
final Rect indicatorRect = Rect .fromLTRB (indicatorLeft, 0.0 , indicatorRight, indicatorHeight);
3418
3419
final Rect includedRect = indicatorRect;
3419
3420
final Rect excludedRect = includedRect.inflate (10 );
3420
- const double indicatorHorizontalPadding = (railMinWidth - indicatorWidth) / 2 ; // 12.0
3421
+
3422
+ // Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3423
+ const double labelHeight = 16 ; // fontSize is 12 and height is 1.3.
3424
+ const double destinationHeight =
3425
+ indicatorHeight + verticalIconLabelSpacing + labelHeight + verticalDestinationSpacing;
3426
+ const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3427
+ const double secondIndicatorVerticalOffset = secondDestinationVerticalOffset;
3421
3428
3422
3429
expect (
3423
3430
inkFeatures,
@@ -3441,10 +3448,10 @@ void main() {
3441
3448
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3442
3449
..rrect (
3443
3450
rrect: RRect .fromLTRBR (
3444
- indicatorHorizontalPadding ,
3445
- 0.0 ,
3446
- indicatorHorizontalPadding + indicatorWidth ,
3447
- indicatorHeight,
3451
+ indicatorLeft ,
3452
+ secondIndicatorVerticalOffset ,
3453
+ indicatorRight ,
3454
+ secondIndicatorVerticalOffset + indicatorHeight,
3448
3455
const Radius .circular (16 ),
3449
3456
),
3450
3457
color: const Color (0xffe8def8 ),
@@ -3497,6 +3504,9 @@ void main() {
3497
3504
const double destinationWidth = 72.0 ;
3498
3505
const double destinationHorizontalPadding = 8.0 ;
3499
3506
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3507
+ const double verticalSpacer = 8.0 ;
3508
+ const double verticalIconLabelSpacing = 4.0 ;
3509
+ const double verticalDestinationSpacing = 12.0 ;
3500
3510
3501
3511
// The navigation rail width is the default one because labels are short.
3502
3512
final double railWidth = tester.getSize (find.byType (NavigationRail )).width;
@@ -3516,8 +3526,13 @@ void main() {
3516
3526
final Rect includedRect = indicatorRect;
3517
3527
final Rect excludedRect = includedRect.inflate (10 );
3518
3528
3519
- // Icon height is greater than indicator height so the indicator has a vertical offset.
3520
- const double secondIndicatorVerticalOffset = (iconSize - indicatorHeight) / 2 ;
3529
+ // Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3530
+ const double labelHeight = 16 ; // fontSize is 12 and height is 1.3.
3531
+ const double destinationHeight =
3532
+ iconSize + verticalIconLabelSpacing + labelHeight + verticalDestinationSpacing;
3533
+ const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3534
+ const double indicatorOffset = (iconSize - indicatorHeight) / 2 ;
3535
+ const double secondIndicatorVerticalOffset = secondDestinationVerticalOffset + indicatorOffset;
3521
3536
3522
3537
expect (
3523
3538
inkFeatures,
@@ -3596,6 +3611,7 @@ void main() {
3596
3611
const double destinationWidth = 72.0 ;
3597
3612
const double destinationHorizontalPadding = 8.0 ;
3598
3613
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3614
+ const double verticalSpacer = 8.0 ;
3599
3615
const double verticalDestinationSpacingM3 = 12.0 ;
3600
3616
3601
3617
// The navigation rail width is the default one because labels are short.
@@ -3615,7 +3631,11 @@ void main() {
3615
3631
final Rect excludedRect = includedRect.inflate (10 );
3616
3632
3617
3633
// Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3618
- const double secondIndicatorVerticalOffset = verticalDestinationSpacingM3 / 2 ;
3634
+ const double destinationHeight = indicatorHeight + verticalDestinationSpacingM3;
3635
+ const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3636
+ const double secondIndicatorVerticalOffset =
3637
+ secondDestinationVerticalOffset + verticalDestinationSpacingM3 / 2 ;
3638
+ const double secondDestinationHorizontalOffset = 800 - railMinExtendedWidth; // RTL.
3619
3639
3620
3640
expect (
3621
3641
inkFeatures,
@@ -3641,9 +3661,9 @@ void main() {
3641
3661
// Indicator for the selected destination (the one with 'bookmark' icon).
3642
3662
..rrect (
3643
3663
rrect: RRect .fromLTRBR (
3644
- indicatorLeft,
3664
+ secondDestinationHorizontalOffset + indicatorLeft,
3645
3665
secondIndicatorVerticalOffset,
3646
- indicatorRight,
3666
+ secondDestinationHorizontalOffset + indicatorRight,
3647
3667
secondIndicatorVerticalOffset + indicatorHeight,
3648
3668
const Radius .circular (16 ),
3649
3669
),
@@ -6150,8 +6170,8 @@ Widget _buildWidget(Widget child, {bool useMaterial3 = true, bool isRTL = false}
6150
6170
6151
6171
ShapeDecoration ? _getIndicatorDecoration (WidgetTester tester) {
6152
6172
return tester
6153
- .firstWidget <Ink >(
6154
- find.descendant (of: find.byType (FadeTransition ), matching: find.byType (Ink )),
6173
+ .firstWidget <Container >(
6174
+ find.descendant (of: find.byType (FadeTransition ), matching: find.byType (Container )),
6155
6175
)
6156
6176
.decoration
6157
6177
as ShapeDecoration ? ;
0 commit comments