using Unity.UIWidgets.foundation; using Unity.UIWidgets.material; using Unity.UIWidgets.painting; using Unity.UIWidgets.widgets; namespace UIWidgetsSample { public class SendButton : StatelessWidget { /// Callback for send button tap event public readonly OnPressed onPressed; /// Creates send button widget public SendButton( OnPressed onPressed, Key key = null ) : base(key) { this.onPressed = onPressed; } public override Widget build(BuildContext context) { Widget icon = InheritedChatTheme.of(context).theme.sendButtonIcon != null ? InheritedChatTheme.of(context).theme.sendButtonIcon : Image.file( "assets/icon-send.png", color: InheritedChatTheme.of(context).theme.inputTextColor, scale: 1 ); var tooltip = InheritedL10n.of(context).l10n?.sendButtonAccessibilityLabel; return new Container( height: 20, margin: EdgeInsets.only(right:16), width: 30, child: new IconButton( icon: icon, onPressed: () => { onPressed(); }, padding: EdgeInsets.zero, tooltip: tooltip ) ); } } }