TF-2116 Create TitleComposer widget and style

(cherry picked from commit e56b2c28728ddc44e19d8cdbe4865ea0ba5e3d9a)
This commit is contained in:
dab246
2023-09-06 11:47:04 +07:00
committed by Dat H. Pham
parent f84f2ce4fd
commit 761c2560ff
2 changed files with 39 additions and 0 deletions
@@ -0,0 +1,10 @@
import 'package:flutter/material.dart';
class TitleComposerWidgetStyle {
static const TextStyle textStyle = TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: Colors.black
);
}
@@ -0,0 +1,29 @@
import 'package:core/presentation/extensions/capitalize_extension.dart';
import 'package:core/presentation/utils/style_utils.dart';
import 'package:flutter/material.dart';
import 'package:tmail_ui_user/features/composer/presentation/styles/title_composer_widget_style.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
class TitleComposerWidget extends StatelessWidget {
final String emailSubject;
const TitleComposerWidget({
super.key,
required this.emailSubject,
});
@override
Widget build(BuildContext context) {
return Text(
emailSubject.isNotEmpty == true
? emailSubject
: AppLocalizations.of(context).new_message.capitalizeFirstEach,
maxLines: 1,
textAlign: TextAlign.center,
overflow: CommonTextStyle.defaultTextOverFlow,
softWrap: CommonTextStyle.defaultSoftWrap,
style: TitleComposerWidgetStyle.textStyle,
);
}
}