TF-4370 Add Description field to Create new Label modal
This commit is contained in:
@@ -55,6 +55,9 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
||||
final ValueNotifier<bool> _createLabelStateNotifier = ValueNotifier(false);
|
||||
final TextEditingController _nameInputController = TextEditingController();
|
||||
final FocusNode _nameInputFocusNode = FocusNode();
|
||||
final TextEditingController _descriptionInputController =
|
||||
TextEditingController();
|
||||
final FocusNode _descriptionInputFocusNode = FocusNode();
|
||||
|
||||
List<String> _labelDisplayNameList = <String>[];
|
||||
Color? _selectedColor;
|
||||
@@ -135,6 +138,12 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildLabelNameInputField(appLocalizations),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: _buildLabelDescriptionInputField(
|
||||
appLocalizations,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 26, bottom: 16),
|
||||
child: Text(
|
||||
@@ -297,6 +306,29 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLabelDescriptionInputField(AppLocalizations appLocalizations) {
|
||||
return LabelInputFieldBuilder(
|
||||
label: appLocalizations.labelDescription,
|
||||
hintText: appLocalizations.labelDescriptionHintText,
|
||||
textEditingController: _descriptionInputController,
|
||||
focusNode: _descriptionInputFocusNode,
|
||||
arrangeHorizontally: false,
|
||||
isLabelHasColon: false,
|
||||
hasMaxLines: false,
|
||||
isFillContainer: true,
|
||||
labelStyle: ThemeUtils.textStyleInter600().copyWith(
|
||||
fontSize: 14,
|
||||
height: 18 / 14,
|
||||
color: Colors.black,
|
||||
),
|
||||
runSpacing: 16,
|
||||
inputFieldMaxWidth: double.infinity,
|
||||
inputFieldHeight: 84,
|
||||
textAlignVertical: TextAlignVertical.top,
|
||||
inputAction: TextInputAction.newline,
|
||||
);
|
||||
}
|
||||
|
||||
void _onLabelNameInputChanged(
|
||||
AppLocalizations appLocalizations,
|
||||
String value,
|
||||
@@ -376,6 +408,8 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
||||
void dispose() {
|
||||
_nameInputFocusNode.dispose();
|
||||
_nameInputController.dispose();
|
||||
_descriptionInputFocusNode.dispose();
|
||||
_descriptionInputController.dispose();
|
||||
_labelNameErrorTextNotifier.dispose();
|
||||
_labelSelectedColorNotifier.dispose();
|
||||
_createLabelStateNotifier.dispose();
|
||||
|
||||
Reference in New Issue
Block a user