Buttons move when input bar height changes
This commit is contained in:
parent
4222b37bb4
commit
276076b265
5 changed files with 77 additions and 50 deletions
|
|
@ -269,9 +269,6 @@ class ChatView extends StatelessWidget {
|
|||
// ),
|
||||
// )
|
||||
// : null,
|
||||
floatingActionButton: ChatFloatingActionButton(
|
||||
controller: controller,
|
||||
),
|
||||
// Pangea#
|
||||
body:
|
||||
// #Pangea
|
||||
|
|
@ -399,10 +396,25 @@ class ChatView extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
)
|
||||
// #Pangea
|
||||
// : Column(
|
||||
// mainAxisSize: MainAxisSize.min,
|
||||
// children: [
|
||||
// const ConnectionStatusHeader(),
|
||||
// ITBar(
|
||||
// choreographer:
|
||||
// controller.choreographer,
|
||||
// ),
|
||||
// ReactionsPicker(controller),
|
||||
// ReplyDisplay(controller),
|
||||
// ChatInputRow(controller),
|
||||
// ChatEmojiPicker(controller),
|
||||
// ],
|
||||
: ChatFooter(
|
||||
controller,
|
||||
key: controller.chatFooterKey,
|
||||
),
|
||||
// Pangea#
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -421,11 +433,19 @@ class ChatView extends StatelessWidget {
|
|||
// ),
|
||||
// ),
|
||||
Positioned(
|
||||
left: 20,
|
||||
bottom:
|
||||
controller.chatFooterKey.currentState?.height ?? 100,
|
||||
left: 7,
|
||||
bottom: 50 +
|
||||
(controller.chatFooterKey.currentState?.height ?? 50),
|
||||
child: StartIGCButton(controller: controller),
|
||||
),
|
||||
Positioned(
|
||||
right: 7,
|
||||
bottom: 50 +
|
||||
(controller.chatFooterKey.currentState?.height ?? 50),
|
||||
child: ChatFloatingActionButton(
|
||||
controller: controller,
|
||||
),
|
||||
),
|
||||
// Pangea#
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import '../../config/themes.dart';
|
||||
import 'chat.dart';
|
||||
import 'events/reply_content.dart';
|
||||
|
|
@ -65,19 +64,22 @@ class _EditContent extends StatelessWidget {
|
|||
Icons.edit,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
Container(width: 15.0),
|
||||
Text(
|
||||
event.calcLocalizedBodyFallback(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
withSenderNamePrefix: false,
|
||||
hideReply: true,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
Container(width: 8.0),
|
||||
Flexible(
|
||||
child: Text(
|
||||
event.calcLocalizedBodyFallback(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
withSenderNamePrefix: false,
|
||||
hideReply: true,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).textTheme.bodyMedium!.color,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(width: 10.0),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,13 +58,10 @@ class LanguagePermissionsButtons extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 56.0),
|
||||
child: FloatingActionButton(
|
||||
mini: true,
|
||||
child: const Icon(Icons.history_edu_outlined),
|
||||
onPressed: () => showMessage(context, text),
|
||||
),
|
||||
return FloatingActionButton(
|
||||
mini: true,
|
||||
child: const Icon(Icons.history_edu_outlined),
|
||||
onPressed: () => showMessage(context, text),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,14 +67,11 @@ class ChatFloatingActionButtonState extends State<ChatFloatingActionButton> {
|
|||
return const SizedBox.shrink();
|
||||
}
|
||||
if (widget.controller.showScrollDownButton) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 56.0),
|
||||
child: FloatingActionButton(
|
||||
onPressed: widget.controller.scrollDown,
|
||||
heroTag: null,
|
||||
mini: true,
|
||||
child: const Icon(Icons.arrow_downward_outlined),
|
||||
),
|
||||
return FloatingActionButton(
|
||||
onPressed: widget.controller.scrollDown,
|
||||
heroTag: null,
|
||||
mini: true,
|
||||
child: const Icon(Icons.arrow_downward_outlined),
|
||||
);
|
||||
}
|
||||
if (widget.controller.choreographer.errorService.error != null) {
|
||||
|
|
|
|||
|
|
@ -19,30 +19,41 @@ class ChatFooter extends StatefulWidget {
|
|||
}
|
||||
|
||||
class ChatFooterState extends State<ChatFooter> {
|
||||
final GlobalKey _widgetKey = GlobalKey();
|
||||
|
||||
double? get height => _widgetKey.currentContext?.size?.height;
|
||||
double? height;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
height = context.size!.height;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
key: _widgetKey,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const ConnectionStatusHeader(),
|
||||
ITBar(
|
||||
choreographer: widget.controller.choreographer,
|
||||
),
|
||||
ReactionsPicker(widget.controller),
|
||||
ReplyDisplay(widget.controller),
|
||||
ChatInputRow(widget.controller),
|
||||
ChatEmojiPicker(widget.controller),
|
||||
],
|
||||
return NotificationListener(
|
||||
onNotification: (_) {
|
||||
if (height != context.size!.height) {
|
||||
height = context.size!.height;
|
||||
widget.controller.updateView();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const ConnectionStatusHeader(),
|
||||
ITBar(
|
||||
choreographer: widget.controller.choreographer,
|
||||
),
|
||||
ReactionsPicker(widget.controller),
|
||||
ReplyDisplay(widget.controller),
|
||||
ChatInputRow(widget.controller),
|
||||
ChatEmojiPicker(widget.controller),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue