From ae0c8f73d2325580e8578517dce7e0754b18d3ff Mon Sep 17 00:00:00 2001 From: "lauren n. liberda" Date: Thu, 16 May 2024 09:05:04 +0200 Subject: [PATCH 01/12] chore: upgrade flutter to 3.22.0 --- .github/workflows/versions.env | 2 +- lib/config/themes.dart | 6 ++-- lib/pages/chat/chat_emoji_picker.dart | 4 +-- lib/pages/chat/chat_view.dart | 2 +- lib/pages/chat/events/message.dart | 11 +++--- lib/pages/chat/events/message_reactions.dart | 2 +- lib/pages/chat/events/reply_content.dart | 4 +-- lib/pages/chat/events/state_message.dart | 2 +- .../events/verification_request_content.dart | 2 +- lib/pages/chat/events/video_player.dart | 3 +- lib/pages/chat/seen_by_row.dart | 2 +- lib/pages/chat/typing_indicators.dart | 2 +- lib/pages/chat_details/chat_details_view.dart | 2 +- lib/pages/chat_list/chat_list_view.dart | 4 +-- lib/pages/chat_list/navi_rail_item.dart | 2 +- lib/pages/chat_list/space_view.dart | 4 +-- lib/pages/chat_list/status_msg_list.dart | 2 +- .../homeserver_picker/homeserver_app_bar.dart | 4 +-- .../homeserver_picker_view.dart | 6 ++-- lib/pages/login/login_view.dart | 4 +-- lib/pages/new_group/new_group_view.dart | 4 +-- lib/pages/settings/settings_view.dart | 4 +-- .../settings_password_view.dart | 2 +- .../settings_security_view.dart | 2 +- .../settings_style/settings_style_view.dart | 4 +-- .../user_bottom_sheet_view.dart | 7 ++-- lib/widgets/avatar.dart | 4 +-- lib/widgets/layouts/login_scaffold.dart | 4 +-- lib/widgets/unread_rooms_badge.dart | 2 +- pubspec.lock | 36 +++++++++---------- 30 files changed, 68 insertions(+), 71 deletions(-) diff --git a/.github/workflows/versions.env b/.github/workflows/versions.env index 7656c5f67..496817358 100644 --- a/.github/workflows/versions.env +++ b/.github/workflows/versions.env @@ -1,2 +1,2 @@ -FLUTTER_VERSION=3.19.6 +FLUTTER_VERSION=3.22.0 JAVA_VERSION=17 diff --git a/lib/config/themes.dart b/lib/config/themes.dart index 3c18af01b..58feeab70 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -89,7 +89,7 @@ abstract class FluffyThemes { ), ), textSelectionTheme: TextSelectionThemeData( - selectionColor: colorScheme.onBackground.withAlpha(128), + selectionColor: colorScheme.onSurface.withAlpha(128), selectionHandleColor: colorScheme.secondary, ), inputDecorationTheme: InputDecorationTheme( @@ -106,13 +106,13 @@ abstract class FluffyThemes { ? Colors.grey.withAlpha(64) : null, surfaceTintColor: - FluffyThemes.isColumnMode(context) ? colorScheme.background : null, + FluffyThemes.isColumnMode(context) ? colorScheme.surface : null, systemOverlayStyle: SystemUiOverlayStyle( statusBarColor: Colors.transparent, statusBarIconBrightness: brightness.reversed, statusBarBrightness: brightness, systemNavigationBarIconBrightness: brightness.reversed, - systemNavigationBarColor: colorScheme.background, + systemNavigationBarColor: colorScheme.surface, ), ), textButtonTheme: TextButtonThemeData( diff --git a/lib/pages/chat/chat_emoji_picker.dart b/lib/pages/chat/chat_emoji_picker.dart index 5a8f66d8b..153abad67 100644 --- a/lib/pages/chat/chat_emoji_picker.dart +++ b/lib/pages/chat/chat_emoji_picker.dart @@ -59,11 +59,11 @@ class ChatEmojiPicker extends StatelessWidget { ), skinToneConfig: SkinToneConfig( dialogBackgroundColor: Color.lerp( - theme.colorScheme.background, + theme.colorScheme.surface, theme.colorScheme.primaryContainer, 0.75, )!, - indicatorColor: theme.colorScheme.onBackground, + indicatorColor: theme.colorScheme.onSurface, ), ), ), diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 7dd303655..b3e1f5669 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -302,7 +302,7 @@ class ChatView extends StatelessWidget { clipBehavior: Clip.hardEdge, color: Theme.of(context) .colorScheme - .surfaceVariant, + .surfaceContainerHighest, borderRadius: const BorderRadius.all( Radius.circular(24), ), diff --git a/lib/pages/chat/events/message.dart b/lib/pages/chat/events/message.dart index a3037fbcd..388974263 100644 --- a/lib/pages/chat/events/message.dart +++ b/lib/pages/chat/events/message.dart @@ -77,7 +77,7 @@ class Message extends StatelessWidget { final client = Matrix.of(context).client; final ownMessage = event.senderId == client.userID; final alignment = ownMessage ? Alignment.topRight : Alignment.topLeft; - var color = Theme.of(context).colorScheme.surfaceVariant; + var color = Theme.of(context).colorScheme.surfaceContainerHighest; final displayTime = event.type == EventTypes.RoomCreate || nextEvent == null || !event.originServerTs.sameEnvironment(nextEvent!.originServerTs); @@ -101,7 +101,7 @@ class Message extends StatelessWidget { final textColor = ownMessage ? Theme.of(context).colorScheme.onPrimary - : Theme.of(context).colorScheme.onBackground; + : Theme.of(context).colorScheme.onSurface; final rowMainAxisAlignment = ownMessage ? MainAxisAlignment.end : MainAxisAlignment.start; @@ -413,11 +413,8 @@ class Message extends StatelessWidget { child: Center( child: Material( color: displayTime - ? Theme.of(context).colorScheme.background - : Theme.of(context) - .colorScheme - .background - .withOpacity(0.33), + ? Theme.of(context).colorScheme.surface + : Theme.of(context).colorScheme.surface.withOpacity(0.33), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), clipBehavior: Clip.antiAlias, diff --git a/lib/pages/chat/events/message_reactions.dart b/lib/pages/chat/events/message_reactions.dart index c786af59f..56286cae0 100644 --- a/lib/pages/chat/events/message_reactions.dart +++ b/lib/pages/chat/events/message_reactions.dart @@ -111,7 +111,7 @@ class _Reaction extends StatelessWidget { final textColor = Theme.of(context).brightness == Brightness.dark ? Colors.white : Colors.black; - final color = Theme.of(context).colorScheme.background; + final color = Theme.of(context).colorScheme.surface; Widget content; if (reactionKey.startsWith('mxc://')) { content = Row( diff --git a/lib/pages/chat/events/reply_content.dart b/lib/pages/chat/events/reply_content.dart index c4813f585..945ae22ac 100644 --- a/lib/pages/chat/events/reply_content.dart +++ b/lib/pages/chat/events/reply_content.dart @@ -39,7 +39,7 @@ class ReplyContent extends StatelessWidget { color: backgroundColor ?? Theme.of(context) .colorScheme - .background + .surface .withOpacity(ownMessage ? 0.2 : 0.33), borderRadius: borderRadius, child: Row( @@ -82,7 +82,7 @@ class ReplyContent extends StatelessWidget { style: TextStyle( color: ownMessage ? Theme.of(context).colorScheme.onPrimary - : Theme.of(context).colorScheme.onBackground, + : Theme.of(context).colorScheme.onSurface, fontSize: fontSize, ), ), diff --git a/lib/pages/chat/events/state_message.dart b/lib/pages/chat/events/state_message.dart index 79ab9a617..0aa5d9dc2 100644 --- a/lib/pages/chat/events/state_message.dart +++ b/lib/pages/chat/events/state_message.dart @@ -18,7 +18,7 @@ class StateMessage extends StatelessWidget { child: Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2), ), child: Text( diff --git a/lib/pages/chat/events/verification_request_content.dart b/lib/pages/chat/events/verification_request_content.dart index 5a0c75f4b..b6ec3fd09 100644 --- a/lib/pages/chat/events/verification_request_content.dart +++ b/lib/pages/chat/events/verification_request_content.dart @@ -39,7 +39,7 @@ class VerificationRequestContent extends StatelessWidget { color: Theme.of(context).dividerColor, ), borderRadius: BorderRadius.circular(AppConfig.borderRadius), - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, ), child: Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/chat/events/video_player.dart b/lib/pages/chat/events/video_player.dart index 2cdbbc84c..1b0983bd4 100644 --- a/lib/pages/chat/events/video_player.dart +++ b/lib/pages/chat/events/video_player.dart @@ -123,8 +123,7 @@ class EventVideoPlayerState extends State { Center( child: IconButton( style: IconButton.styleFrom( - backgroundColor: - Theme.of(context).colorScheme.background, + backgroundColor: Theme.of(context).colorScheme.surface, ), icon: _isDownloading ? const SizedBox( diff --git a/lib/pages/chat/seen_by_row.dart b/lib/pages/chat/seen_by_row.dart index faac0db4d..c2c3cd737 100644 --- a/lib/pages/chat/seen_by_row.dart +++ b/lib/pages/chat/seen_by_row.dart @@ -50,7 +50,7 @@ class SeenByRow extends StatelessWidget { width: 16, height: 16, child: Material( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(32), child: Center( child: Text( diff --git a/lib/pages/chat/typing_indicators.dart b/lib/pages/chat/typing_indicators.dart index e816f465d..f6c7084d5 100644 --- a/lib/pages/chat/typing_indicators.dart +++ b/lib/pages/chat/typing_indicators.dart @@ -72,7 +72,7 @@ class TypingIndicators extends StatelessWidget { Padding( padding: const EdgeInsets.only(top: topPadding), child: Material( - color: Theme.of(context).colorScheme.surfaceVariant, + color: Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: const BorderRadius.only( topLeft: Radius.circular(2), topRight: Radius.circular(AppConfig.borderRadius), diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index 9ff6af332..f23dc681b 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -162,7 +162,7 @@ class ChatDetailsView extends StatelessWidget { style: TextButton.styleFrom( foregroundColor: Theme.of(context) .colorScheme - .onBackground, + .onSurface, ), label: Text( room.isDirectChat diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index a91a0ee5e..163a7fc72 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -189,9 +189,9 @@ class ChatListView extends StatelessWidget { labelBehavior: NavigationDestinationLabelBehavior.alwaysShow, shadowColor: - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, surfaceTintColor: - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, selectedIndex: controller.selectedIndex, onDestinationSelected: controller.onDestinationSelected, diff --git a/lib/pages/chat_list/navi_rail_item.dart b/lib/pages/chat_list/navi_rail_item.dart index 2004f3568..d09659f88 100644 --- a/lib/pages/chat_list/navi_rail_item.dart +++ b/lib/pages/chat_list/navi_rail_item.dart @@ -67,7 +67,7 @@ class _NaviRailItemState extends State { borderRadius: borderRadius, color: widget.isSelected ? Theme.of(context).colorScheme.primaryContainer - : Theme.of(context).colorScheme.background, + : Theme.of(context).colorScheme.surface, child: Tooltip( message: widget.toolTip, child: InkWell( diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 692429e4f..40ad71c49 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -307,7 +307,7 @@ class _SpaceViewState extends State { MatrixLocals(L10n.of(context)!), ); return Material( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, child: ListTile( leading: Avatar( mxContent: rootSpace.avatar, @@ -545,7 +545,7 @@ class _SpaceViewState extends State { : L10n.of(context)!.enterRoom), maxLines: 1, style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), ), trailing: isSpace diff --git a/lib/pages/chat_list/status_msg_list.dart b/lib/pages/chat_list/status_msg_list.dart index db347292f..9b69e2a16 100644 --- a/lib/pages/chat_list/status_msg_list.dart +++ b/lib/pages/chat_list/status_msg_list.dart @@ -125,7 +125,7 @@ class PresenceAvatar extends StatelessWidget { final statusMsgBubbleElevation = Theme.of(context).appBarTheme.scrolledUnderElevation ?? 4; final statusMsgBubbleShadowColor = - Theme.of(context).colorScheme.onBackground; + Theme.of(context).colorScheme.onSurface; final statusMsgBubbleColor = Colors.white.withAlpha(245); return Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), diff --git a/lib/pages/homeserver_picker/homeserver_app_bar.dart b/lib/pages/homeserver_picker/homeserver_app_bar.dart index 9ae168f97..c5f3f6b01 100644 --- a/lib/pages/homeserver_picker/homeserver_app_bar.dart +++ b/lib/pages/homeserver_picker/homeserver_app_bar.dart @@ -92,8 +92,8 @@ class HomeserverAppBar extends StatelessWidget { ) : null, fillColor: FluffyThemes.isColumnMode(context) - ? Theme.of(context).colorScheme.background - : Theme.of(context).colorScheme.surfaceVariant, + ? Theme.of(context).colorScheme.surface + : Theme.of(context).colorScheme.surfaceContainerHighest, prefixText: '${L10n.of(context)!.homeserver}: ', hintText: L10n.of(context)!.enterYourHomeserver, suffixIcon: const Icon(Icons.search), diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index 67f4ae360..ce86abec0 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -32,7 +32,7 @@ class HomeserverPickerView extends StatelessWidget { appBar: AppBar( titleSpacing: 12, automaticallyImplyLeading: false, - surfaceTintColor: Theme.of(context).colorScheme.background, + surfaceTintColor: Theme.of(context).colorScheme.surface, title: HomeserverAppBar(controller: controller), ), body: Column( @@ -207,9 +207,9 @@ class _LoginButton extends StatelessWidget { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(99), ), - foregroundColor: Theme.of(context).colorScheme.onBackground, + foregroundColor: Theme.of(context).colorScheme.onSurface, backgroundColor: withBorder - ? Theme.of(context).colorScheme.background + ? Theme.of(context).colorScheme.surface : Colors.transparent, ), onPressed: onPressed, diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index 2ee1b558b..80dae7a79 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -23,8 +23,8 @@ class LoginView extends StatelessWidget { final titleParts = title.split(homeserver); final textFieldFillColor = FluffyThemes.isColumnMode(context) - ? Theme.of(context).colorScheme.background - : Theme.of(context).colorScheme.surfaceVariant; + ? Theme.of(context).colorScheme.surface + : Theme.of(context).colorScheme.surfaceContainerHighest; return LoginScaffold( enforceMobileMode: Matrix.of(context).client.isLogged(), diff --git a/lib/pages/new_group/new_group_view.dart b/lib/pages/new_group/new_group_view.dart index d2a4920d7..a00ba3754 100644 --- a/lib/pages/new_group/new_group_view.dart +++ b/lib/pages/new_group/new_group_view.dart @@ -105,12 +105,12 @@ class NewGroupView extends StatelessWidget { SwitchListTile.adaptive( secondary: Icon( Icons.lock_outlined, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), title: Text( L10n.of(context)!.enableEncryption, style: TextStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), ), value: !controller.publicGroup, diff --git a/lib/pages/settings/settings_view.dart b/lib/pages/settings/settings_view.dart index c9ca5a0ff..a709f46f6 100644 --- a/lib/pages/settings/settings_view.dart +++ b/lib/pages/settings/settings_view.dart @@ -37,7 +37,7 @@ class SettingsView extends StatelessWidget { ], ), body: ListTileTheme( - iconColor: Theme.of(context).colorScheme.onBackground, + iconColor: Theme.of(context).colorScheme.onSurface, child: ListView( key: const Key('SettingsListViewContent'), children: [ @@ -103,7 +103,7 @@ class SettingsView extends StatelessWidget { ), style: TextButton.styleFrom( foregroundColor: - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, ), label: Text( displayname, diff --git a/lib/pages/settings_password/settings_password_view.dart b/lib/pages/settings_password/settings_password_view.dart index dd81fa122..813bebd18 100644 --- a/lib/pages/settings_password/settings_password_view.dart +++ b/lib/pages/settings_password/settings_password_view.dart @@ -23,7 +23,7 @@ class SettingsPasswordView extends StatelessWidget { ], ), body: ListTileTheme( - iconColor: Theme.of(context).colorScheme.onBackground, + iconColor: Theme.of(context).colorScheme.onSurface, child: MaxWidthBody( child: Padding( padding: const EdgeInsets.all(16.0), diff --git a/lib/pages/settings_security/settings_security_view.dart b/lib/pages/settings_security/settings_security_view.dart index ab197a910..49b39d750 100644 --- a/lib/pages/settings_security/settings_security_view.dart +++ b/lib/pages/settings_security/settings_security_view.dart @@ -21,7 +21,7 @@ class SettingsSecurityView extends StatelessWidget { return Scaffold( appBar: AppBar(title: Text(L10n.of(context)!.security)), body: ListTileTheme( - iconColor: Theme.of(context).colorScheme.onBackground, + iconColor: Theme.of(context).colorScheme.onSurface, child: MaxWidthBody( child: FutureBuilder( future: Matrix.of(context) diff --git a/lib/pages/settings_style/settings_style_view.dart b/lib/pages/settings_style/settings_style_view.dart index cf7348021..0286ff700 100644 --- a/lib/pages/settings_style/settings_style_view.dart +++ b/lib/pages/settings_style/settings_style_view.dart @@ -90,7 +90,7 @@ class SettingsStyleView extends StatelessWidget { size: 16, color: Theme.of(context) .colorScheme - .onBackground, + .onSurface, ), ), Text( @@ -99,7 +99,7 @@ class SettingsStyleView extends StatelessWidget { style: TextStyle( color: Theme.of(context) .colorScheme - .onBackground, + .onSurface, ), ), ], diff --git a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart index eb3ce54d3..883a48066 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet_view.dart @@ -119,7 +119,8 @@ class UserBottomSheetView extends StatelessWidget { Padding( padding: const EdgeInsets.all(12.0), child: Material( - color: Theme.of(context).colorScheme.surfaceVariant, + color: + Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: BorderRadius.circular(AppConfig.borderRadius), child: ListTile( @@ -136,7 +137,7 @@ class UserBottomSheetView extends StatelessWidget { TextButton.icon( style: TextButton.styleFrom( backgroundColor: - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, foregroundColor: Theme.of(context).colorScheme.primary, ), @@ -205,7 +206,7 @@ class UserBottomSheetView extends StatelessWidget { ), style: TextButton.styleFrom( foregroundColor: - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, ), label: Text( displayname, diff --git a/lib/widgets/avatar.dart b/lib/widgets/avatar.dart index 23133fad3..a22f3602d 100644 --- a/lib/widgets/avatar.dart +++ b/lib/widgets/avatar.dart @@ -99,7 +99,7 @@ class Avatar extends StatelessWidget { height: 16, decoration: BoxDecoration( color: presenceBackgroundColor ?? - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.circular(32), ), alignment: Alignment.center, @@ -111,7 +111,7 @@ class Avatar extends StatelessWidget { borderRadius: BorderRadius.circular(16), border: Border.all( width: 1, - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, ), ), ), diff --git a/lib/widgets/layouts/login_scaffold.dart b/lib/widgets/layouts/login_scaffold.dart index 00760abf2..b253ec4fa 100644 --- a/lib/widgets/layouts/login_scaffold.dart +++ b/lib/widgets/layouts/login_scaffold.dart @@ -42,11 +42,11 @@ class LoginScaffold extends StatelessWidget { body: body, backgroundColor: isMobileMode ? null - : Theme.of(context).colorScheme.background.withOpacity(0.8), + : Theme.of(context).colorScheme.surface.withOpacity(0.8), bottomNavigationBar: isMobileMode ? Material( elevation: 4, - shadowColor: Theme.of(context).colorScheme.onBackground, + shadowColor: Theme.of(context).colorScheme.onSurface, child: const _PrivacyButtons( mainAxisAlignment: MainAxisAlignment.center, ), diff --git a/lib/widgets/unread_rooms_badge.dart b/lib/widgets/unread_rooms_badge.dart index a808c14f3..006691769 100644 --- a/lib/widgets/unread_rooms_badge.dart +++ b/lib/widgets/unread_rooms_badge.dart @@ -37,7 +37,7 @@ class UnreadRoomsBadge extends StatelessWidget { badgeColor: Theme.of(context).colorScheme.primary, elevation: 4, borderSide: BorderSide( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, width: 2, ), ), diff --git a/pubspec.lock b/pubspec.lock index 9809a7070..497bd3266 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1017,10 +1017,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" io: dependency: transitive description: @@ -1090,26 +1090,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" license_checker: dependency: "direct dev" description: @@ -1218,10 +1218,10 @@ packages: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" mgrs_dart: dependency: transitive description: @@ -1983,26 +1983,26 @@ packages: dependency: transitive description: name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.24.9" + version: "1.25.2" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" test_core: dependency: transitive description: name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.6.0" timezone: dependency: transitive description: @@ -2295,10 +2295,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" wakelock_plus: dependency: "direct main" description: From 9c3011d34828e04ba0d934010e52ac0ee676bb74 Mon Sep 17 00:00:00 2001 From: "lauren n. liberda" Date: Thu, 16 May 2024 09:13:47 +0200 Subject: [PATCH 02/12] ci: run `flutter gen-l10n` on code_tests --- .github/workflows/integrate.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 784736a4d..d487d6b4b 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -15,6 +15,7 @@ jobs: flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - run: flutter pub get + - run: flutter gen-l10n - name: Check formatting run: dart format lib/ test/ --set-exit-if-changed - name: Check import formatting From 50a8ac0dc94f347bba1b90ccc6f925eb7ffa9e43 Mon Sep 17 00:00:00 2001 From: "lauren n. liberda" Date: Thu, 23 May 2024 03:57:24 +0200 Subject: [PATCH 03/12] chore: upgrade flutter to 3.22.1 --- .github/workflows/versions.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/versions.env b/.github/workflows/versions.env index 496817358..12f38094d 100644 --- a/.github/workflows/versions.env +++ b/.github/workflows/versions.env @@ -1,2 +1,2 @@ -FLUTTER_VERSION=3.22.0 +FLUTTER_VERSION=3.22.1 JAVA_VERSION=17 From 3b76219f686ad327af4ebc886b60b5aa24a2280d Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 08:27:43 +0200 Subject: [PATCH 04/12] chore: Follow up listen on streams --- lib/pages/chat/typing_indicators.dart | 156 ++++++++++++++------------ 1 file changed, 83 insertions(+), 73 deletions(-) diff --git a/lib/pages/chat/typing_indicators.dart b/lib/pages/chat/typing_indicators.dart index e816f465d..fe630ecd8 100644 --- a/lib/pages/chat/typing_indicators.dart +++ b/lib/pages/chat/typing_indicators.dart @@ -14,80 +14,90 @@ class TypingIndicators extends StatelessWidget { @override Widget build(BuildContext context) { - final typingUsers = controller.room.typingUsers - ..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID); - const topPadding = 20.0; - const bottomPadding = 4.0; - - return Container( - width: double.infinity, - alignment: Alignment.center, - child: AnimatedContainer( - constraints: - const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5), - height: typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding, - duration: FluffyThemes.animationDuration, - curve: FluffyThemes.animationCurve, - alignment: controller.timeline!.events.isNotEmpty && - controller.timeline!.events.first.senderId == - Matrix.of(context).client.userID - ? Alignment.topRight - : Alignment.topLeft, - clipBehavior: Clip.hardEdge, - decoration: const BoxDecoration(), - padding: const EdgeInsets.only( - left: 8.0, - bottom: bottomPadding, - ), - child: Row( - children: [ - SizedBox( - height: Avatar.defaultSize, - width: typingUsers.length < 2 - ? Avatar.defaultSize - : Avatar.defaultSize + 16, - child: Stack( - children: [ - if (typingUsers.isNotEmpty) - Avatar( - mxContent: typingUsers.first.avatarUrl, - name: typingUsers.first.calcDisplayname(), - ), - if (typingUsers.length == 2) - Padding( - padding: const EdgeInsets.only(left: 16), - child: Avatar( - mxContent: typingUsers.length == 2 - ? typingUsers.last.avatarUrl - : null, - name: typingUsers.length == 2 - ? typingUsers.last.calcDisplayname() - : '+${typingUsers.length - 1}', - ), - ), - ], - ), - ), - const SizedBox(width: 8), - Padding( - padding: const EdgeInsets.only(top: topPadding), - child: Material( - color: Theme.of(context).colorScheme.surfaceVariant, - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(2), - topRight: Radius.circular(AppConfig.borderRadius), - bottomLeft: Radius.circular(AppConfig.borderRadius), - bottomRight: Radius.circular(AppConfig.borderRadius), - ), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: typingUsers.isEmpty ? null : const _TypingDots(), - ), - ), - ), - ], - ), + return StreamBuilder( + stream: controller.room.client.onSync.stream.where( + (syncUpdate) => + syncUpdate.rooms?.join?[controller.room.id]?.ephemeral + ?.any((ephemeral) => ephemeral.type == 'm.typing') ?? + false, ), + builder: (context, _) { + final typingUsers = controller.room.typingUsers + ..removeWhere((u) => u.stateKey == Matrix.of(context).client.userID); + const topPadding = 20.0; + const bottomPadding = 4.0; + return Container( + width: double.infinity, + alignment: Alignment.center, + child: AnimatedContainer( + constraints: + const BoxConstraints(maxWidth: FluffyThemes.columnWidth * 2.5), + height: + typingUsers.isEmpty ? 0 : Avatar.defaultSize + bottomPadding, + duration: FluffyThemes.animationDuration, + curve: FluffyThemes.animationCurve, + alignment: controller.timeline!.events.isNotEmpty && + controller.timeline!.events.first.senderId == + Matrix.of(context).client.userID + ? Alignment.topRight + : Alignment.topLeft, + clipBehavior: Clip.hardEdge, + decoration: const BoxDecoration(), + padding: const EdgeInsets.only( + left: 8.0, + bottom: bottomPadding, + ), + child: Row( + children: [ + SizedBox( + height: Avatar.defaultSize, + width: typingUsers.length < 2 + ? Avatar.defaultSize + : Avatar.defaultSize + 16, + child: Stack( + children: [ + if (typingUsers.isNotEmpty) + Avatar( + mxContent: typingUsers.first.avatarUrl, + name: typingUsers.first.calcDisplayname(), + ), + if (typingUsers.length == 2) + Padding( + padding: const EdgeInsets.only(left: 16), + child: Avatar( + mxContent: typingUsers.length == 2 + ? typingUsers.last.avatarUrl + : null, + name: typingUsers.length == 2 + ? typingUsers.last.calcDisplayname() + : '+${typingUsers.length - 1}', + ), + ), + ], + ), + ), + const SizedBox(width: 8), + Padding( + padding: const EdgeInsets.only(top: topPadding), + child: Material( + color: Theme.of(context).colorScheme.surfaceVariant, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(2), + topRight: Radius.circular(AppConfig.borderRadius), + bottomLeft: Radius.circular(AppConfig.borderRadius), + bottomRight: Radius.circular(AppConfig.borderRadius), + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: typingUsers.isEmpty ? null : const _TypingDots(), + ), + ), + ), + ], + ), + ), + ); + }, ); } } From f7096d5dee0f3383bdfe50ea189ebe5eb10bb4b4 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 08:39:05 +0200 Subject: [PATCH 05/12] refactor: Delete database file on failed app start --- .../builder.dart | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/utils/matrix_sdk_extensions/flutter_matrix_dart_sdk_database/builder.dart b/lib/utils/matrix_sdk_extensions/flutter_matrix_dart_sdk_database/builder.dart index ff6d4a8c0..1add432d2 100644 --- a/lib/utils/matrix_sdk_extensions/flutter_matrix_dart_sdk_database/builder.dart +++ b/lib/utils/matrix_sdk_extensions/flutter_matrix_dart_sdk_database/builder.dart @@ -35,6 +35,12 @@ Future flutterMatrixSdkDatabaseBuilder(Client client) async { ), ); + // Delete database file: + if (database == null && !kIsWeb) { + final dbFile = File(await _getDatabasePath(client.clientName)); + if (await dbFile.exists()) await dbFile.delete(); + } + try { // Send error notification: final l10n = lookupL10n(PlatformDispatcher.instance.locale); @@ -61,9 +67,6 @@ Future _constructDatabase(Client client) async { final cipher = await getDatabaseCipher(); - final databaseDirectory = PlatformInfos.isIOS || PlatformInfos.isMacOS - ? await getLibraryDirectory() - : await getApplicationSupportDirectory(); Directory? fileStorageLocation; try { fileStorageLocation = await getTemporaryDirectory(); @@ -73,7 +76,7 @@ Future _constructDatabase(Client client) async { ); } - final path = join(databaseDirectory.path, '${client.clientName}.sqlite'); + final path = await _getDatabasePath(client.clientName); // fix dlopen for old Android await applyWorkaroundToOpenSqlCipherOnOldAndroidVersions(); @@ -118,6 +121,14 @@ Future _constructDatabase(Client client) async { ); } +Future _getDatabasePath(String clientName) async { + final databaseDirectory = PlatformInfos.isIOS || PlatformInfos.isMacOS + ? await getLibraryDirectory() + : await getApplicationSupportDirectory(); + + return join(databaseDirectory.path, '$clientName.sqlite'); +} + Future _migrateLegacyLocation( String sqlFilePath, String clientName, From 11d6164bc7de6a13716eb58ba05840697fe615b5 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 08:42:14 +0200 Subject: [PATCH 06/12] chore: Follow up adapt to new flutter 3.22 material colors --- lib/config/themes.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/config/themes.dart b/lib/config/themes.dart index 58feeab70..fc1ec0b4c 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -107,6 +107,8 @@ abstract class FluffyThemes { : null, surfaceTintColor: FluffyThemes.isColumnMode(context) ? colorScheme.surface : null, + backgroundColor: + FluffyThemes.isColumnMode(context) ? colorScheme.surface : null, systemOverlayStyle: SystemUiOverlayStyle( statusBarColor: Colors.transparent, statusBarIconBrightness: brightness.reversed, From 244962fdfc3e461f086e7616ad9980513627d050 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 08:42:33 +0200 Subject: [PATCH 07/12] chore: Follow up formatting --- lib/pages/chat/typing_indicators.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat/typing_indicators.dart b/lib/pages/chat/typing_indicators.dart index e13686818..0eb2c0803 100644 --- a/lib/pages/chat/typing_indicators.dart +++ b/lib/pages/chat/typing_indicators.dart @@ -80,7 +80,8 @@ class TypingIndicators extends StatelessWidget { Padding( padding: const EdgeInsets.only(top: topPadding), child: Material( - color: Theme.of(context).colorScheme.surfaceContainerHighest, + color: + Theme.of(context).colorScheme.surfaceContainerHighest, borderRadius: const BorderRadius.only( topLeft: Radius.circular(2), topRight: Radius.circular(AppConfig.borderRadius), From 1e08e6276296fd0fd84717f50316d09ea7b047c4 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 09:00:37 +0200 Subject: [PATCH 08/12] docs: Add pull request template --- .../pull_request_template.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 000000000..c92536427 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,21 @@ +*Thank you so much for your contribution to FluffyChat ❤️❤️❤️* + +Please make sure that your Pull Request meet the following **acceptance criteria**: + +- [ ] Code formatting and import sorting has been done with `dart format lib/ test/` and `dart run import_sorter:main --no-comments` +- [ ] The commit message uses the format of [Conventional Commits](https://www.conventionalcommits.org) +- [ ] The commit message describes what has been changed, why it has been changed and how it has been changed +- [ ] Every new feature or change of the design/GUI is linked to an approved design proposal in an issue +- [ ] Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership + + +### Pull Request has been tested on: + +- [ ] Android +- [ ] iOS +- [ ] Browser (Chromium based) +- [ ] Browser (Firefox based) +- [ ] Browser (WebKit based) +- [ ] Desktop Linux +- [ ] Desktop Windows +- [ ] Desktop macOS \ No newline at end of file From 18626be8553ec9d7b72f13a70b6ba58d0802245f Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 09:04:54 +0200 Subject: [PATCH 09/12] chore: Follow up bottom nav bar colors --- lib/pages/chat_list/chat_list_view.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index 163a7fc72..9cd31e0e0 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -190,6 +190,8 @@ class ChatListView extends StatelessWidget { NavigationDestinationLabelBehavior.alwaysShow, shadowColor: Theme.of(context).colorScheme.onSurface, + backgroundColor: + Theme.of(context).colorScheme.surface, surfaceTintColor: Theme.of(context).colorScheme.surface, selectedIndex: controller.selectedIndex, From d82211b7af89a41cb65fdfb30d6da000dddc2b66 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 09:06:37 +0200 Subject: [PATCH 10/12] chore: Change default timeout to 30 min --- lib/utils/client_manager.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index e3741fd30..3a14e4e79 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -120,7 +120,7 @@ abstract class ClientManager { }, nativeImplementations: nativeImplementations, customImageResizer: PlatformInfos.isMobile ? customImageResizer : null, - defaultNetworkRequestTimeout: const Duration(minutes: 5), + defaultNetworkRequestTimeout: const Duration(minutes: 30), enableDehydratedDevices: true, ); } From 2fbeaf0b66f6a8cf2bc411b51e110aff6ad14423 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 09:57:21 +0200 Subject: [PATCH 11/12] build: Use flutter 3.19 for snapcraft --- snap/snapcraft.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 86b7eb241..4454b40cc 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -68,6 +68,9 @@ parts: plugin: flutter source: . override-build: | + # Workaround for Flutter Linux broken on 3.22 + curl -fsSL https://fvm.app/install.sh | bash + fvm use 3.19.6 # Workaround for Flutter build error: rm -rf build craftctl default From d2661375923eacabad118ce878136d26f7714af0 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Sun, 26 May 2024 10:18:45 +0200 Subject: [PATCH 12/12] build: remove not working workaround for snapcraft build --- snap/snapcraft.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 4454b40cc..86b7eb241 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -68,9 +68,6 @@ parts: plugin: flutter source: . override-build: | - # Workaround for Flutter Linux broken on 3.22 - curl -fsSL https://fvm.app/install.sh | bash - fvm use 3.19.6 # Workaround for Flutter build error: rm -rf build craftctl default