Skip to content

Commit

Permalink
set initial text field value for renaming room
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Aug 6, 2023
1 parent 34f8913 commit ef9fefd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/components/chat_room.dart
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,16 @@ class _ChatDetailButtonState extends State<ChatDetailButton>
final theme = Theme.of(buildCtx);
final dialogTextStyle = theme.textTheme.titleMedium!
.copyWith(color: theme.textTheme.bodySmall!.color);
var newName = "";
final comp.ChatRoomController chatRoomController = Get.find();
final initVal = chatRoomController.getCurrentRoom()?.name;
var newName = initVal?? "";

return DialogRoute<String>(
context: buildCtx,
builder: (context) {
return AlertDialog(
content: TextFormField(
initialValue: newName,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter some text';
Expand Down

0 comments on commit ef9fefd

Please sign in to comment.