From f81cb189b87e78e7c9deb157e8d2eb56578b757c Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Thu, 16 Nov 2023 01:20:44 +0700 Subject: [PATCH 1/3] TW-909: Fix color for checkbox in forward list --- lib/pages/forward/recent_chat_list.dart | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/pages/forward/recent_chat_list.dart b/lib/pages/forward/recent_chat_list.dart index 9317866a26..126be76005 100644 --- a/lib/pages/forward/recent_chat_list.dart +++ b/lib/pages/forward/recent_chat_list.dart @@ -46,13 +46,6 @@ class RecentChatList extends StatelessWidget { Checkbox( value: selected, onChanged: (value) => onSelectedChat(room.id), - fillColor: MaterialStatePropertyAll( - Theme.of(context).primaryColor, - ), - side: BorderSide( - width: 2.0, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), ), Avatar( mxContent: room.avatar, From 2513f993113c0dfb7c28ca15bf4eca5ab977ec2c Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Thu, 16 Nov 2023 01:21:35 +0700 Subject: [PATCH 2/3] TW-909: Remove Archive action in context menu --- .../adaptive_scaffold_primary_navigation.dart | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart index 5a883f93e3..7486250453 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart @@ -39,16 +39,6 @@ class _AdaptiveScaffoldPrimaryNavigationState List> _bundleMenuItems(BuildContext context) { return >[ - PopupMenuItem( - value: SettingsAction.archive, - child: Row( - children: [ - const Icon(Icons.archive_outlined), - const SizedBox(width: 18), - Text(L10n.of(context)!.archive), - ], - ), - ), PopupMenuItem( value: SettingsAction.settings, child: Row( From effa6e9b86be86ee738aca0b53a5f20d5a263f23 Mon Sep 17 00:00:00 2001 From: HuyNguyen Date: Thu, 16 Nov 2023 10:43:23 +0700 Subject: [PATCH 3/3] TW-909: Remove popup menu when click avt --- .../adaptive_scaffold_primary_navigation.dart | 21 ------------------ ...tive_scaffold_primary_navigation_view.dart | 22 +++++-------------- .../app_adaptive_scaffold_body_view.dart | 5 ----- 3 files changed, 6 insertions(+), 42 deletions(-) diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart index 7486250453..184e838652 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart @@ -1,25 +1,21 @@ import 'dart:async'; import 'package:fluffychat/event/twake_inapp_event_types.dart'; -import 'package:fluffychat/pages/chat_list/client_chooser_button.dart'; import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart'; import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; import 'package:matrix/matrix.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; class AdaptiveScaffoldPrimaryNavigation extends StatefulWidget { final List getNavigationRailDestinations; final int? selectedIndex; final Function(int)? onDestinationSelected; - final Function(Object)? onSelected; const AdaptiveScaffoldPrimaryNavigation({ super.key, required this.getNavigationRailDestinations, this.selectedIndex, this.onDestinationSelected, - this.onSelected, }); @override @@ -37,21 +33,6 @@ class _AdaptiveScaffoldPrimaryNavigationState Client get client => Matrix.of(context).client; - List> _bundleMenuItems(BuildContext context) { - return >[ - PopupMenuItem( - value: SettingsAction.settings, - child: Row( - children: [ - const Icon(Icons.settings_outlined), - const SizedBox(width: 18), - Text(L10n.of(context)!.settings), - ], - ), - ), - ]; - } - void _getCurrentProfile(Client client) async { final profile = await client.getProfileFromUserId( client.userID!, @@ -93,9 +74,7 @@ class _AdaptiveScaffoldPrimaryNavigationState getNavigationRailDestinations: widget.getNavigationRailDestinations, selectedIndex: widget.selectedIndex, onDestinationSelected: widget.onDestinationSelected, - onSelected: widget.onSelected, profileNotifier: profileNotifier, - itemBuilder: _bundleMenuItems, ); } } diff --git a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart index dd18f4a9b1..475aa16aeb 100644 --- a/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart +++ b/lib/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation_view.dart @@ -9,18 +9,14 @@ class AdaptiveScaffoldPrimaryNavigationView extends StatelessWidget { final List getNavigationRailDestinations; final int? selectedIndex; final Function(int)? onDestinationSelected; - final Function(Object)? onSelected; final ValueNotifier profileNotifier; - final List> Function(BuildContext) itemBuilder; const AdaptiveScaffoldPrimaryNavigationView({ super.key, required this.getNavigationRailDestinations, this.selectedIndex, this.onDestinationSelected, - this.onSelected, required this.profileNotifier, - required this.itemBuilder, }); @override @@ -59,18 +55,12 @@ class AdaptiveScaffoldPrimaryNavigationView extends StatelessWidget { ValueListenableBuilder( valueListenable: profileNotifier, builder: (context, profile, _) { - return PopupMenuButton( - padding: EdgeInsets.zero, - onSelected: onSelected, - itemBuilder: itemBuilder, - child: Avatar( - mxContent: profile.avatarUrl, - name: profile.displayName ?? - Matrix.of(context).client.userID!.localpart, - size: AdaptiveScaffoldPrimaryNavigationStyle.avatarSize, - fontSize: - ClientChooserButtonStyle.avatarFontSizeInAppBar, - ), + return Avatar( + mxContent: profile.avatarUrl, + name: profile.displayName ?? + Matrix.of(context).client.userID!.localpart, + size: AdaptiveScaffoldPrimaryNavigationStyle.avatarSize, + fontSize: ClientChooserButtonStyle.avatarFontSizeInAppBar, ); }, ), diff --git a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart index c61e31a8b6..c4549ec9af 100644 --- a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart +++ b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart @@ -71,7 +71,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget { return _PrimaryNavigationBarBuilder( activeNavigationBar: activeNavigationBar, onDestinationSelected: onDestinationSelected, - onClientSelected: onClientSelected, destinations: getNavigationDestinations(context), ); } @@ -267,14 +266,11 @@ class _PrimaryNavigationBarBuilder extends StatelessWidget { final OnDestinationSelected onDestinationSelected; - final OnClientSelectedSetting onClientSelected; - final List destinations; const _PrimaryNavigationBarBuilder({ required this.activeNavigationBar, required this.onDestinationSelected, - required this.onClientSelected, required this.destinations, }); @@ -286,7 +282,6 @@ class _PrimaryNavigationBarBuilder extends StatelessWidget { .map((_) => AdaptiveScaffold.toRailDestination(_)) .toList(), onDestinationSelected: onDestinationSelected, - onSelected: (object) => onClientSelected(object, context), ); } }