Skip to content

Commit

Permalink
feat(widgets): Show reply target hint text in separate Text
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Dec 13, 2023
1 parent 1e96a4f commit 0501de4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/constants/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const edgeInsetsL10T10R10 = EdgeInsets.only(left: 10, top: 10, right: 10);
const edgeInsetsL10R10B10 = EdgeInsets.only(left: 10, right: 10, bottom: 10);
const edgeInsetsL10R10B20 = EdgeInsets.only(left: 10, right: 10, bottom: 20);
const edgeInsetsL15R15B10 = EdgeInsets.only(left: 15, right: 15, bottom: 10);
const edgeInsetsL20R20 = EdgeInsets.only(left: 20, right: 20);
const edgeInsetsL20R20B10 = EdgeInsets.only(left: 20, right: 20, bottom: 10);
const edgeInsetsL10T5R5B5 =
EdgeInsets.only(left: 10, top: 5, right: 5, bottom: 5);
Expand Down
23 changes: 21 additions & 2 deletions lib/widgets/reply_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,26 @@ class _ReplyBarState extends ConsumerState<ReplyBar> {
child: Column(
mainAxisSize: isExpanded ? MainAxisSize.max : MainAxisSize.min,
children: [
if (_hintText != null)
Padding(
padding: edgeInsetsL20R20,
child: Row(
children: [
Text(
_hintText!,
style: Theme.of(context).textTheme.labelLarge,
),
Expanded(child: Container()),
IconButton(
icon: const Icon(Icons.clear_outlined),
onPressed: () {
setState(() {
_hintText = null;
});
}),
],
),
),
Flexible(
fit: isExpanded ? FlexFit.tight : FlexFit.loose,
child: Padding(
Expand All @@ -253,8 +273,7 @@ class _ReplyBarState extends ConsumerState<ReplyBar> {
maxLines: isExpanded ? null : 10,
minLines: isExpanded ? null : 1,
decoration: InputDecoration(
hintText:
_hintText ?? context.t.threadPage.sendReplyHint,
hintText: context.t.threadPage.sendReplyHint,
),
),
),
Expand Down

0 comments on commit 0501de4

Please sign in to comment.