Let Flutter SDK use cupertino_icons 1.0.0 (#65087)
This commit is contained in:
@@ -21,7 +21,7 @@ import 'package:flutter/widgets.dart';
|
||||
/// cupertino_icons: ^1.0.0
|
||||
/// ```
|
||||
///
|
||||
/// For a map of available icons for use, see <http://flutter.github.io/cupertino_icons>
|
||||
/// For a map of available icons for use, see <https://flutter.github.io/cupertino_icons>
|
||||
/// for cupertino_icons version >1.0.0.
|
||||
///
|
||||
/// See <https://github.com/flutter/cupertino_icons/blob/master/map.png> for
|
||||
|
||||
@@ -1379,15 +1379,18 @@ class _BackChevron extends StatelessWidget {
|
||||
|
||||
// Replicate the Icon logic here to get a tightly sized icon and add
|
||||
// custom non-square padding.
|
||||
Widget iconWidget = Text.rich(
|
||||
TextSpan(
|
||||
text: String.fromCharCode(CupertinoIcons.back.codePoint),
|
||||
style: TextStyle(
|
||||
inherit: false,
|
||||
color: textStyle.color,
|
||||
fontSize: 34.0,
|
||||
fontFamily: CupertinoIcons.back.fontFamily,
|
||||
package: CupertinoIcons.back.fontPackage,
|
||||
Widget iconWidget = Padding(
|
||||
padding: const EdgeInsetsDirectional.only(start: 6, end: 2),
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: String.fromCharCode(CupertinoIcons.back.codePoint),
|
||||
style: TextStyle(
|
||||
inherit: false,
|
||||
color: textStyle.color,
|
||||
fontSize: 30.0,
|
||||
fontFamily: CupertinoIcons.back.fontFamily,
|
||||
package: CupertinoIcons.back.fontPackage,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -46,11 +46,11 @@ const Color _kDisabledBackground = CupertinoDynamicColor.withBrightness(
|
||||
darkColor: Color(0xFF050505),
|
||||
);
|
||||
|
||||
// Value inspected from Xcode 11 & iOS 13.0 Simulator.
|
||||
// Value inspected from Xcode 12 & iOS 14.0 Simulator.
|
||||
// Note it may not be consistent with https://developer.apple.com/design/resources/.
|
||||
const CupertinoDynamicColor _kClearButtonColor = CupertinoDynamicColor.withBrightness(
|
||||
color: Color(0xFF636366),
|
||||
darkColor: Color(0xFFAEAEB2),
|
||||
color: Color(0x33000000),
|
||||
darkColor: Color(0x33FFFFFF),
|
||||
);
|
||||
|
||||
// An eyeballed value that moves the cursor slightly left of where it is
|
||||
|
||||
@@ -135,11 +135,11 @@ void main() {
|
||||
// place.
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(337.0234375, 13.5),
|
||||
const Offset(337.1953125, 13.5),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(337.0234375, 13.5),
|
||||
const Offset(337.1953125, 13.5),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -156,11 +156,11 @@ void main() {
|
||||
// Same as LTR but more to the right now.
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(362.9765625, 13.5),
|
||||
const Offset(362.8046875, 13.5),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(362.9765625, 13.5),
|
||||
const Offset(362.8046875, 13.5),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -329,7 +329,7 @@ void main() {
|
||||
expect(bottomMiddle.text.style!.color, const Color(0xff00050a));
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(337.0234375, 13.5),
|
||||
const Offset(337.1953125, 13.5),
|
||||
);
|
||||
|
||||
// The top back label is styled exactly the same way. But the opacity tweens
|
||||
@@ -339,7 +339,7 @@ void main() {
|
||||
expect(topBackLabel.text.style!.color, const Color(0xff00050a));
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(337.0234375, 13.5),
|
||||
const Offset(337.1953125, 13.5),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ void main() {
|
||||
expect(bottomMiddle.text.style!.color, const Color(0xff00050a));
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(362.9765625, 13.5),
|
||||
const Offset(362.8046875, 13.5),
|
||||
);
|
||||
|
||||
// The top back label is styled exactly the same way. But the opacity tweens
|
||||
@@ -384,7 +384,7 @@ void main() {
|
||||
expect(topBackLabel.text.style!.color, const Color(0xff00050a));
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(362.9765625, 13.5),
|
||||
const Offset(362.8046875, 13.5),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -599,12 +599,12 @@ void main() {
|
||||
// Come in from the right and fade in.
|
||||
checkOpacity(tester, backChevron, 0.0);
|
||||
expect(
|
||||
tester.getTopLeft(backChevron), const Offset(73.078125, 5.0));
|
||||
tester.getTopLeft(backChevron), const Offset(86.734375, 7.0));
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
checkOpacity(tester, backChevron, 0.09497911669313908);
|
||||
expect(
|
||||
tester.getTopLeft(backChevron), const Offset(23.260527312755585, 5.0));
|
||||
tester.getTopLeft(backChevron), const Offset(31.055883467197418, 7.0));
|
||||
});
|
||||
|
||||
testWidgets('First appearance of back chevron fades in from the left in RTL', (WidgetTester tester) async {
|
||||
@@ -643,14 +643,14 @@ void main() {
|
||||
checkOpacity(tester, backChevron, 0.0);
|
||||
expect(
|
||||
tester.getTopRight(backChevron),
|
||||
const Offset(692.921875, 5.0),
|
||||
const Offset(687.265625, 7.0),
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
checkOpacity(tester, backChevron, 0.09497911669313908);
|
||||
expect(
|
||||
tester.getTopRight(backChevron),
|
||||
const Offset(742.7394726872444, 5.0),
|
||||
const Offset(742.9441165328026, 7.0),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -670,15 +670,15 @@ void main() {
|
||||
checkOpacity(tester, backChevrons.first, 0.8833301812410355);
|
||||
checkOpacity(tester, backChevrons.last, 0.0);
|
||||
// Both overlap at the same place.
|
||||
expect(tester.getTopLeft(backChevrons.first), const Offset(8.0, 5.0));
|
||||
expect(tester.getTopLeft(backChevrons.last), const Offset(8.0, 5.0));
|
||||
expect(tester.getTopLeft(backChevrons.first), const Offset(14.0, 7.0));
|
||||
expect(tester.getTopLeft(backChevrons.last), const Offset(14.0, 7.0));
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
checkOpacity(tester, backChevrons.first, 0.0);
|
||||
checkOpacity(tester, backChevrons.last, 0.4604858811944723);
|
||||
// Still in the same place.
|
||||
expect(tester.getTopLeft(backChevrons.first), const Offset(8.0, 5.0));
|
||||
expect(tester.getTopLeft(backChevrons.last), const Offset(8.0, 5.0));
|
||||
expect(tester.getTopLeft(backChevrons.first), const Offset(14.0, 7.0));
|
||||
expect(tester.getTopLeft(backChevrons.last), const Offset(14.0, 7.0));
|
||||
});
|
||||
|
||||
testWidgets('Bottom middle just fades if top page has a custom leading', (WidgetTester tester) async {
|
||||
@@ -789,14 +789,14 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Page 1')), 0.6697911769151688);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1'))),
|
||||
const Offset(30.8125, 13.5),
|
||||
const Offset(34.8125, 13.5),
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
checkOpacity(tester, flying(tester, find.text('Page 1')), 0.0);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1'))),
|
||||
const Offset(-262.2321922779083, 13.5),
|
||||
const Offset(-258.2321922779083, 13.5),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -826,7 +826,7 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Page 1')), 0.6697911769151688);
|
||||
expect(
|
||||
tester.getTopRight(flying(tester, find.text('Page 1'))),
|
||||
const Offset(769.1875, 13.5),
|
||||
const Offset(765.1875, 13.5),
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
@@ -834,7 +834,7 @@ void main() {
|
||||
expect(
|
||||
tester.getTopRight(flying(tester, find.text('Page 1'))),
|
||||
// >1000. It's now off the screen.
|
||||
const Offset(1062.2321922779083, 13.5),
|
||||
const Offset(1058.2321922779083, 13.5),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -856,11 +856,11 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Page 1')).last, 0.0);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(17.375, 52.39453125),
|
||||
const Offset(17.546875, 52.39453125),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(17.375, 52.39453125),
|
||||
const Offset(17.546875, 52.39453125),
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
@@ -868,11 +868,11 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Page 1')).last, 0.4604858811944723);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).first),
|
||||
const Offset(40.818575382232666, 22.49655644595623),
|
||||
const Offset(43.92089730501175, 22.49655644595623),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Page 1')).last),
|
||||
const Offset(40.818575382232666, 22.49655644595623),
|
||||
const Offset(43.92089730501175, 22.49655644595623),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -896,11 +896,11 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Back')), 0.0);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('A title too long to fit'))),
|
||||
const Offset(17.375, 52.39453125),
|
||||
const Offset(17.546875, 52.39453125),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Back'))),
|
||||
const Offset(17.375, 52.39453125),
|
||||
const Offset(17.546875, 52.39453125),
|
||||
);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 150));
|
||||
@@ -908,11 +908,11 @@ void main() {
|
||||
checkOpacity(tester, flying(tester, find.text('Back')), 0.4604858811944723);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('A title too long to fit'))),
|
||||
const Offset(40.818575382232666, 22.49655644595623),
|
||||
const Offset(43.92089730501175, 22.49655644595623),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(flying(tester, find.text('Back'))),
|
||||
const Offset(40.818575382232666, 22.49655644595623),
|
||||
const Offset(43.92089730501175, 22.49655644595623),
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -154,8 +154,8 @@ void main() {
|
||||
|
||||
// Also shows the previous page's title next to the back button.
|
||||
expect(find.widgetWithText(CupertinoButton, 'An iPod'), findsOneWidget);
|
||||
// 2 paddings + 1 ahem character at font size 34.0.
|
||||
expect(tester.getTopLeft(find.text('An iPod')).dx, 8.0 + 34.0 + 6.0);
|
||||
// 3 paddings + 1 ahem character at font size 34.0.
|
||||
expect(tester.getTopLeft(find.text('An iPod')).dx, 8.0 + 4.0 + 34.0 + 6.0);
|
||||
});
|
||||
|
||||
testWidgets('Previous title is correct on first transition frame', (WidgetTester tester) async {
|
||||
@@ -261,7 +261,7 @@ void main() {
|
||||
// from An iPod to Back (since An Internet communicator is too long to
|
||||
// fit in the back button).
|
||||
expect(find.widgetWithText(CupertinoButton, 'Back'), findsOneWidget);
|
||||
expect(tester.getTopLeft(find.text('Back')).dx, 8.0 + 34.0 + 6.0);
|
||||
expect(tester.getTopLeft(find.text('Back')).dx, 8.0 + 4.0 + 34.0 + 6.0);
|
||||
});
|
||||
|
||||
testWidgets('Back swipe dismiss interrupted by route push', (WidgetTester tester) async {
|
||||
|
||||
Reference in New Issue
Block a user