Update Android icons and enter action
This commit is contained in:
@@ -123,6 +123,11 @@ class NativeConnectionApi {
|
||||
return result ?? false;
|
||||
}
|
||||
|
||||
Future<bool> sendEnter() async {
|
||||
final result = await _methodChannel.invokeMethod<bool>('sendEnter');
|
||||
return result ?? false;
|
||||
}
|
||||
|
||||
Future<List<DiscoveredDevice>> startDiscovery() async {
|
||||
try {
|
||||
final result = await _methodChannel.invokeListMethod<dynamic>(
|
||||
@@ -341,15 +346,14 @@ class _InputSyncPageState extends State<InputSyncPage>
|
||||
}
|
||||
|
||||
final draft = inputController.text;
|
||||
final textToSend = appendEnter ? '$draft\n' : draft;
|
||||
|
||||
setState(() {
|
||||
sendButtonState = SendButtonState.sending;
|
||||
});
|
||||
|
||||
try {
|
||||
final sent = await api.sendText(textToSend);
|
||||
if (!sent) {
|
||||
final sent = await api.sendText(draft);
|
||||
final enterSent = !sent || !appendEnter ? true : await api.sendEnter();
|
||||
if (!sent || !enterSent) {
|
||||
_showToast('发送失败,连接已断开');
|
||||
setState(() {
|
||||
sendButtonState = SendButtonState.idle;
|
||||
|
||||
Reference in New Issue
Block a user