1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 08:15:16 +00:00

Add counter on comment form

This commit is contained in:
2019-05-20 09:20:11 +02:00
parent 073ddd8386
commit 59c3e47419
3 changed files with 35 additions and 26 deletions

View File

@ -153,3 +153,13 @@ Future<bool> showConfirmDialog({
return result != null && result;
}
/// Smart [InputCounterWidgetBuilder] that show text limit only when some
/// text has already been entered by the user
Widget smartInputCounterWidgetBuilder(
BuildContext context, {
@required int currentLength,
@required int maxLength,
@required bool isFocused,
}) =>
currentLength > 0 ? Text("$currentLength/$maxLength") : Container();