file caption hint style fix

This commit is contained in:
ashilkn 2022-11-07 14:14:56 +05:30
parent 961513e639
commit 91d839e05a
2 changed files with 9 additions and 7 deletions

View file

@ -22,6 +22,7 @@ const String sharedMediaIdentifier = 'ente-shared-media://';
const int maxLivePhotoToastCount = 2;
const String livePhotoToastCounterKey = "show_live_photo_toast";
const String fileCaptionDefaultHint = "Add a description...";
const thumbnailDiskLoadDeferDuration = Duration(milliseconds: 40);
const thumbnailServerLoadDeferDuration = Duration(milliseconds: 80);

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:photos/core/constants.dart';
import 'package:photos/models/file.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/utils/magic_util.dart';
@ -17,7 +18,7 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
final _textController = TextEditingController();
final _focusNode = FocusNode();
String? editedCaption;
String? hintText = "Add a description...";
String hintText = fileCaptionDefaultHint;
@override
void initState() {
@ -30,7 +31,7 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
});
editedCaption = widget.file.caption;
if (editedCaption != null && editedCaption!.isNotEmpty) {
hintText = editedCaption;
hintText = editedCaption!;
}
super.initState();
}
@ -84,11 +85,11 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
filled: true,
fillColor: colorScheme.fillFaint,
hintText: hintText,
hintStyle: getEnteTextTheme(context)
.small
.copyWith(color: colorScheme.textMuted),
hintStyle: hintText == fileCaptionDefaultHint
? textTheme.small.copyWith(color: colorScheme.textMuted)
: textTheme.small,
),
style: getEnteTextTheme(context).small,
style: textTheme.small,
cursorWidth: 1.5,
maxLength: maxLength,
minLines: 1,
@ -97,7 +98,7 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
keyboardType: TextInputType.text,
onChanged: (value) {
setState(() {
hintText = "Add a description...";
hintText = fileCaptionDefaultHint;
currentLength = value.length;
editedCaption = value;
});