Apply new style modal profile UI for desktop
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/theme_utils.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/copy_subaddress_widget.dart';
|
||||
|
||||
class EmailAddressWithCopyWidget extends StatelessWidget {
|
||||
final String label;
|
||||
final String copyLabelIcon;
|
||||
final OnCopyButtonAction onCopyButtonAction;
|
||||
final TextStyle? textStyle;
|
||||
final Color? copyIconColor;
|
||||
|
||||
const EmailAddressWithCopyWidget({
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.copyLabelIcon,
|
||||
required this.onCopyButtonAction,
|
||||
this.textStyle,
|
||||
this.copyIconColor,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: SelectableText(
|
||||
label,
|
||||
style: textStyle ?? ThemeUtils.textStyleM3BodyMedium,
|
||||
maxLines: 1,
|
||||
),
|
||||
),
|
||||
if (label.isNotEmpty)
|
||||
TMailButtonWidget.fromIcon(
|
||||
icon: copyLabelIcon,
|
||||
backgroundColor: Colors.transparent,
|
||||
iconSize: 20,
|
||||
iconColor: copyIconColor ??
|
||||
AppColor.textSecondary.withOpacity(0.48),
|
||||
padding: const EdgeInsets.all(5),
|
||||
onTapActionCallback: onCopyButtonAction,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
class UserAvatarBuilder extends StatelessWidget {
|
||||
final String username;
|
||||
final double? size;
|
||||
final TextStyle? textStyle;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
final VoidCallback? onTapAction;
|
||||
|
||||
@@ -12,6 +13,7 @@ class UserAvatarBuilder extends StatelessWidget {
|
||||
Key? key,
|
||||
required this.username,
|
||||
this.size,
|
||||
this.textStyle,
|
||||
this.padding,
|
||||
this.onTapAction,
|
||||
}) : super(key: key);
|
||||
@@ -19,9 +21,9 @@ class UserAvatarBuilder extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final avatarBuilder = AvatarBuilder()
|
||||
..text(username.firstLetterToUpperCase)
|
||||
..text(username)
|
||||
..size(size ?? 32)
|
||||
..addTextStyle(Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
..addTextStyle(textStyle ?? Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: Colors.white,
|
||||
))
|
||||
..avatarColor(username.gradientColors);
|
||||
|
||||
Reference in New Issue
Block a user