您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
55 行
1.8 KiB
55 行
1.8 KiB
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.material;
|
|
using Unity.UIWidgets.painting;
|
|
using Unity.UIWidgets.ui;
|
|
using Unity.UIWidgets.widgets;
|
|
using UnityEngine;
|
|
using Image = Unity.UIWidgets.widgets.Image;
|
|
|
|
namespace UIWidgetsSample
|
|
{
|
|
public delegate void OnPressed();
|
|
|
|
internal class AttachmentButton : StatelessWidget
|
|
{
|
|
/// Callback for attachment button tap event
|
|
public readonly OnPressed onPressed;
|
|
|
|
/// Creates attachment button widget
|
|
public AttachmentButton(
|
|
OnPressed onPressed,
|
|
Key key = null
|
|
) : base(key)
|
|
{
|
|
this.onPressed = onPressed;
|
|
}
|
|
|
|
public override Widget build(BuildContext context)
|
|
{
|
|
var test = InheritedChatTheme.of(context).theme.inputTextColor;
|
|
return new Container(
|
|
height: 14,
|
|
margin: EdgeInsets.only(right: 16),
|
|
width: 24,
|
|
child: new IconButton(
|
|
icon: InheritedChatTheme.of(context).theme.attachmentButtonIcon != null
|
|
? InheritedChatTheme.of(context).theme.attachmentButtonIcon
|
|
: Image.file(
|
|
"assets/icon-attachment.png",
|
|
color: InheritedChatTheme.of(context).theme.inputTextColor,
|
|
//package: "flutter_chat_ui",
|
|
scale: 1
|
|
),
|
|
onPressed: ()=>
|
|
{
|
|
Debug.Log("add file , not available yet");
|
|
//onPressed();
|
|
},
|
|
padding: EdgeInsets.zero,
|
|
tooltip:
|
|
InheritedL10n.of(context)?.l10n?.attachmentButtonAccessibilityLabel
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|