parent
40f5d0f459
commit
f6aaf49164
1 changed files with 1041 additions and 144 deletions
30
lib/widgets/composer/composer_replacement.dart
Normal file
30
lib/widgets/composer/composer_replacement.dart
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import "package:material_ui/material_ui.dart";
|
||||
|
||||
/// Replaces the composer's text field with something to send, like a sticker.
|
||||
class const ComposerReplacement(
|
||||
final Widget child, {
|
||||
required final String removeTooltip,
|
||||
required final VoidCallback onRemove,
|
||||
final FocusOnKeyEventCallback? onKeyEvent,
|
||||
super.key,
|
||||
}) extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) => Focus(
|
||||
autofocus: true,
|
||||
onKeyEvent: onKeyEvent,
|
||||
child: Padding(
|
||||
padding: .symmetric(vertical: 8),
|
||||
child: Row(
|
||||
spacing: 12,
|
||||
children: [
|
||||
Expanded(child: child),
|
||||
IconButton(
|
||||
tooltip: removeTooltip,
|
||||
onPressed: onRemove,
|
||||
icon: Icon(Icons.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue