Skip to content

Commit

Permalink
deps: Upgrade Flutter to 3.25.0-1.0.pre.296
Browse files Browse the repository at this point in the history
And update Flutter's supporting libraries to match.

Also, as anticipated in zulip#920 (see PR description), handle some
deprecations in the Color API from flutter/engine@eff1b76cf (rolled
in flutter/flutter@8c1a93508). Deprecation warnings are "info"-level
in analyzer output, and CI treats that as fatal, because we don't
want to let those hang around.

In particular, `withOpacity` is replaced with the new `withValues`.

Also, `value` is newly deprecated, but we migrated off that in the
previous commit.
  • Loading branch information
chrisbobbe committed Sep 7, 2024
1 parent c4f360d commit 16f775f
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions lib/widgets/channel_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ChannelColorSwatch extends ColorSwatch<ChannelColorVariant> {
// TODO fix bug where our results differ from the replit's (see unit tests)
ChannelColorVariant.unreadCountBadgeBackground:
clampLchLightness(baseAsColor, 30, 70)
.withOpacity(0.3),
.withValues(alpha: 0.3),

// Follows `.sidebar-row__icon` in Vlad's replit:
// <https://replit.com/@VladKorobov/zulip-sidebar#script.js>
Expand Down Expand Up @@ -169,7 +169,7 @@ class ChannelColorSwatch extends ColorSwatch<ChannelColorVariant> {
ChannelColorVariant.base: baseAsColor,
ChannelColorVariant.unreadCountBadgeBackground:
clampLchLightness(baseAsColor, 30, 70)
.withOpacity(0.3),
.withValues(alpha: 0.3),
ChannelColorVariant.iconOnPlainBackground: clamped20to75,

// Follows the web app (as of zulip/zulip@db03369ac); see
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/compose_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,12 @@ class _SendButtonState extends State<_SendButton> {

// Copy FilledButton defaults (_FilledButtonDefaultsM3.backgroundColor)
final backgroundColor = disabled
? colorScheme.onSurface.withOpacity(0.12)
? colorScheme.onSurface.withValues(alpha: 0.12)
: colorScheme.primary;

// Copy FilledButton defaults (_FilledButtonDefaultsM3.foregroundColor)
final foregroundColor = disabled
? colorScheme.onSurface.withOpacity(0.38)
? colorScheme.onSurface.withValues(alpha: 0.38)
: colorScheme.onPrimary;

return Ink(
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ContentTheme extends ThemeExtension<ContentTheme> {
colorGlobalTimeBorder: const HSLColor.fromAHSL(0.4, 0, 0, 0).toColor(),
colorMathBlockBorder: const HSLColor.fromAHSL(1, 240, 0.4, 0.4).toColor(),
colorMessageMediaContainerBackground: const HSLColor.fromAHSL(0.03, 0, 0, 1).toColor(),
colorThematicBreak: const HSLColor.fromAHSL(1, 0, 0, .87).toColor().withOpacity(0.2),
colorThematicBreak: const HSLColor.fromAHSL(1, 0, 0, .87).toColor().withValues(alpha: 0.2),
textStylePlainParagraph: _plainParagraphCommon(context).copyWith(
color: const HSLColor.fromAHSL(0.75, 0, 0, 1).toColor(),
debugLabel: 'ContentTheme.textStylePlainParagraph'),
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/draggable_scrollable_modal_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _DragHandleLayer extends StatelessWidget {
// https://m3.material.io/components/bottom-sheets/specs#7c093473-d9e1-48f3-9659-b75519c2a29d
height: 4,
width: 32,
child: ColoredBox(color: colorScheme.onSurfaceVariant.withOpacity(0.40))))));
child: ColoredBox(color: colorScheme.onSurfaceVariant.withValues(alpha: 0.40))))));
}
}

Expand Down
18 changes: 9 additions & 9 deletions lib/widgets/emoji_reaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ class EmojiReactionTheme extends ThemeExtension<EmojiReactionTheme> {
// want to check that against web when implementing the shadow.
bgUnselected: const HSLColor.fromAHSL(0.08, 210, 0.50, 0.875).toColor(),

borderSelected: Colors.black.withOpacity(0.45),
borderSelected: Colors.black.withValues(alpha: 0.45),

// TODO see TODO on [bgUnselected] about shadow effect
borderUnselected: Colors.black.withOpacity(0.05),
borderUnselected: Colors.black.withValues(alpha: 0.05),

textSelected: const HSLColor.fromAHSL(1, 210, 0.20, 0.20).toColor(),
textUnselected: const HSLColor.fromAHSL(1, 210, 0.20, 0.25).toColor(),
);

EmojiReactionTheme.dark() :
this._(
bgSelected: Colors.black.withOpacity(0.8),
bgUnselected: Colors.black.withOpacity(0.3),
borderSelected: Colors.white.withOpacity(0.75),
borderUnselected: Colors.white.withOpacity(0.15),
textSelected: Colors.white.withOpacity(0.85),
textUnselected: Colors.white.withOpacity(0.75),
bgSelected: Colors.black.withValues(alpha: 0.8),
bgUnselected: Colors.black.withValues(alpha: 0.3),
borderSelected: Colors.white.withValues(alpha: 0.75),
borderUnselected: Colors.white.withValues(alpha: 0.15),
textSelected: Colors.white.withValues(alpha: 0.85),
textUnselected: Colors.white.withValues(alpha: 0.75),
);

EmojiReactionTheme._({
Expand Down Expand Up @@ -168,7 +168,7 @@ class ReactionChip extends StatelessWidget {
final labelColor = selfVoted ? reactionTheme.textSelected : reactionTheme.textUnselected;
final backgroundColor = selfVoted ? reactionTheme.bgSelected : reactionTheme.bgUnselected;
final splashColor = selfVoted ? reactionTheme.bgUnselected : reactionTheme.bgSelected;
final highlightColor = splashColor.withOpacity(0.5);
final highlightColor = splashColor.withValues(alpha: 0.5);

final borderSide = BorderSide(
color: borderColor,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/lightbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class _LightboxPageLayoutState extends State<_LightboxPageLayout> {
Widget build(BuildContext context) {
final themeData = Theme.of(context);

final appBarBackgroundColor = Colors.grey.shade900.withOpacity(0.87);
final appBarBackgroundColor = Colors.grey.shade900.withValues(alpha: 0.87);
const appBarForegroundColor = Colors.white;
const appBarElevation = 0.0;

Expand Down
6 changes: 3 additions & 3 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.08, 0.65).toColor(),
senderName: const HSLColor.fromAHSL(1, 0, 0, 0.2).toColor(),
streamMessageBgDefault: Colors.white,
streamRecipientHeaderChevronRight: Colors.black.withOpacity(0.3),
streamRecipientHeaderChevronRight: Colors.black.withValues(alpha: 0.3),

// From the Figma mockup at:
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=132-9684
Expand All @@ -49,7 +49,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
// in both light and dark theme.)
unreadMarker: const HSLColor.fromAHSL(1, 227, 0.78, 0.59).toColor(),

unreadMarkerGap: Colors.white.withOpacity(0.6),
unreadMarkerGap: Colors.white.withValues(alpha: 0.6),

// TODO(design) this seems ad-hoc; is there a better color?
unsubscribedStreamRecipientHeaderBg: const Color(0xfff5f5f5),
Expand All @@ -67,7 +67,7 @@ class MessageListTheme extends ThemeExtension<MessageListTheme> {
senderBotIcon: const HSLColor.fromAHSL(1, 180, 0.05, 0.5).toColor(),
senderName: const HSLColor.fromAHSL(0.85, 0, 0, 1).toColor(),
streamMessageBgDefault: const HSLColor.fromAHSL(1, 0, 0, 0.15).toColor(),
streamRecipientHeaderChevronRight: Colors.white.withOpacity(0.3),
streamRecipientHeaderChevronRight: Colors.white.withValues(alpha: 0.3),

// 0.75 opacity from here:
// https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=807-33998&m=dev
Expand Down
18 changes: 9 additions & 9 deletions lib/widgets/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
DesignVariables.light() :
this._(
background: const Color(0xffffffff),
bgCounterUnread: const Color(0xff666699).withOpacity(0.15),
bgCounterUnread: const Color(0xff666699).withValues(alpha: 0.15),
bgTopBar: const Color(0xfff5f5f5),
borderBar: const Color(0x33000000),
icon: const Color(0xff666699),
Expand All @@ -121,26 +121,26 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
errorBannerBackground: const HSLColor.fromAHSL(1, 4, 0.33, 0.90).toColor(),
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.57, 0.33).toColor(),
errorBannerLabel: const HSLColor.fromAHSL(1, 4, 0.58, 0.33).toColor(),
groupDmConversationIcon: Colors.black.withOpacity(0.5),
groupDmConversationIcon: Colors.black.withValues(alpha: 0.5),
groupDmConversationIconBg: const Color(0x33808080),
loginOrDivider: const Color(0xffdedede),
loginOrDividerText: const Color(0xff575757),
sectionCollapseIcon: const Color(0x7f1e2e48),
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
subscriptionListHeaderLine: const HSLColor.fromAHSL(0.2, 240, 0.1, 0.5).toColor(),
subscriptionListHeaderText: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.5).toColor(),
unreadCountBadgeTextForChannel: Colors.black.withOpacity(0.9),
unreadCountBadgeTextForChannel: Colors.black.withValues(alpha: 0.9),
);

DesignVariables.dark() :
this._(
background: const Color(0xff000000),
bgCounterUnread: const Color(0xff666699).withOpacity(0.37),
bgCounterUnread: const Color(0xff666699).withValues(alpha: 0.37),
bgTopBar: const Color(0xff242424),
borderBar: Colors.black.withOpacity(0.41),
borderBar: Colors.black.withValues(alpha: 0.41),
icon: const Color(0xff7070c2),
labelCounterUnread: const Color(0xffffffff).withOpacity(0.7),
labelMenuButton: const Color(0xffffffff).withOpacity(0.85),
labelCounterUnread: const Color(0xffffffff).withValues(alpha: 0.7),
labelMenuButton: const Color(0xffffffff).withValues(alpha: 0.85),
mainBackground: const Color(0xff1d1d1d),
title: const Color(0xffffffff),
channelColorSwatches: ChannelColorSwatches.dark,
Expand All @@ -151,7 +151,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
errorBannerBorder: const HSLColor.fromAHSL(0.4, 3, 0.73, 0.74).toColor(),
errorBannerLabel: const HSLColor.fromAHSL(1, 2, 0.73, 0.80).toColor(),
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
groupDmConversationIcon: Colors.white.withOpacity(0.5),
groupDmConversationIcon: Colors.white.withValues(alpha: 0.5),
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
groupDmConversationIconBg: const Color(0x33cccccc),
loginOrDivider: const Color(0xff424242),
Expand All @@ -164,7 +164,7 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
subscriptionListHeaderLine: const HSLColor.fromAHSL(0.4, 240, 0.1, 0.75).toColor(),
// TODO(design-dark) need proper dark-theme color (this is ad hoc)
subscriptionListHeaderText: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.75).toColor(),
unreadCountBadgeTextForChannel: Colors.white.withOpacity(0.9),
unreadCountBadgeTextForChannel: Colors.white.withValues(alpha: 0.9),
);

DesignVariables._({
Expand Down
28 changes: 14 additions & 14 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77"
sha256: f6dbf021f4b214d85c79822912c5fcd142a2c4869f01222ad371bc51f9f1c356
url: "https://pub.dev"
source: hosted
version: "73.0.0"
version: "74.0.0"
_flutterfire_internals:
dependency: transitive
description:
Expand All @@ -21,15 +21,15 @@ packages:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a"
sha256: f7e8caf82f2d3190881d81012606effdf8a38e6c1ab9e30947149733065f817c
url: "https://pub.dev"
source: hosted
version: "6.8.0"
version: "6.9.0"
analyzer_plugin:
dependency: transitive
description:
Expand Down Expand Up @@ -663,18 +663,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -703,10 +703,10 @@ packages:
dependency: transitive
description:
name: macros
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.2-main.4"
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -967,7 +967,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_gen:
dependency: transitive
description:
Expand Down Expand Up @@ -1360,5 +1360,5 @@ packages:
source: path
version: "0.0.1"
sdks:
dart: ">=3.6.0-149.3.beta <4.0.0"
flutter: ">=3.25.0-1.0.pre.41"
dart: ">=3.6.0-217.0.dev <4.0.0"
flutter: ">=3.25.0-1.0.pre.296"
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ environment:
# We use a recent version of Flutter from its main channel, and
# the corresponding recent version of the Dart SDK.
# Feel free to update these regularly; see README.md for instructions.
sdk: '>=3.6.0-149.3.beta <4.0.0'
flutter: '>=3.25.0-1.0.pre.41'
sdk: '>=3.6.0-217.0.dev <4.0.0'
flutter: '>=3.25.0-1.0.pre.296'

# To update dependencies, see instructions in README.md.
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion test/widgets/compose_box_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void main() {
final sendButtonWidget = sendButtonElement.widget as IconButton;
final colorScheme = Theme.of(sendButtonElement).colorScheme;
final expectedForegroundColor = expected
? colorScheme.onSurface.withOpacity(0.38)
? colorScheme.onSurface.withValues(alpha: 0.38)
: colorScheme.onPrimary;
check(sendButtonWidget.color).equals(expectedForegroundColor);
}
Expand Down

0 comments on commit 16f775f

Please sign in to comment.