chore: Follow up recording on web
This commit is contained in:
parent
299174c922
commit
413352628e
1 changed files with 34 additions and 25 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:fluffychat/widgets/hover_builder.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:animations/animations.dart';
|
import 'package:animations/animations.dart';
|
||||||
|
|
@ -362,32 +363,40 @@ class ChatInputRow extends StatelessWidget {
|
||||||
PlatformInfos.platformCanRecord &&
|
PlatformInfos.platformCanRecord &&
|
||||||
!controller.sendController.text.isNotEmpty &&
|
!controller.sendController.text.isNotEmpty &&
|
||||||
controller.editEvent == null
|
controller.editEvent == null
|
||||||
? IconButton(
|
? HoverBuilder(
|
||||||
tooltip: L10n.of(context).voiceMessage,
|
builder: (context, hovered) => IconButton(
|
||||||
onPressed: () =>
|
tooltip: L10n.of(context).voiceMessage,
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
onPressed: hovered
|
||||||
SnackBar(
|
? () => recordingViewModel.startRecording(
|
||||||
margin: EdgeInsets.only(
|
controller.room,
|
||||||
bottom: height + 16,
|
)
|
||||||
left: 16,
|
: () => ScaffoldMessenger.of(context)
|
||||||
right: 16,
|
.showSnackBar(
|
||||||
top: 16,
|
SnackBar(
|
||||||
),
|
margin: EdgeInsets.only(
|
||||||
showCloseIcon: true,
|
bottom: height + 16,
|
||||||
content: Text(
|
left: 16,
|
||||||
L10n.of(
|
right: 16,
|
||||||
context,
|
top: 16,
|
||||||
).longPressToRecordVoiceMessage,
|
),
|
||||||
),
|
showCloseIcon: true,
|
||||||
),
|
content: Text(
|
||||||
),
|
L10n.of(
|
||||||
onLongPress: () => recordingViewModel
|
context,
|
||||||
.startRecording(controller.room),
|
).longPressToRecordVoiceMessage,
|
||||||
style: IconButton.styleFrom(
|
),
|
||||||
backgroundColor: theme.bubbleColor,
|
),
|
||||||
foregroundColor: theme.onBubbleColor,
|
),
|
||||||
|
onLongPress: () => recordingViewModel
|
||||||
|
.startRecording(controller.room),
|
||||||
|
style: IconButton.styleFrom(
|
||||||
|
backgroundColor: theme.bubbleColor,
|
||||||
|
foregroundColor: theme.onBubbleColor,
|
||||||
|
),
|
||||||
|
icon: Icon(
|
||||||
|
hovered ? Icons.mic : Icons.mic_none_outlined,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.mic_none_outlined),
|
|
||||||
)
|
)
|
||||||
: IconButton(
|
: IconButton(
|
||||||
tooltip: L10n.of(context).send,
|
tooltip: L10n.of(context).send,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue