From 8f62edce3605a587c49ee9a294668a4fa91845e4 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Thu, 29 Aug 2024 20:20:02 -0700 Subject: [PATCH] deps: Upgrade Flutter to 3.25.0-1.0.pre.296 And update Flutter's supporting libraries to match. Also, as anticipated in #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. --- lib/widgets/channel_colors.dart | 4 +-- lib/widgets/compose_box.dart | 4 +-- lib/widgets/content.dart | 2 +- ...aggable_scrollable_modal_bottom_sheet.dart | 2 +- lib/widgets/emoji_reaction.dart | 18 ++++++------ lib/widgets/lightbox.dart | 2 +- lib/widgets/message_list.dart | 6 ++-- lib/widgets/theme.dart | 18 ++++++------ pubspec.lock | 28 +++++++++---------- pubspec.yaml | 4 +-- test/widgets/compose_box_test.dart | 2 +- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/widgets/channel_colors.dart b/lib/widgets/channel_colors.dart index 764ac6697f..388279453d 100644 --- a/lib/widgets/channel_colors.dart +++ b/lib/widgets/channel_colors.dart @@ -123,7 +123,7 @@ class ChannelColorSwatch extends ColorSwatch { // 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: // @@ -169,7 +169,7 @@ class ChannelColorSwatch extends ColorSwatch { 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 diff --git a/lib/widgets/compose_box.dart b/lib/widgets/compose_box.dart index d20cf9fb4b..4f3d857d70 100644 --- a/lib/widgets/compose_box.dart +++ b/lib/widgets/compose_box.dart @@ -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( diff --git a/lib/widgets/content.dart b/lib/widgets/content.dart index 7b567b74fb..6d9ef651ac 100644 --- a/lib/widgets/content.dart +++ b/lib/widgets/content.dart @@ -66,7 +66,7 @@ class ContentTheme extends ThemeExtension { 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'), diff --git a/lib/widgets/draggable_scrollable_modal_bottom_sheet.dart b/lib/widgets/draggable_scrollable_modal_bottom_sheet.dart index e8e390d8fe..27f8bfd654 100644 --- a/lib/widgets/draggable_scrollable_modal_bottom_sheet.dart +++ b/lib/widgets/draggable_scrollable_modal_bottom_sheet.dart @@ -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)))))); } } diff --git a/lib/widgets/emoji_reaction.dart b/lib/widgets/emoji_reaction.dart index e3f24b5601..4468cbb857 100644 --- a/lib/widgets/emoji_reaction.dart +++ b/lib/widgets/emoji_reaction.dart @@ -24,10 +24,10 @@ class EmojiReactionTheme extends ThemeExtension { // 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(), @@ -35,12 +35,12 @@ class EmojiReactionTheme extends ThemeExtension { 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._({ @@ -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, diff --git a/lib/widgets/lightbox.dart b/lib/widgets/lightbox.dart index 6560e98bb8..4ce095252f 100644 --- a/lib/widgets/lightbox.dart +++ b/lib/widgets/lightbox.dart @@ -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; diff --git a/lib/widgets/message_list.dart b/lib/widgets/message_list.dart index a72709fcfe..fb76598f89 100644 --- a/lib/widgets/message_list.dart +++ b/lib/widgets/message_list.dart @@ -39,7 +39,7 @@ class MessageListTheme extends ThemeExtension { 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 @@ -49,7 +49,7 @@ class MessageListTheme extends ThemeExtension { // 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), @@ -67,7 +67,7 @@ class MessageListTheme extends ThemeExtension { 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 diff --git a/lib/widgets/theme.dart b/lib/widgets/theme.dart index 68ee7367f3..00f96460f5 100644 --- a/lib/widgets/theme.dart +++ b/lib/widgets/theme.dart @@ -107,7 +107,7 @@ class DesignVariables extends ThemeExtension { 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), @@ -121,7 +121,7 @@ class DesignVariables extends ThemeExtension { 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), @@ -129,18 +129,18 @@ class DesignVariables extends ThemeExtension { 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, @@ -151,7 +151,7 @@ class DesignVariables extends ThemeExtension { 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), @@ -164,7 +164,7 @@ class DesignVariables extends ThemeExtension { 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._({ diff --git a/pubspec.lock b/pubspec.lock index fe02056fd1..e03b175e87 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: @@ -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: @@ -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: @@ -967,7 +967,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_gen: dependency: transitive description: @@ -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" diff --git a/pubspec.yaml b/pubspec.yaml index 30eefaad2c..c4a68ae7b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: diff --git a/test/widgets/compose_box_test.dart b/test/widgets/compose_box_test.dart index 7b679e734f..b38415218e 100644 --- a/test/widgets/compose_box_test.dart +++ b/test/widgets/compose_box_test.dart @@ -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); }