mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Tiny improvement of RouteSettings display (#114481)
* impl * Update packages/flutter/lib/src/widgets/navigator.dart Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com> * Update navigator_test.dart Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
This commit is contained in:
parent
459391708e
commit
98077617bb
@ -548,7 +548,7 @@ class RouteSettings {
|
||||
final Object? arguments;
|
||||
|
||||
@override
|
||||
String toString() => '${objectRuntimeType(this, 'RouteSettings')}("$name", $arguments)';
|
||||
String toString() => '${objectRuntimeType(this, 'RouteSettings')}(${name == null ? 'none' : '"$name"'}, $arguments)';
|
||||
}
|
||||
|
||||
/// Describes the configuration of a [Route].
|
||||
|
||||
@ -3935,6 +3935,16 @@ void main() {
|
||||
);
|
||||
expect(policy, isA<ReadingOrderTraversalPolicy>());
|
||||
});
|
||||
|
||||
group('RouteSettings.toString', () {
|
||||
test('when name is not null, should have double quote', () {
|
||||
expect(const RouteSettings(name: '/home').toString(), 'RouteSettings("/home", null)');
|
||||
});
|
||||
|
||||
test('when name is null, should not have double quote', () {
|
||||
expect(const RouteSettings().toString(), 'RouteSettings(none, null)');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
typedef AnnouncementCallBack = void Function(Route<dynamic>?);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user