forked from krille-chan/fluffychat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
krille-chan#84 FluffyChat: read receipt icon added to chat input row …
…on mobile
- Loading branch information
1 parent
af12ca4
commit de95407
Showing
2 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
lib/pages/chat/read_receipt/chat_input_row_read_receipt_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:flutter_gen/gen_l10n/l10n.dart'; | ||
|
||
import 'package:fluffychat/config/app_config.dart'; | ||
import '../chat.dart'; | ||
|
||
class ChatInputRowReadReceiptButton extends StatelessWidget { | ||
final ChatController controller; | ||
|
||
const ChatInputRowReadReceiptButton(this.controller, {Key? key}) | ||
: super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
if (controller.showReadReceiptButton()) { | ||
if (controller.requireReadReceipt) { | ||
return IconButton( | ||
tooltip: L10n.of(context)!.readReceiptOff, | ||
icon: const Icon( | ||
Icons.mark_chat_read, | ||
color: AppConfig.primaryColor, | ||
), | ||
onPressed: controller.toggleReadReceiptAction, | ||
); | ||
} else { | ||
return IconButton( | ||
tooltip: L10n.of(context)!.readReceiptOn, | ||
icon: const Icon( | ||
Icons.mark_chat_read_outlined, | ||
color: Colors.grey, | ||
), | ||
onPressed: controller.toggleReadReceiptAction, | ||
); | ||
} | ||
} else { | ||
return Container(); | ||
} | ||
} | ||
} |