fix: invite error toast

This commit is contained in:
Lucas.Xu 2024-08-17 17:52:06 +08:00
parent 5497f7f219
commit 03efc24fad
2 changed files with 24 additions and 20 deletions

View File

@ -255,6 +255,7 @@ class _InviteMemberPageState extends State<_InviteMemberPage> {
if (!isEmail(email)) { if (!isEmail(email)) {
return showToastNotification( return showToastNotification(
context, context,
type: ToastificationType.error,
message: LocaleKeys.settings_appearance_members_emailInvalidError.tr(), message: LocaleKeys.settings_appearance_members_emailInvalidError.tr(),
); );
} }

View File

@ -353,16 +353,24 @@ class _MToast extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final hintText = FlowyText.regular(
message,
fontSize: 16.0,
figmaLineHeight: 18.0,
color: Colors.white,
maxLines: 10,
);
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
padding: const EdgeInsets.only(bottom: 100), padding: const EdgeInsets.only(bottom: 100, left: 16, right: 16),
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 13.0), padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 13.0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0), borderRadius: BorderRadius.circular(12.0),
color: const Color(0xE5171717), color: const Color(0xE5171717),
), ),
child: Row( child: type == ToastificationType.success
? Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (type == ToastificationType.success) ...[ if (type == ToastificationType.success) ...[
@ -372,15 +380,10 @@ class _MToast extends StatelessWidget {
), ),
const HSpace(8.0), const HSpace(8.0),
], ],
FlowyText.regular( hintText,
message,
fontSize: 16.0,
figmaLineHeight: 18.0,
color: Colors.white,
maxLines: 3,
),
], ],
), )
: hintText,
), ),
); );
} }