Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
761810a
Revert "fix a bug when android uses CupertinoPageTransitionsBuilder..…
Jasguerrero Jul 7, 2023
257a299
Revert "[a11y] CupertinoSwitch On/Off labels" (#130166) (#130172)
Jasguerrero Jul 7, 2023
1f6bdb6
[flutter_releases] Flutter beta 3.13.0-0.1.pre Framework Cherrypicks …
Jul 11, 2023
1dc07d2
[CP] Fix ConcurrentModificationError in DDS (#130740)
christopherfujino Jul 18, 2023
ac71592
[flutter_releases] Flutter beta 3.13.0-0.2.pre Framework Cherrypicks …
Jasguerrero Jul 18, 2023
945b12d
[CP] Minor adjustments on 2D APIs (#131358) (#131436)
Piinks Aug 1, 2023
1f0b77f
[flutter_releases] Flutter beta 3.13.0-0.3.pre Framework Cherrypicks …
XilaiZhang Aug 3, 2023
e90f5d4
[flutter release] manual roll engine (#131958)
XilaiZhang Aug 4, 2023
5c4bfbc
[CP] Allow `OverlayPortal` to be added/removed from the tree in a lay…
LongCatIsLooong Aug 7, 2023
f4c4261
[CP] `_RenderScaledInlineWidget` constrains child size (#130648) (#13…
LongCatIsLooong Aug 7, 2023
85127f4
[Cp] Fix Tooltip crash when selected in a SelectableRegion (#130181) …
LongCatIsLooong Aug 7, 2023
95b3a3e
[CP] Constrain _RenderScaledInlineWidget child size in computeDryLayo…
LongCatIsLooong Aug 8, 2023
7e07cd4
3.13.0-0.4.pre Beta Cherrypicks (#132146)
Aug 9, 2023
0ea0979
[CP] Check for iOS simulator runtime in flutter doctor for Xcode 15 (…
vashworth Aug 14, 2023
54040e6
[CP] New tooling for iOS 17 physical devices (#132283)
vashworth Aug 14, 2023
ff8ade8
[CP] Print pretty error when xcodebuild fails due to missing simulato…
vashworth Aug 14, 2023
53841b2
[CP] Fix #132160 RPCError during web debugging (#132356)
christopherfujino Aug 14, 2023
efbf63d
[flutter_releases] Flutter stable 3.13.0 Framework Cherrypicks (#132610)
itsjustkevin Aug 16, 2023
ce2fa57
[CP - 3.13] Fix Xcode 15 build failure due to DT_TOOLCHAIN_DIR (#132958)
vashworth Aug 22, 2023
aeed4d2
[flutter_releases] Flutter stable 3.13.1 Framework Cherrypicks (#133077)
Jasguerrero Aug 22, 2023
e1e4722
[CP] Space character should be optional when tree shaking fonts (#132…
eyebrowsoffire Aug 23, 2023
ff5b5b5
[CP] Fix lower bound of children from TwoDimensionalChildBuilderDeleg…
Piinks Aug 24, 2023
bb77eff
[CP] Fix flutter upgrade failing with "Unknown Flutter tag" to 3.13 (…
christopherfujino Sep 1, 2023
441432b
[CP] Fix visual overflow for SliverMainAxisGroup (#132989) (#133057)
Piinks Sep 5, 2023
ad5235b
[CP] Migrate web-only initialization APIs (#133891)
ditman Sep 6, 2023
d5623b5
[CP] handle exceptions raised while searching for configured android …
andrewkolos Sep 6, 2023
95c954e
[release cherrypick] Remove cirrus tests from the flutter framework (…
XilaiZhang Sep 6, 2023
2524052
[flutter_releases] Flutter stable 3.13.0 Framework Cherrypicks (#134163)
XilaiZhang Sep 6, 2023
a625ad4
[CP] Update vm_snapshot_analysis to 0.7.6 on stable (#133657)
sstrickl Sep 10, 2023
b0daa73
Roll engine to 17a711a7765a198264b20d8c4983f2f6f1271271 (#134584)
godofredoc Sep 13, 2023
367f9ea
[flutter_releases] Flutter stable 3.13.4 Framework Cherrypicks (#134599)
itsjustkevin Sep 13, 2023
0776843
[CP 3.13] Set the CONFIGURATION_BUILD_DIR in generated xcconfig when …
vashworth Sep 15, 2023
12fccda
Cherrypicks flutter 3.13 candidate.0 (#135048)
Jasguerrero Sep 19, 2023
ead4559
[flutter_releases] Flutter stable 3.13.6 Framework Cherrypicks (#135532)
Sep 27, 2023
2f708eb
[CP] Wait for CONFIGURATION_BUILD_DIR to update when debugging with X…
vashworth Oct 9, 2023
6c4930c
[flutter_releases] Flutter stable 3.13.8 Framework Cherrypicks (#136815)
itsjustkevin Oct 18, 2023
d211f42
[flutter_releases] Flutter stable 3.13.9 Framework Cherrypicks (#137284)
Jasguerrero Oct 25, 2023
41466d5
feat(flutter_tools): upgrade flutter.gradle to update shorebird.yaml …
felangel May 4, 2023
3ec5bcb
feat(flutter_tool): update `mac.dart` to generate shorebird config (#15)
felangel Aug 1, 2023
488fa06
fix(flutter_tools): improve `shorebird.yaml` detection on iOS (#18)
felangel Aug 4, 2023
1f58b0c
fix snakeyaml import (#21)
bryanoltman Aug 23, 2023
ec56c0a
Revert "fix snakeyaml import (#21)"
felangel Aug 24, 2023
da938ac
reintroduce other snakeyaml dep (#23)
bryanoltman Aug 24, 2023
b6ce884
fix(flutter_tools): proxy `auto_update` in `shorebird.yaml` on iOS (#24)
felangel Aug 29, 2023
e744c83
Update engine for 3.13.9
felangel Oct 26, 2023
fbc4718
ci: run framework tests (#29)
felangel Oct 31, 2023
5f4aef6
chore: roll flutter engine (#31)
eseidel Nov 9, 2023
39df279
chore: roll engine version
eseidel Nov 10, 2023
447487a
chore: roll engine to `a902c22268` (#32)
felangel Dec 8, 2023
a3d5f7c
chore: roll engine
eseidel Dec 11, 2023
a6eb9d3
feat: rev to 3.16.3
felangel Dec 11, 2023
7729d3a
Merge pull request #34 from shorebirdtech/flutter_release/3.16.3
felangel Dec 11, 2023
b27620f
chore: bump engine to 6994442c95 (#35)
felangel Dec 12, 2023
b9b2390
chore: bump engine to ca9c251787
felangel Dec 12, 2023
86b0e65
chore: roll engine to a3b5975e06
felangel Dec 14, 2023
1a6115b
Merge flutter 3.16.4 into shorebird/dev (#36)
bryanoltman Dec 20, 2023
fad9340
chore: roll engine to fcdba2b4478d0a43186dda0e1992406a23165262
eseidel Dec 20, 2023
7e92b03
chore: roll engine to 9472e50354253fde3f2cdb25d8115f7aa6d3c68a
eseidel Dec 20, 2023
4e8a7c7
chore: update to Flutter 3.16.5 (#37)
bryanoltman Jan 2, 2024
699fd9f
chore: roll engine to 49dec30114f043371698bc12d119d2abd72f475a
eseidel Jan 16, 2024
5b5ba50
Merge branch 'shorebird/dev' into feat/v3.16.7
felangel Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions packages/flutter/lib/src/cupertino/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ class CupertinoSwitch extends StatefulWidget {
this.thumbColor,
this.applyTheme,
this.focusColor,
this.onLabelColor,
this.offLabelColor,
this.focusNode,
this.onFocusChange,
this.autofocus = false,
Expand Down Expand Up @@ -132,17 +130,6 @@ class CupertinoSwitch extends StatefulWidget {
/// Defaults to a slightly transparent [activeColor].
final Color? focusColor;

/// The color to use for the accessibility label when the switch is on.
///
/// Defaults to [CupertinoColors.white] when null.
final Color? onLabelColor;

/// The color to use for the accessibility label when the switch is off.
///
/// Defaults to [Color.fromARGB(255, 179, 179, 179)]
/// (or [Color.fromARGB(255, 255, 255, 255)] in high contrast) when null.
final Color? offLabelColor;

/// {@macro flutter.widgets.Focus.focusNode}
final FocusNode? focusNode;

Expand Down Expand Up @@ -367,19 +354,6 @@ class _CupertinoSwitchState extends State<CupertinoSwitch> with TickerProviderSt
?? CupertinoColors.systemGreen,
context,
);
final (Color onLabelColor, Color offLabelColor)? onOffLabelColors =
MediaQuery.onOffSwitchLabelsOf(context)
? (
CupertinoDynamicColor.resolve(
widget.onLabelColor ?? CupertinoColors.white,
context,
),
CupertinoDynamicColor.resolve(
widget.offLabelColor ?? _kOffLabelColor,
context,
),
)
: null;
if (needsPositionAnimation) {
_resumePositionAnimation();
}
Expand Down Expand Up @@ -412,7 +386,6 @@ class _CupertinoSwitchState extends State<CupertinoSwitch> with TickerProviderSt
textDirection: Directionality.of(context),
isFocused: isFocused,
state: this,
onOffLabelColors: onOffLabelColors,
),
),
),
Expand Down Expand Up @@ -441,7 +414,6 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
required this.textDirection,
required this.isFocused,
required this.state,
required this.onOffLabelColors,
});

final bool value;
Expand All @@ -453,7 +425,6 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
final _CupertinoSwitchState state;
final TextDirection textDirection;
final bool isFocused;
final (Color onLabelColor, Color offLabelColor)? onOffLabelColors;

@override
_RenderCupertinoSwitch createRenderObject(BuildContext context) {
Expand All @@ -467,7 +438,6 @@ class _CupertinoSwitchRenderObjectWidget extends LeafRenderObjectWidget {
textDirection: textDirection,
isFocused: isFocused,
state: state,
onOffLabelColors: onOffLabelColors,
);
}

Expand All @@ -494,24 +464,6 @@ const double _kTrackInnerEnd = _kTrackWidth - _kTrackInnerStart;
const double _kTrackInnerLength = _kTrackInnerEnd - _kTrackInnerStart;
const double _kSwitchWidth = 59.0;
const double _kSwitchHeight = 39.0;
// Label sizes and padding taken from xcode inspector.
// See https://github.com/flutter/flutter/issues/4830#issuecomment-528495360
const double _kOnLabelWidth = 1.0;
const double _kOnLabelHeight = 10.0;
const double _kOnLabelPaddingHorizontal = 11.0;
const double _kOffLabelWidth = 1.0;
const double _kOffLabelPaddingHorizontal = 12.0;
const double _kOffLabelRadius = 5.0;
const CupertinoDynamicColor _kOffLabelColor = CupertinoDynamicColor.withBrightnessAndContrast(
debugLabel: 'offSwitchLabel',
// Source: https://github.com/flutter/flutter/pull/39993#discussion_r321946033
color: Color.fromARGB(255, 179, 179, 179),
// Source: https://github.com/flutter/flutter/pull/39993#issuecomment-535196665
darkColor: Color.fromARGB(255, 179, 179, 179),
// Source: https://github.com/flutter/flutter/pull/127776#discussion_r1244208264
highContrastColor: Color.fromARGB(255, 255, 255, 255),
darkHighContrastColor: Color.fromARGB(255, 255, 255, 255),
);
// Opacity of a disabled switch, as eye-balled from iOS Simulator on Mac.
const double _kCupertinoSwitchDisabledOpacity = 0.5;

Expand All @@ -529,7 +481,6 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
required TextDirection textDirection,
required bool isFocused,
required _CupertinoSwitchState state,
required (Color onLabelColor, Color offLabelColor)? onOffLabelColors,
}) : _value = value,
_activeColor = activeColor,
_trackColor = trackColor,
Expand All @@ -539,7 +490,6 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
_textDirection = textDirection,
_isFocused = isFocused,
_state = state,
_onOffLabelColors = onOffLabelColors,
super(additionalConstraints: const BoxConstraints.tightFor(width: _kSwitchWidth, height: _kSwitchHeight)) {
state.position.addListener(markNeedsPaint);
state._reaction.addListener(markNeedsPaint);
Expand Down Expand Up @@ -631,16 +581,6 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
markNeedsPaint();
}

(Color onLabelColor, Color offLabelColor)? get onOffLabelColors => _onOffLabelColors;
(Color onLabelColor, Color offLabelColor)? _onOffLabelColors;
set onOffLabelColors((Color onLabelColor, Color offLabelColor)? value) {
if (value == _onOffLabelColors) {
return;
}
_onOffLabelColors = value;
markNeedsPaint();
}

bool get isInteractive => onChanged != null;

@override
Expand Down Expand Up @@ -706,52 +646,6 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
canvas.drawRRect(borderTrackRRect, borderPaint);
}

if (_onOffLabelColors != null) {
final (Color onLabelColor, Color offLabelColor) = onOffLabelColors!;

final double leftLabelOpacity = visualPosition * (1.0 - currentReactionValue);
final double rightLabelOpacity = (1.0 - visualPosition) * (1.0 - currentReactionValue);
final (double onLabelOpacity, double offLabelOpacity) =
switch (textDirection) {
TextDirection.ltr => (leftLabelOpacity, rightLabelOpacity),
TextDirection.rtl => (rightLabelOpacity, leftLabelOpacity),
};

final (Offset onLabelOffset, Offset offLabelOffset) =
switch (textDirection) {
TextDirection.ltr => (
trackRect.centerLeft.translate(_kOnLabelPaddingHorizontal, 0),
trackRect.centerRight.translate(-_kOffLabelPaddingHorizontal, 0),
),
TextDirection.rtl => (
trackRect.centerRight.translate(-_kOnLabelPaddingHorizontal, 0),
trackRect.centerLeft.translate(_kOffLabelPaddingHorizontal, 0),
),
};

// Draws '|' label
final Rect onLabelRect = Rect.fromCenter(
center: onLabelOffset,
width: _kOnLabelWidth,
height: _kOnLabelHeight,
);
final Paint onLabelPaint = Paint()
..color = onLabelColor.withOpacity(onLabelOpacity)
..style = PaintingStyle.fill;
canvas.drawRect(onLabelRect, onLabelPaint);

// Draws 'O' label
final Paint offLabelPaint = Paint()
..color = offLabelColor.withOpacity(offLabelOpacity)
..style = PaintingStyle.stroke
..strokeWidth = _kOffLabelWidth;
canvas.drawCircle(
offLabelOffset,
_kOffLabelRadius,
offLabelPaint,
);
}

final double currentThumbExtension = CupertinoThumbPainter.extension * currentReactionValue;
final double thumbLeft = lerpDouble(
trackRect.left + _kTrackInnerStart - CupertinoThumbPainter.radius,
Expand Down
41 changes: 0 additions & 41 deletions packages/flutter/lib/src/widgets/media_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ enum _MediaQueryAspect {
invertColors,
/// Specifies the aspect corresponding to [MediaQueryData.highContrast].
highContrast,
/// Specifies the aspect corresponding to [MediaQueryData.onOffSwitchLabels].
onOffSwitchLabels,
/// Specifies the aspect corresponding to [MediaQueryData.disableAnimations].
disableAnimations,
/// Specifies the aspect corresponding to [MediaQueryData.boldText].
Expand Down Expand Up @@ -165,7 +163,6 @@ class MediaQueryData {
this.accessibleNavigation = false,
this.invertColors = false,
this.highContrast = false,
this.onOffSwitchLabels = false,
this.disableAnimations = false,
this.boldText = false,
this.navigationMode = NavigationMode.traditional,
Expand Down Expand Up @@ -243,7 +240,6 @@ class MediaQueryData {
disableAnimations = platformData?.disableAnimations ?? view.platformDispatcher.accessibilityFeatures.disableAnimations,
boldText = platformData?.boldText ?? view.platformDispatcher.accessibilityFeatures.boldText,
highContrast = platformData?.highContrast ?? view.platformDispatcher.accessibilityFeatures.highContrast,
onOffSwitchLabels = platformData?.onOffSwitchLabels ?? view.platformDispatcher.accessibilityFeatures.onOffSwitchLabels,
alwaysUse24HourFormat = platformData?.alwaysUse24HourFormat ?? view.platformDispatcher.alwaysUse24HourFormat,
navigationMode = platformData?.navigationMode ?? NavigationMode.traditional,
gestureSettings = DeviceGestureSettings.fromView(view),
Expand Down Expand Up @@ -488,15 +484,6 @@ class MediaQueryData {
/// or above.
final bool highContrast;

/// Whether the user requested to show on/off labels inside switches on iOS,
/// via Settings -> Accessibility -> Display & Text Size -> On/Off Labels.
///
/// See also:
///
/// * [dart:ui.PlatformDispatcher.accessibilityFeatures], where the setting
/// originates.
final bool onOffSwitchLabels;

/// Whether the platform is requesting that animations be disabled or reduced
/// as much as possible.
///
Expand Down Expand Up @@ -578,7 +565,6 @@ class MediaQueryData {
EdgeInsets? systemGestureInsets,
bool? alwaysUse24HourFormat,
bool? highContrast,
bool? onOffSwitchLabels,
bool? disableAnimations,
bool? invertColors,
bool? accessibleNavigation,
Expand All @@ -603,7 +589,6 @@ class MediaQueryData {
alwaysUse24HourFormat: alwaysUse24HourFormat ?? this.alwaysUse24HourFormat,
invertColors: invertColors ?? this.invertColors,
highContrast: highContrast ?? this.highContrast,
onOffSwitchLabels: onOffSwitchLabels ?? this.onOffSwitchLabels,
disableAnimations: disableAnimations ?? this.disableAnimations,
accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
boldText: boldText ?? this.boldText,
Expand Down Expand Up @@ -795,7 +780,6 @@ class MediaQueryData {
&& other.systemGestureInsets == systemGestureInsets
&& other.alwaysUse24HourFormat == alwaysUse24HourFormat
&& other.highContrast == highContrast
&& other.onOffSwitchLabels == onOffSwitchLabels
&& other.disableAnimations == disableAnimations
&& other.invertColors == invertColors
&& other.accessibleNavigation == accessibleNavigation
Expand All @@ -816,7 +800,6 @@ class MediaQueryData {
viewInsets,
alwaysUse24HourFormat,
highContrast,
onOffSwitchLabels,
disableAnimations,
invertColors,
accessibleNavigation,
Expand All @@ -840,7 +823,6 @@ class MediaQueryData {
'alwaysUse24HourFormat: $alwaysUse24HourFormat',
'accessibleNavigation: $accessibleNavigation',
'highContrast: $highContrast',
'onOffSwitchLabels: $onOffSwitchLabels',
'disableAnimations: $disableAnimations',
'invertColors: $invertColors',
'boldText: $boldText',
Expand Down Expand Up @@ -1432,25 +1414,6 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
/// the [MediaQueryData.highContrast] property of the ancestor [MediaQuery] changes.
static bool? maybeHighContrastOf(BuildContext context) => _maybeOf(context, _MediaQueryAspect.highContrast)?.highContrast;

/// Returns onOffSwitchLabels for the nearest MediaQuery ancestor or false, if no
/// such ancestor exists.
///
/// See also:
///
/// * [MediaQueryData.onOffSwitchLabels], which indicates the platform's
/// desire to show on/off labels inside switches.
///
/// Use of this method will cause the given [context] to rebuild any time that
/// the [MediaQueryData.onOffSwitchLabels] property of the ancestor [MediaQuery] changes.
static bool onOffSwitchLabelsOf(BuildContext context) => maybeOnOffSwitchLabelsOf(context) ?? false;

/// Returns onOffSwitchLabels for the nearest MediaQuery ancestor or
/// null, if no such ancestor exists.
///
/// Use of this method will cause the given [context] to rebuild any time that
/// the [MediaQueryData.onOffSwitchLabels] property of the ancestor [MediaQuery] changes.
static bool? maybeOnOffSwitchLabelsOf(BuildContext context) => _maybeOf(context, _MediaQueryAspect.onOffSwitchLabels)?.onOffSwitchLabels;

/// Returns disableAnimations for the nearest MediaQuery ancestor or
/// [Brightness.light], if no such ancestor exists.
///
Expand Down Expand Up @@ -1606,10 +1569,6 @@ class MediaQuery extends InheritedModel<_MediaQueryAspect> {
if (data.highContrast != oldWidget.data.highContrast) {
return true;
}
case _MediaQueryAspect.onOffSwitchLabels:
if (data.onOffSwitchLabels != oldWidget.data.onOffSwitchLabels) {
return true;
}
case _MediaQueryAspect.disableAnimations:
if (data.disableAnimations != oldWidget.data.disableAnimations) {
return true;
Expand Down
Loading