Skip to content

Commit

Permalink
build: Update to flutter 3.27
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Dec 12, 2024
1 parent 0687c0a commit 7c4d4fd
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/versions.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FLUTTER_VERSION=3.24.5
FLUTTER_VERSION=3.27.0
JAVA_VERSION=17
4 changes: 3 additions & 1 deletion lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,9 @@ class ChatController extends State<ChatPageWithRoom>
for (final event in selectedEvents) {
if (!event.status.isSent) return false;
if (event.canRedact == false &&
!(clients!.any((cl) => event.senderId == cl!.userID))) return false;
!(clients!.any((cl) => event.senderId == cl!.userID))) {
return false;
}
}
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/chat/chat_emoji_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class ChatEmojiPicker extends StatelessWidget {
),
categoryViewConfig: CategoryViewConfig(
backspaceColor: theme.colorScheme.primary,
iconColor:
theme.colorScheme.primary.withOpacity(0.5),
iconColor: theme.colorScheme.primary
.withValues(alpha: 0.5),
iconColorSelected: theme.colorScheme.primary,
indicatorColor: theme.colorScheme.primary,
),
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/chat/chat_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ class ChatView extends StatelessWidget {
),
if (controller.dragging)
Container(
color: theme.scaffoldBackgroundColor.withOpacity(0.9),
color: theme.scaffoldBackgroundColor
.withValues(alpha: 0.9),
alignment: Alignment.center,
child: const Icon(
Icons.upload_outlined,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/events/reply_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReplyContent extends StatelessWidget {

return Material(
color: backgroundColor ??
theme.colorScheme.surface.withOpacity(ownMessage ? 0.2 : 0.33),
theme.colorScheme.surface.withValues(alpha: ownMessage ? 0.2 : 0.33),
borderRadius: borderRadius,
child: Row(
mainAxisSize: MainAxisSize.min,
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat_list/status_msg_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class PresenceAvatar extends StatelessWidget {

const statusMsgBubbleElevation = 6.0;
final statusMsgBubbleShadowColor = theme.colorScheme.surface;
final statusMsgBubbleColor = Colors.white.withOpacity(0.9);
final statusMsgBubbleColor = Colors.white.withValues(alpha: 0.9);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: SizedBox(
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/device_settings/device_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ class DevicesSettingsController extends State<DevicesSettings> {
message: L10n.of(context).removeDevicesDescription,
isDestructive: true,
) ==
OkCancelResult.cancel) return;
OkCancelResult.cancel) {
return;
}
final matrix = Matrix.of(context);
final deviceIds = <String>[];
for (final userDevice in devices) {
Expand Down
2 changes: 0 additions & 2 deletions lib/pages/dialer/pip/pip_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ Map<PIPViewCorner, Offset> _calculateOffsets({
return Offset(left, bottom);
case PIPViewCorner.bottomRight:
return Offset(right, bottom);
default:
throw Exception('Not implemented.');
}
}

Expand Down
10 changes: 5 additions & 5 deletions lib/pages/image_viewer/image_viewer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class ImageViewerView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withValues(alpha: 0.5),
extendBodyBehindAppBar: true,
appBar: AppBar(
elevation: 0,
leading: IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withValues(alpha: 0.5),
),
icon: const Icon(Icons.close),
onPressed: Navigator.of(context).pop,
Expand All @@ -31,7 +31,7 @@ class ImageViewerView extends StatelessWidget {
actions: [
IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withValues(alpha: 0.5),
),
icon: const Icon(Icons.reply_outlined),
onPressed: controller.forwardAction,
Expand All @@ -41,7 +41,7 @@ class ImageViewerView extends StatelessWidget {
const SizedBox(width: 8),
IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withValues(alpha: 0.5),
),
icon: const Icon(Icons.download_outlined),
onPressed: () => controller.saveFileAction(context),
Expand All @@ -56,7 +56,7 @@ class ImageViewerView extends StatelessWidget {
child: Builder(
builder: (context) => IconButton(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withOpacity(0.5),
backgroundColor: Colors.black.withValues(alpha: 0.5),
),
onPressed: () => controller.shareFileAction(context),
tooltip: L10n.of(context).share,
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/settings_style/settings_style_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:fluffychat/config/setting_keys.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/chat/events/state_message.dart';
import 'package:fluffychat/utils/account_config.dart';
import 'package:fluffychat/utils/color_value.dart';
import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
import 'package:fluffychat/widgets/matrix.dart';
Expand Down Expand Up @@ -100,7 +101,7 @@ class SettingsStyleView extends StatelessWidget {
child: Tooltip(
message: color == null
? L10n.of(context).systemTheme
: '#${color.value.toRadixString(16).toUpperCase()}',
: '#${color.hexValue.toRadixString(16).toUpperCase()}',
child: InkWell(
borderRadius: BorderRadius.circular(colorPickerSize),
onTap: () => controller.setChatColor(color),
Expand Down
14 changes: 14 additions & 0 deletions lib/utils/color_value.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:flutter/widgets.dart';

extension ColorValue on Color {
int get hexValue {
return _floatToInt8(a) << 24 |
_floatToInt8(r) << 16 |
_floatToInt8(g) << 8 |
_floatToInt8(b) << 0;
}

static int _floatToInt8(double x) {
return (x * 255.0).round() & 0xff;
}
}
2 changes: 1 addition & 1 deletion lib/utils/voip/video_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class _VideoRendererState extends State<VideoRenderer> {
filterQuality: FilterQuality.medium,
objectFit: widget.fit,
placeholderBuilder: (_) =>
Container(color: Colors.white.withOpacity(0.18)),
Container(color: Colors.white.withValues(alpha: 0.18)),
);
},
);
Expand Down
1 change: 0 additions & 1 deletion lib/widgets/connection_status_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ extension on SyncStatusUpdate {
case SyncStatus.processing:
case SyncStatus.cleaningUp:
case SyncStatus.finished:
default:
return L10n.of(context).synchronizingPleaseWait;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/error_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _FluffyChatErrorWidgetState extends State<FluffyChatErrorWidget> {
child: Placeholder(
child: Center(
child: Material(
color: Colors.white.withOpacity(0.9),
color: Colors.white.withValues(alpha: 0.9),
borderRadius: BorderRadius.circular(8),
),
),
Expand Down
1 change: 0 additions & 1 deletion lib/widgets/log_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ extension on LogEvent {
case Level.debug:
return Colors.white;
case Level.verbose:
default:
return Colors.grey;
}
}
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/theme_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:dynamic_color/dynamic_color.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'package:fluffychat/utils/color_value.dart';

class ThemeBuilder extends StatefulWidget {
final Widget Function(
BuildContext context,
Expand Down Expand Up @@ -72,7 +74,7 @@ class ThemeController extends State<ThemeBuilder> {
} else {
await preferences.setInt(
widget.primaryColorSettingsKey,
newPrimaryColor.value,
newPrimaryColor.hexValue,
);
}
setState(() {
Expand Down
56 changes: 28 additions & 28 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev"
source: hosted
version: "72.0.0"
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.2"
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev"
source: hosted
version: "6.7.0"
version: "6.11.0"
animations:
dependency: "direct main"
description:
Expand Down Expand Up @@ -178,10 +178,10 @@ packages:
dependency: "direct main"
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
colorize:
dependency: transitive
description:
Expand Down Expand Up @@ -1062,18 +1062,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 @@ -1142,10 +1142,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"
markdown:
dependency: transitive
description:
Expand Down Expand Up @@ -1782,7 +1782,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
slugify:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1867,10 +1867,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
Expand All @@ -1883,10 +1883,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
string_validator:
dependency: transitive
description:
Expand Down Expand Up @@ -1939,26 +1939,26 @@ packages:
dependency: transitive
description:
name: test
sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e"
sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f"
url: "https://pub.dev"
source: hosted
version: "1.25.7"
version: "1.25.8"
test_api:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
test_core:
dependency: transitive
description:
name: test_core
sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696"
sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d"
url: "https://pub.dev"
source: hosted
version: "0.6.4"
version: "0.6.5"
timezone:
dependency: transitive
description:
Expand Down Expand Up @@ -2251,10 +2251,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
wakelock_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -2307,10 +2307,10 @@ packages:
dependency: transitive
description:
name: webdriver
sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.4"
webkit_inspection_protocol:
dependency: transitive
description:
Expand Down

0 comments on commit 7c4d4fd

Please sign in to comment.