TF-2116 Create SubjectComposer widget and style
(cherry picked from commit 9458edb30bbd23db3484d71c9d4caff695008f7f)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SubjectComposerWidgetStyle {
|
||||
static const double space = 12;
|
||||
|
||||
static const Color cursorColor = AppColor.primaryColor;
|
||||
static const Color borderColor = AppColor.colorLineComposer;
|
||||
|
||||
static const TextStyle labelTextStyle = TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: AppColor.colorLabelComposer
|
||||
);
|
||||
static const TextStyle inputTextStyle = TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import 'package:core/presentation/views/text/text_field_builder.dart';
|
||||
import 'package:core/utils/direction_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/styles/subject_composer_widget_style.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class SubjectComposerWidget extends StatelessWidget {
|
||||
|
||||
final FocusNode? focusNode;
|
||||
final TextEditingController textController;
|
||||
final ValueChanged<String>? onTextChange;
|
||||
final EdgeInsetsGeometry? margin;
|
||||
final EdgeInsetsGeometry? padding;
|
||||
|
||||
const SubjectComposerWidget({
|
||||
super.key,
|
||||
required this.focusNode,
|
||||
required this.textController,
|
||||
required this.onTextChange,
|
||||
this.margin,
|
||||
this.padding,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: SubjectComposerWidgetStyle.borderColor,
|
||||
width: 1
|
||||
)
|
||||
),
|
||||
),
|
||||
margin: margin,
|
||||
padding: padding,
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'${AppLocalizations.of(context).subject_email}:',
|
||||
style: SubjectComposerWidgetStyle.labelTextStyle
|
||||
),
|
||||
const SizedBox(width:SubjectComposerWidgetStyle.space),
|
||||
Expanded(
|
||||
child: TextFieldBuilder(
|
||||
cursorColor: SubjectComposerWidgetStyle.cursorColor,
|
||||
focusNode: focusNode,
|
||||
onTextChange: onTextChange,
|
||||
maxLines: 1,
|
||||
textDirection: DirectionUtils.getDirectionByLanguage(context),
|
||||
textStyle: SubjectComposerWidgetStyle.inputTextStyle,
|
||||
controller: textController,
|
||||
)
|
||||
)
|
||||
]
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user