Unverified Commit 19b47c2d authored by LongCatIsLooong's avatar LongCatIsLooong Committed by GitHub

Dark Mode R: Refresh Control (#40454)

parent ab455104
......@@ -75,13 +75,16 @@ class CupertinoColors {
// Value derived from screenshot from the dark themed Apple Watch app.
static const Color darkBackgroundGray = Color(0xFF171717);
/// Used in iOS 11 for unselected selectables such as tab bar items in their
/// Used in iOS 13 for unselected selectables such as tab bar items in their
/// inactive state or de-emphasized subtitles and details text.
///
/// Not the same gray as disabled buttons etc.
///
/// This is SystemGrayColor in the iOS palette.
static const Color inactiveGray = Color(0xFF8E8E93);
/// This is the disabled color in the iOS palette.
static const Color inactiveGray = CupertinoDynamicColor.withBrightness(
color: Color(0xFF999999),
darkColor: Color(0xFF757575),
);
/// Used for iOS 10 for destructive actions such as the delete actions in
/// table view cells and dialogs.
......
......@@ -379,9 +379,9 @@ class CupertinoSliverRefreshControl extends StatefulWidget {
opacity: opacityCurve.transform(
min(pulledExtent / refreshTriggerPullDistance, 1.0)
),
child: const Icon(
child: Icon(
CupertinoIcons.down_arrow,
color: CupertinoColors.inactiveGray,
color: CupertinoDynamicColor.resolve(CupertinoColors.inactiveGray, context),
size: 36.0,
),
)
......
......@@ -1403,6 +1403,50 @@ void main() {
debugDefaultTargetPlatformOverride = null;
},
);
testWidgets('buildSimpleRefreshIndicator dark mode', (WidgetTester tester) async {
const CupertinoDynamicColor color = CupertinoColors.inactiveGray;
await tester.pumpWidget(
MediaQuery(
data: const MediaQueryData(platformBrightness: Brightness.light),
child: Directionality(
textDirection: TextDirection.ltr,
child: Builder(
builder: (BuildContext context) {
return CupertinoSliverRefreshControl.buildSimpleRefreshIndicator(
context,
RefreshIndicatorMode.drag,
10, 10, 10,
);
},
),
),
),
);
expect(tester.widget<Icon>(find.byType(Icon)).color.value, color.color.value);
await tester.pumpWidget(
MediaQuery(
data: const MediaQueryData(platformBrightness: Brightness.dark),
child: Directionality(
textDirection: TextDirection.ltr,
child: Builder(
builder: (BuildContext context) {
return CupertinoSliverRefreshControl.buildSimpleRefreshIndicator(
context,
RefreshIndicatorMode.drag,
10, 10, 10,
);
},
),
),
),
);
expect(tester.widget<Icon>(find.byType(Icon)).color.value, color.darkColor.value);
});
};
group('UI tests long list', uiTestGroup);
......
......@@ -699,7 +699,7 @@ void main() {
const Rect.fromLTRB(463.3333435058594, -0.916666666666668, 465.3333435058594, 17.083333015441895),
const Radius.circular(2.0),
),
color: const Color(0xff8e8e93),
color: const Color(0xff999999),
)
..rrect(
rrect: RRect.fromRectAndRadius(
......@@ -724,7 +724,7 @@ void main() {
const Rect.fromLTRB(191.3333282470703, -0.916666666666668, 193.3333282470703, 17.083333015441895),
const Radius.circular(2.0),
),
color: const Color(0xff8e8e93),
color: const Color(0xff999999),
)
..rrect(
rrect: RRect.fromRectAndRadius(
......
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