fix: update settings menu color (#6039)

* chore: replace settings popup menu backgroundcolor

* fix: invite toast blocked by keyboard
This commit is contained in:
Lucas.Xu 2024-08-26 09:51:57 +08:00 committed by GitHub
parent 62f0307289
commit 2ef74c229c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 2 deletions

View File

@ -28,9 +28,9 @@ class HomePageSettingsPopupMenu extends StatelessWidget {
Radius.circular(12.0),
),
),
// todo: replace it with shadows
shadowColor: const Color(0x68000000),
elevation: 10,
color: Theme.of(context).colorScheme.surface,
child: const Padding(
padding: EdgeInsets.all(8.0),
child: FlowySvg(

View File

@ -34,6 +34,7 @@ class InviteMembersScreen extends StatelessWidget {
titleText: LocaleKeys.settings_appearance_members_label.tr(),
),
body: const _InviteMemberPage(),
resizeToAvoidBottomInset: false,
);
}
}
@ -193,6 +194,9 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
final actionType = actionResult.actionType;
final result = actionResult.result;
// get keyboard height
final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
// only show the result dialog when the action is WorkspaceMemberActionType.add
if (actionType == WorkspaceMemberActionType.add) {
result.fold(
@ -201,6 +205,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
context,
message:
LocaleKeys.settings_appearance_members_addMemberSuccess.tr(),
bottomPadding: keyboardHeight,
);
},
(f) {
@ -216,6 +221,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
showToastNotification(
context,
type: ToastificationType.error,
bottomPadding: keyboardHeight,
message: message,
);
},
@ -227,6 +233,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
context,
message:
LocaleKeys.settings_appearance_members_inviteMemberSuccess.tr(),
bottomPadding: keyboardHeight,
);
},
(f) {
@ -244,6 +251,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
context,
type: ToastificationType.error,
message: message,
bottomPadding: keyboardHeight,
);
},
);
@ -255,6 +263,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
message: LocaleKeys
.settings_appearance_members_removeFromWorkspaceSuccess
.tr(),
bottomPadding: keyboardHeight,
);
},
(f) {
@ -264,6 +273,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
message: LocaleKeys
.settings_appearance_members_removeFromWorkspaceFailed
.tr(),
bottomPadding: keyboardHeight,
);
},
);

View File

@ -303,6 +303,7 @@ void showToastNotification(
required String message,
String? description,
ToastificationType type = ToastificationType.success,
double bottomPadding = 100,
}) {
if (PlatformExtension.isMobile) {
toastification.showCustom(
@ -311,6 +312,7 @@ void showToastNotification(
builder: (_, __) => _MToast(
message: message,
type: type,
bottomPadding: bottomPadding,
),
);
return;
@ -346,10 +348,12 @@ class _MToast extends StatelessWidget {
const _MToast({
required this.message,
this.type = ToastificationType.success,
this.bottomPadding = 100,
});
final String message;
final ToastificationType type;
final double bottomPadding;
@override
Widget build(BuildContext context) {
@ -362,7 +366,7 @@ class _MToast extends StatelessWidget {
);
return Container(
alignment: Alignment.bottomCenter,
padding: const EdgeInsets.only(bottom: 100, left: 16, right: 16),
padding: EdgeInsets.only(bottom: bottomPadding, left: 16, right: 16),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 13.0),
decoration: BoxDecoration(