Compare commits

...

3 Commits

4 changed files with 79 additions and 64 deletions

View File

@ -12,7 +12,6 @@ import 'package:synchronized/synchronized.dart';
/// backoff. This means that we perform the random backoff only as long as we are
/// connected. Otherwise, we idle until we have a connection again.
class MoxxyReconnectionPolicy extends ReconnectionPolicy {
MoxxyReconnectionPolicy({ bool isTesting = false, this.maxBackoffTime })
: _isTesting = isTesting,
_timerLock = Lock(),

View File

@ -159,7 +159,7 @@ class ConversationBottomRowState extends State<ConversationBottomRow> {
Padding(
padding: const EdgeInsets.all(8),
child: BlocBuilder<ConversationBloc, ConversationState>(
buildWhen: (prev, next) => prev.sendButtonState != next.sendButtonState || prev.quotedMessage != next.quotedMessage || prev.pickerVisible != next.pickerVisible || prev.messageText != next.messageText || prev.messageEditing != next.messageEditing || prev.messageEditingOriginalBody != next.messageEditingOriginalBody,
buildWhen: (prev, next) => prev.sendButtonState != next.sendButtonState || prev.quotedMessage != next.quotedMessage || prev.pickerVisible != next.pickerVisible || prev.messageText != next.messageText || prev.messageEditing != next.messageEditing || prev.messageEditingOriginalBody != next.messageEditingOriginalBody || prev.isRecording != next.isRecording,
builder: (context, state) => Row(
children: [
Expanded(
@ -240,66 +240,73 @@ class ConversationBottomRowState extends State<ConversationBottomRow> {
),
Padding(
padding: const EdgeInsets.only(left: 8),
child: SizedBox(
height: 45,
width: 45,
child: SpeedDial(
icon: _getSendButtonIcon(state),
backgroundColor: primaryColor,
foregroundColor: Colors.white,
children: [
SpeedDialChild(
child: const Icon(Icons.image),
onTap: () {
context.read<ConversationBloc>().add(
ImagePickerRequestedEvent(),
);
},
child: AnimatedOpacity(
opacity: state.isRecording ? 0 : 1,
duration: const Duration(milliseconds: 150),
child: IgnorePointer(
ignoring: state.isRecording,
child: SizedBox(
height: 45,
width: 45,
child: SpeedDial(
icon: _getSendButtonIcon(state),
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.sendImages,
),
SpeedDialChild(
child: const Icon(Icons.file_present),
onTap: () {
context.read<ConversationBloc>().add(
FilePickerRequestedEvent(),
);
children: [
SpeedDialChild(
child: const Icon(Icons.image),
onTap: () {
context.read<ConversationBloc>().add(
ImagePickerRequestedEvent(),
);
},
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.sendImages,
),
SpeedDialChild(
child: const Icon(Icons.file_present),
onTap: () {
context.read<ConversationBloc>().add(
FilePickerRequestedEvent(),
);
},
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.sendFiles,
),
SpeedDialChild(
child: const Icon(Icons.photo_camera),
onTap: () {
showNotImplementedDialog('taking photos', context);
},
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.takePhotos,
),
],
openCloseDial: widget.speedDialValueNotifier,
onPress: () {
switch (state.sendButtonState) {
case SendButtonState.cancelCorrection:
context.read<ConversationBloc>().add(
MessageEditCancelledEvent(),
);
widget.controller.text = '';
return;
case SendButtonState.send:
context.read<ConversationBloc>().add(
MessageSentEvent(),
);
widget.controller.text = '';
return;
case SendButtonState.multi:
widget.speedDialValueNotifier.value = !widget.speedDialValueNotifier.value;
return;
}
},
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.sendFiles,
),
SpeedDialChild(
child: const Icon(Icons.photo_camera),
onTap: () {
showNotImplementedDialog('taking photos', context);
},
backgroundColor: primaryColor,
foregroundColor: Colors.white,
label: t.pages.conversation.takePhotos,
),
],
openCloseDial: widget.speedDialValueNotifier,
onPress: () {
switch (state.sendButtonState) {
case SendButtonState.cancelCorrection:
context.read<ConversationBloc>().add(
MessageEditCancelledEvent(),
);
widget.controller.text = '';
return;
case SendButtonState.send:
context.read<ConversationBloc>().add(
MessageSentEvent(),
);
widget.controller.text = '';
return;
case SendButtonState.multi:
widget.speedDialValueNotifier.value = !widget.speedDialValueNotifier.value;
return;
}
},
),
),
),
),

View File

@ -829,16 +829,18 @@ packages:
description:
path: "packages/moxxmpp"
ref: HEAD
resolved-ref: ed49212f5a527b2b0084faf97cb5c383221772e2
resolved-ref: a8d80eaddf8784532d88442d74202a47af7de047
url: "https://git.polynom.me/Moxxy/moxxmpp.git"
source: git
version: "0.1.6+1"
moxxmpp_socket_tcp:
dependency: "direct main"
description:
name: moxxmpp_socket_tcp
url: "https://git.polynom.me/api/packages/Moxxy/pub/"
source: hosted
path: "packages/moxxmpp_socket_tcp"
ref: HEAD
resolved-ref: a8d80eaddf8784532d88442d74202a47af7de047
url: "https://git.polynom.me/Moxxy/moxxmpp.git"
source: git
version: "0.1.2+9"
moxxyv2_builders:
dependency: "direct main"
@ -1590,5 +1592,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.17.5 <3.0.0"
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.3.8"

View File

@ -133,14 +133,21 @@ dependency_overrides:
# NOTE: Leave here for development purposes
# moxxmpp:
# path: ../moxxmpp/packages/moxxmpp
# moxxmpp_socket_tcp:
# path: ../moxxmpp/packages/moxxmpp_socket_tcp
# omemo_dart:
# path: ../../Personal/omemo_dart
moxxmpp:
git:
url: https://git.polynom.me/Moxxy/moxxmpp.git
rev: ed49212f5a527b2b0084faf97cb5c383221772e2
rev: a8d80eaddf8784532d88442d74202a47af7de047
path: packages/moxxmpp
moxxmpp_socket_tcp:
git:
url: https://git.polynom.me/Moxxy/moxxmpp.git
rev: a8d80eaddf8784532d88442d74202a47af7de047
path: packages/moxxmpp_socket_tcp
extra_licenses:
- name: undraw.co