TF-1167 Improve more button in recipients of EmailView
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/views/image/avatar_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:model/email/presentation_email.dart';
|
||||
import 'package:model/extensions/presentation_email_extension.dart';
|
||||
|
||||
class EmailAvatarBuilder extends StatelessWidget {
|
||||
|
||||
final PresentationEmail emailSelected;
|
||||
|
||||
const EmailAvatarBuilder({
|
||||
Key? key,
|
||||
required this.emailSelected
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return (AvatarBuilder()
|
||||
..text(emailSelected.getAvatarText())
|
||||
..size(48)
|
||||
..addTextStyle(const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 21,
|
||||
color: Colors.white))
|
||||
..backgroundColor(AppColor.colorAvatar)
|
||||
..avatarColor(emailSelected.avatarColors))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
typedef OnTapMaterialTextButton = Function();
|
||||
|
||||
class MaterialTextButton extends StatelessWidget {
|
||||
|
||||
final String label;
|
||||
final OnTapMaterialTextButton onTap;
|
||||
final double borderRadius;
|
||||
final Color? labelColor;
|
||||
final double labelSize;
|
||||
final FontWeight? labelWeight;
|
||||
final TextStyle? customStyle;
|
||||
final EdgeInsets? padding;
|
||||
final TextOverflow? overflow;
|
||||
final bool? softWrap;
|
||||
|
||||
const MaterialTextButton({
|
||||
Key? key,
|
||||
required this.label,
|
||||
required this.onTap,
|
||||
this.borderRadius = 12,
|
||||
this.labelColor,
|
||||
this.labelSize = 15,
|
||||
this.labelWeight,
|
||||
this.customStyle,
|
||||
this.padding,
|
||||
this.overflow,
|
||||
this.softWrap
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
customBorder: RoundedRectangleBorder(borderRadius: BorderRadius.circular(borderRadius)),
|
||||
child: Padding(
|
||||
padding: padding ?? const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
|
||||
child: Text(
|
||||
label,
|
||||
overflow: overflow,
|
||||
softWrap: softWrap,
|
||||
style: customStyle ?? TextStyle(
|
||||
fontSize: labelSize,
|
||||
color: labelColor ?? AppColor.colorTextButton,
|
||||
fontWeight: labelWeight ?? FontWeight.normal
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user