@@ -3081,6 +3081,7 @@ void main() {
3081
3081
final RenderObject inkFeatures = tester.allRenderObjects.firstWhere (
3082
3082
(RenderObject object) => object.runtimeType.toString () == '_RenderInkFeatures' ,
3083
3083
);
3084
+
3084
3085
const Rect indicatorRect = Rect .fromLTRB (12.0 , 0.0 , 68.0 , 32.0 );
3085
3086
const Rect includedRect = indicatorRect;
3086
3087
final Rect excludedRect = includedRect.inflate (10 );
@@ -3106,7 +3107,7 @@ void main() {
3106
3107
)
3107
3108
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3108
3109
..rrect (
3109
- rrect: RRect .fromLTRBR (12.0 , 72 .0 , 68.0 , 104 .0 , const Radius .circular (16 )),
3110
+ rrect: RRect .fromLTRBR (12.0 , 0 .0 , 68.0 , 32 .0 , const Radius .circular (16 )),
3110
3111
color: const Color (0xffe8def8 ),
3111
3112
),
3112
3113
);
@@ -3168,7 +3169,7 @@ void main() {
3168
3169
)
3169
3170
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3170
3171
..rrect (
3171
- rrect: RRect .fromLTRBR (12.0 , 58 .0 , 68.0 , 90 .0 , const Radius .circular (16 )),
3172
+ rrect: RRect .fromLTRBR (12.0 , 6 .0 , 68.0 , 38 .0 , const Radius .circular (16 )),
3172
3173
color: const Color (0xffe8def8 ),
3173
3174
),
3174
3175
);
@@ -3234,7 +3235,7 @@ void main() {
3234
3235
)
3235
3236
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3236
3237
..rrect (
3237
- rrect: RRect .fromLTRBR (30.0 , 96 .0 , 86.0 , 128 .0 , const Radius .circular (16 )),
3238
+ rrect: RRect .fromLTRBR (30.0 , 24 .0 , 86.0 , 56 .0 , const Radius .circular (16 )),
3238
3239
color: const Color (0xffe8def8 ),
3239
3240
),
3240
3241
);
@@ -3299,7 +3300,7 @@ void main() {
3299
3300
)
3300
3301
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3301
3302
..rrect (
3302
- rrect: RRect .fromLTRBR (0.0 , 58 .0 , 50.0 , 90 .0 , const Radius .circular (16 )),
3303
+ rrect: RRect .fromLTRBR (0.0 , 6 .0 , 50.0 , 38 .0 , const Radius .circular (16 )),
3303
3304
color: const Color (0xffe8def8 ),
3304
3305
),
3305
3306
);
@@ -3366,7 +3367,7 @@ void main() {
3366
3367
)
3367
3368
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3368
3369
..rrect (
3369
- rrect: RRect .fromLTRBR (140.0 , 96 .0 , 196.0 , 128 .0 , const Radius .circular (16 )),
3370
+ rrect: RRect .fromLTRBR (140.0 , 24 .0 , 196.0 , 56 .0 , const Radius .circular (16 )),
3370
3371
color: const Color (0xffe8def8 ),
3371
3372
),
3372
3373
);
@@ -3406,13 +3407,11 @@ void main() {
3406
3407
);
3407
3408
3408
3409
// Default values from M3 specification.
3410
+ const double railMinWidth = 80.0 ;
3409
3411
const double indicatorHeight = 32.0 ;
3410
3412
const double destinationWidth = 72.0 ;
3411
3413
const double destinationHorizontalPadding = 8.0 ;
3412
3414
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3413
- const double verticalSpacer = 8.0 ;
3414
- const double verticalIconLabelSpacing = 4.0 ;
3415
- const double verticalDestinationSpacing = 12.0 ;
3416
3415
3417
3416
// The navigation rail width is larger than default because of the first destination long label.
3418
3417
final double railWidth = tester.getSize (find.byType (NavigationRail )).width;
@@ -3423,13 +3422,7 @@ void main() {
3423
3422
final Rect indicatorRect = Rect .fromLTRB (indicatorLeft, 0.0 , indicatorRight, indicatorHeight);
3424
3423
final Rect includedRect = indicatorRect;
3425
3424
final Rect excludedRect = includedRect.inflate (10 );
3426
-
3427
- // Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3428
- const double labelHeight = 16 ; // fontSize is 12 and height is 1.3.
3429
- const double destinationHeight =
3430
- indicatorHeight + verticalIconLabelSpacing + labelHeight + verticalDestinationSpacing;
3431
- const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3432
- const double secondIndicatorVerticalOffset = secondDestinationVerticalOffset;
3425
+ const double indicatorHorizontalPadding = (railMinWidth - indicatorWidth) / 2 ; // 12.0
3433
3426
3434
3427
expect (
3435
3428
inkFeatures,
@@ -3453,10 +3446,10 @@ void main() {
3453
3446
..rect (rect: indicatorRect, color: const Color (0x0a6750a4 ))
3454
3447
..rrect (
3455
3448
rrect: RRect .fromLTRBR (
3456
- indicatorLeft ,
3457
- secondIndicatorVerticalOffset ,
3458
- indicatorRight ,
3459
- secondIndicatorVerticalOffset + indicatorHeight,
3449
+ indicatorHorizontalPadding ,
3450
+ 0.0 ,
3451
+ indicatorHorizontalPadding + indicatorWidth ,
3452
+ indicatorHeight,
3460
3453
const Radius .circular (16 ),
3461
3454
),
3462
3455
color: const Color (0xffe8def8 ),
@@ -3509,9 +3502,6 @@ void main() {
3509
3502
const double destinationWidth = 72.0 ;
3510
3503
const double destinationHorizontalPadding = 8.0 ;
3511
3504
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3512
- const double verticalSpacer = 8.0 ;
3513
- const double verticalIconLabelSpacing = 4.0 ;
3514
- const double verticalDestinationSpacing = 12.0 ;
3515
3505
3516
3506
// The navigation rail width is the default one because labels are short.
3517
3507
final double railWidth = tester.getSize (find.byType (NavigationRail )).width;
@@ -3531,13 +3521,8 @@ void main() {
3531
3521
final Rect includedRect = indicatorRect;
3532
3522
final Rect excludedRect = includedRect.inflate (10 );
3533
3523
3534
- // Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3535
- const double labelHeight = 16 ; // fontSize is 12 and height is 1.3.
3536
- const double destinationHeight =
3537
- iconSize + verticalIconLabelSpacing + labelHeight + verticalDestinationSpacing;
3538
- const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3539
- const double indicatorOffset = (iconSize - indicatorHeight) / 2 ;
3540
- const double secondIndicatorVerticalOffset = secondDestinationVerticalOffset + indicatorOffset;
3524
+ // Icon height is greater than indicator height so the indicator has a vertical offset.
3525
+ const double secondIndicatorVerticalOffset = (iconSize - indicatorHeight) / 2 ;
3541
3526
3542
3527
expect (
3543
3528
inkFeatures,
@@ -3616,7 +3601,6 @@ void main() {
3616
3601
const double destinationWidth = 72.0 ;
3617
3602
const double destinationHorizontalPadding = 8.0 ;
3618
3603
const double indicatorWidth = destinationWidth - 2 * destinationHorizontalPadding; // 56.0
3619
- const double verticalSpacer = 8.0 ;
3620
3604
const double verticalDestinationSpacingM3 = 12.0 ;
3621
3605
3622
3606
// The navigation rail width is the default one because labels are short.
@@ -3636,11 +3620,7 @@ void main() {
3636
3620
final Rect excludedRect = includedRect.inflate (10 );
3637
3621
3638
3622
// Compute the vertical position for the selected destination (the one with 'bookmark' icon).
3639
- const double destinationHeight = indicatorHeight + verticalDestinationSpacingM3;
3640
- const double secondDestinationVerticalOffset = verticalSpacer + destinationHeight;
3641
- const double secondIndicatorVerticalOffset =
3642
- secondDestinationVerticalOffset + verticalDestinationSpacingM3 / 2 ;
3643
- const double secondDestinationHorizontalOffset = 800 - railMinExtendedWidth; // RTL.
3623
+ const double secondIndicatorVerticalOffset = verticalDestinationSpacingM3 / 2 ;
3644
3624
3645
3625
expect (
3646
3626
inkFeatures,
@@ -3666,9 +3646,9 @@ void main() {
3666
3646
// Indicator for the selected destination (the one with 'bookmark' icon).
3667
3647
..rrect (
3668
3648
rrect: RRect .fromLTRBR (
3669
- secondDestinationHorizontalOffset + indicatorLeft,
3649
+ indicatorLeft,
3670
3650
secondIndicatorVerticalOffset,
3671
- secondDestinationHorizontalOffset + indicatorRight,
3651
+ indicatorRight,
3672
3652
secondIndicatorVerticalOffset + indicatorHeight,
3673
3653
const Radius .circular (16 ),
3674
3654
),
@@ -6175,8 +6155,8 @@ Widget _buildWidget(Widget child, {bool useMaterial3 = true, bool isRTL = false}
6175
6155
6176
6156
ShapeDecoration ? _getIndicatorDecoration (WidgetTester tester) {
6177
6157
return tester
6178
- .firstWidget <Container >(
6179
- find.descendant (of: find.byType (FadeTransition ), matching: find.byType (Container )),
6158
+ .firstWidget <Ink >(
6159
+ find.descendant (of: find.byType (FadeTransition ), matching: find.byType (Ink )),
6180
6160
)
6181
6161
.decoration
6182
6162
as ShapeDecoration ? ;
0 commit comments