Unverified Commit e42c50cf authored by xster's avatar xster Committed by GitHub

Post libtxt/post iOS 11 fidelity fine tuning (#17366)

parent c2c64a5a
e3f3b6766b18e2461c89a371be6e30045d8e404f ed07132380cd2db6dd664be1479c5b89579e3304
...@@ -73,7 +73,7 @@ class _CupertinoDialogDemoState extends State<CupertinoDialogDemo> { ...@@ -73,7 +73,7 @@ class _CupertinoDialogDemoState extends State<CupertinoDialogDemo> {
showDemoDialog<String>( showDemoDialog<String>(
context: context, context: context,
child: new CupertinoAlertDialog( child: new CupertinoAlertDialog(
title: const Text('Allow "Maps" to access your location while you use the app?'), title: const Text('Allow "Maps" to access your location while you are using the app?'),
content: const Text( content: const Text(
'Your current location will be displayed on the map and used for directions, ' 'Your current location will be displayed on the map and used for directions, '
'nearby search results, and estimated travel times.' 'nearby search results, and estimated travel times.'
......
...@@ -453,7 +453,7 @@ class Tab2Header extends StatelessWidget { ...@@ -453,7 +453,7 @@ class Tab2Header extends StatelessWidget {
'SUPPORT TICKET', 'SUPPORT TICKET',
style: const TextStyle( style: const TextStyle(
color: const Color(0xFF646464), color: const Color(0xFF646464),
letterSpacing: -0.8, letterSpacing: -0.9,
fontSize: 14.0, fontSize: 14.0,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
...@@ -484,8 +484,8 @@ class Tab2Header extends StatelessWidget { ...@@ -484,8 +484,8 @@ class Tab2Header extends StatelessWidget {
'Product or product packaging damaged during transit', 'Product or product packaging damaged during transit',
style: const TextStyle( style: const TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w700,
letterSpacing: -0.6, letterSpacing: -0.46,
), ),
), ),
const Padding(padding: const EdgeInsets.only(top: 16.0)), const Padding(padding: const EdgeInsets.only(top: 16.0)),
...@@ -577,10 +577,8 @@ class Tab2ConversationBubble extends StatelessWidget { ...@@ -577,10 +577,8 @@ class Tab2ConversationBubble extends StatelessWidget {
? CupertinoColors.white ? CupertinoColors.white
: CupertinoColors.black, : CupertinoColors.black,
letterSpacing: -0.4, letterSpacing: -0.4,
fontSize: 14.0, fontSize: 15.0,
fontWeight: color == Tab2ConversationBubbleColor.blue fontWeight: FontWeight.w400,
? FontWeight.w300
: FontWeight.w400,
), ),
), ),
); );
......
...@@ -183,7 +183,7 @@ class _ListItem extends StatelessWidget { ...@@ -183,7 +183,7 @@ class _ListItem extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.41, letterSpacing: -0.18,
), ),
), ),
new Text( new Text(
......
...@@ -122,8 +122,8 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -122,8 +122,8 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget {
style: new TextStyle( style: new TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
fontSize: 10.0, fontSize: 10.0,
letterSpacing: -0.24, letterSpacing: 0.1,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w400,
color: inactiveColor, color: inactiveColor,
), ),
child: new Padding( child: new Padding(
......
...@@ -15,8 +15,9 @@ const Color _kDisabledForeground = const Color(0xFFC4C4C4); ...@@ -15,8 +15,9 @@ const Color _kDisabledForeground = const Color(0xFFC4C4C4);
const TextStyle _kButtonTextStyle = const TextStyle( const TextStyle _kButtonTextStyle = const TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
inherit: false, inherit: false,
fontSize: 15.0, fontSize: 17.5,
fontWeight: FontWeight.normal, letterSpacing: -0.24,
fontWeight: FontWeight.w400,
color: CupertinoColors.activeBlue, color: CupertinoColors.activeBlue,
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
); );
...@@ -31,7 +32,7 @@ final TextStyle _kBackgroundButtonTextStyle = _kButtonTextStyle.copyWith( ...@@ -31,7 +32,7 @@ final TextStyle _kBackgroundButtonTextStyle = _kButtonTextStyle.copyWith(
const EdgeInsets _kButtonPadding = const EdgeInsets.all(16.0); const EdgeInsets _kButtonPadding = const EdgeInsets.all(16.0);
const EdgeInsets _kBackgroundButtonPadding = const EdgeInsets.symmetric( const EdgeInsets _kBackgroundButtonPadding = const EdgeInsets.symmetric(
vertical: 16.0, vertical: 14.0,
horizontal: 64.0, horizontal: 64.0,
); );
......
...@@ -13,20 +13,21 @@ import 'scrollbar.dart'; ...@@ -13,20 +13,21 @@ import 'scrollbar.dart';
const TextStyle _kCupertinoDialogTitleStyle = const TextStyle( const TextStyle _kCupertinoDialogTitleStyle = const TextStyle(
fontFamily: '.SF UI Display', fontFamily: '.SF UI Display',
inherit: false, inherit: false,
fontSize: 17.5, fontSize: 18.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
color: CupertinoColors.black, color: CupertinoColors.black,
height: 1.25, height: 1.06,
letterSpacing: 0.48,
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
); );
const TextStyle _kCupertinoDialogContentStyle = const TextStyle( const TextStyle _kCupertinoDialogContentStyle = const TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
inherit: false, inherit: false,
fontSize: 12.4, fontSize: 13.4,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w300,
color: CupertinoColors.black, color: CupertinoColors.black,
height: 1.35, height: 1.036,
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
); );
......
...@@ -49,7 +49,7 @@ const TextStyle _kLargeTitleTextStyle = const TextStyle( ...@@ -49,7 +49,7 @@ const TextStyle _kLargeTitleTextStyle = const TextStyle(
fontFamily: '.SF UI Text', fontFamily: '.SF UI Text',
fontSize: 34.0, fontSize: 34.0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -1.4, letterSpacing: -0.26,
color: CupertinoColors.black, color: CupertinoColors.black,
); );
...@@ -375,7 +375,7 @@ class _CupertinoPersistentNavigationBar extends StatelessWidget implements Prefe ...@@ -375,7 +375,7 @@ class _CupertinoPersistentNavigationBar extends StatelessWidget implements Prefe
final Widget styledMiddle = middle == null ? null : new DefaultTextStyle( final Widget styledMiddle = middle == null ? null : new DefaultTextStyle(
style: actionsStyle.copyWith( style: actionsStyle.copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.72, letterSpacing: -0.08,
color: CupertinoColors.black, color: CupertinoColors.black,
), ),
child: middle, child: middle,
......
...@@ -153,7 +153,7 @@ void main() { ...@@ -153,7 +153,7 @@ void main() {
expect(tester.getSize(find.byType(DecoratedBox).at(1)), equals(const Size(270.0, 560.0))); expect(tester.getSize(find.byType(DecoratedBox).at(1)), equals(const Size(270.0, 560.0)));
// Check sizes/locations of the text. // Check sizes/locations of the text.
expect(tester.getSize(find.text('The Title')), equals(const Size(230.0, 198.0))); expect(tester.getSize(find.text('The Title')), equals(const Size(230.0, 171.0)));
expect(tester.getSize(find.text('Cancel')), equals(const Size(75.0, 300.0))); expect(tester.getSize(find.text('Cancel')), equals(const Size(75.0, 300.0)));
expect(tester.getSize(find.text('OK')), equals(const Size(75.0, 100.0))); expect(tester.getSize(find.text('OK')), equals(const Size(75.0, 100.0)));
expect(tester.getTopLeft(find.text('The Title')), equals(const Offset(285.0, 40.0))); expect(tester.getTopLeft(find.text('The Title')), equals(const Offset(285.0, 40.0)));
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart' hide TypeMatcher; import 'package:flutter_test/flutter_test.dart' hide TypeMatcher;
...@@ -81,7 +83,7 @@ void main() { ...@@ -81,7 +83,7 @@ void main() {
builder: (BuildContext context) { builder: (BuildContext context) {
return const CupertinoNavigationBar( return const CupertinoNavigationBar(
leading: const _ExpectStyles(color: const Color(0xFF001122), index: 0x000001), leading: const _ExpectStyles(color: const Color(0xFF001122), index: 0x000001),
middle: const _ExpectStyles(color: const Color(0xFF000000), letterSpacing: -0.72, index: 0x000100), middle: const _ExpectStyles(color: const Color(0xFF000000), letterSpacing: -0.08, index: 0x000100),
trailing: const _ExpectStyles(color: const Color(0xFF001122), index: 0x010000), trailing: const _ExpectStyles(color: const Color(0xFF001122), index: 0x010000),
actionsForegroundColor: const Color(0xFF001122), actionsForegroundColor: const Color(0xFF001122),
); );
...@@ -481,6 +483,80 @@ void main() { ...@@ -481,6 +483,80 @@ void main() {
final BoxDecoration decoration = decoratedBox.decoration; final BoxDecoration decoration = decoratedBox.decoration;
expect(decoration.border, isNull); expect(decoration.border, isNull);
}); });
testWidgets(
'Standard title golden',
(WidgetTester tester) async {
await tester.pumpWidget(
new WidgetsApp(
color: const Color(0xFFFFFFFF),
onGenerateRoute: (RouteSettings settings) {
return new CupertinoPageRoute<void>(
settings: settings,
builder: (BuildContext context) {
return const RepaintBoundary(
child: const CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: const Text('Bling bling'),
),
child: const Center(),
),
);
},
);
},
),
);
await expectLater(
find.byType(RepaintBoundary).last,
matchesGoldenFile('nav_bar_test.standard_title.1.png'),
);
},
// TODO(xster): remove once https://github.com/flutter/flutter/issues/17483
// is fixed.
skip: !Platform.isLinux,
);
testWidgets(
'Large title golden',
(WidgetTester tester) async {
await tester.pumpWidget(
new WidgetsApp(
color: const Color(0xFFFFFFFF),
onGenerateRoute: (RouteSettings settings) {
return new CupertinoPageRoute<void>(
settings: settings,
builder: (BuildContext context) {
return new CupertinoPageScaffold(
child: new CustomScrollView(
slivers: <Widget>[
const CupertinoSliverNavigationBar(
largeTitle: const Text('Bling bling'),
),
new SliverToBoxAdapter(
child: new Container(
height: 1200.0,
),
),
],
),
);
},
);
},
),
);
await expectLater(
find.byType(RepaintBoundary).last,
matchesGoldenFile('nav_bar_test.large_title.1.png'),
);
},
// TODO(xster): remove once https://github.com/flutter/flutter/issues/17483
// is fixed.
skip: !Platform.isLinux,
);
} }
class _ExpectStyles extends StatelessWidget { class _ExpectStyles extends StatelessWidget {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment