Skip to content

Commit

Permalink
Make comment field read-only and update its display logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutsu3 committed Feb 24, 2025
1 parent 629103d commit 047198a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/screens/domains/domain_comment_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ class _DomainCommentModalState extends State<DomainCommentModal> {
),
content: readonly

Check warning on line 62 in lib/screens/domains/domain_comment_modal.dart

View check run for this annotation

Codecov / codecov/patch

lib/screens/domains/domain_comment_modal.dart#L62

Added line #L62 was not covered by tests
// v5: read only, because the API does not support updating comments
? Text(
widget.domain.comment == ''
? AppLocalizations.of(context)!.noComment
: widget.domain.comment!,
style: TextStyle(fontSize: 16, color: Colors.grey[700]),
? TextField(
controller: _commentController,

Check warning on line 65 in lib/screens/domains/domain_comment_modal.dart

View check run for this annotation

Codecov / codecov/patch

lib/screens/domains/domain_comment_modal.dart#L64-L65

Added lines #L64 - L65 were not covered by tests
maxLines: 5,
minLines: 1,
readOnly: true,
)
// v6: editable
: TextField(
controller: _commentController,
onChanged: (value) {
setState(() {});
},
decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.enterComment,

Check warning on line 74 in lib/screens/domains/domain_comment_modal.dart

View check run for this annotation

Codecov / codecov/patch

lib/screens/domains/domain_comment_modal.dart#L71-L74

Added lines #L71 - L74 were not covered by tests
),
Expand Down

0 comments on commit 047198a

Please sign in to comment.