TF-3005 Apply new design app bar contact view
This commit is contained in:
@@ -1,48 +1,64 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/views/button/icon_button_web.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/button/tmail_button_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/contact/presentation/styles/app_bar_contact_widget_style.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class AppBarContactWidget extends StatelessWidget {
|
||||
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final String? title;
|
||||
final ImagePaths imagePaths;
|
||||
final ResponsiveUtils responsiveUtils;
|
||||
final VoidCallback onCloseContactView;
|
||||
|
||||
final Function()? onCloseContactView;
|
||||
|
||||
AppBarContactWidget({
|
||||
Key? key,
|
||||
this.onCloseContactView,
|
||||
const AppBarContactWidget({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.imagePaths,
|
||||
required this.responsiveUtils,
|
||||
required this.onCloseContactView,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(alignment: Alignment.center, children: [
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: buildIconWeb(
|
||||
icon: SvgPicture.asset(
|
||||
_imagePaths.icClose,
|
||||
colorFilter: AppColor.colorCloseButton.asFilter(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.fill),
|
||||
minSize: 25,
|
||||
iconSize: 25,
|
||||
iconPadding: const EdgeInsets.all(5),
|
||||
splashRadius: 15,
|
||||
tooltip: AppLocalizations.of(context).close,
|
||||
onTap: onCloseContactView),
|
||||
return Container(
|
||||
height: 56,
|
||||
color: Colors.white,
|
||||
padding: AppBarContactWidgetStyle.getAppBarPadding(
|
||||
context,
|
||||
responsiveUtils
|
||||
),
|
||||
Center(child: Text(
|
||||
AppLocalizations.of(context).contact,
|
||||
style: const TextStyle(
|
||||
width: double.infinity,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
title ?? AppLocalizations.of(context).contact,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black))),
|
||||
]);
|
||||
color: Colors.black
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
PositionedDirectional(
|
||||
end: 0,
|
||||
child: TMailButtonWidget.fromIcon(
|
||||
icon: imagePaths.icClose,
|
||||
tooltipMessage: AppLocalizations.of(context).close,
|
||||
iconSize: 24,
|
||||
padding: const EdgeInsets.all(3),
|
||||
iconColor: AppColor.colorCloseButton,
|
||||
backgroundColor: AppColor.colorCloseButton.withOpacity(0.12),
|
||||
onTapActionCallback: onCloseContactView,
|
||||
)
|
||||
),
|
||||
]
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user