Remove flutter chat #26
1 changed files with 39 additions and 29 deletions
fix padding
commit
a5ddce3d08
|
|
@ -303,21 +303,27 @@ class RoomChat extends HookConsumerWidget {
|
|||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: switch (ref.watch(controllerProvider)) {
|
||||
AsyncData(:final value) ||
|
||||
AsyncLoading(:final value?) => SuperListView.builder(
|
||||
AsyncLoading(:final value?) => CustomScrollView(
|
||||
controller: scrollController,
|
||||
slivers: [
|
||||
SuperSliverList.builder(
|
||||
listController: listController.value,
|
||||
itemCount: value.length,
|
||||
itemBuilder: (_, index) => MessageWrapper(
|
||||
value[index],
|
||||
EventText(
|
||||
value[index],
|
||||
onTapReply: () => listController.value.animateToItem(
|
||||
onTapReply: () =>
|
||||
listController.value.animateToItem(
|
||||
index: index,
|
||||
scrollController: scrollController,
|
||||
alignment: 0.5,
|
||||
duration: (_) => Duration(milliseconds: 250),
|
||||
duration: (_) =>
|
||||
Duration(milliseconds: 250),
|
||||
curve: (_) => Curves.easeInOut,
|
||||
),
|
||||
getEventOptions: getEventOptions,
|
||||
|
|
@ -328,13 +334,17 @@ class RoomChat extends HookConsumerWidget {
|
|||
isFlashing: false,
|
||||
),
|
||||
),
|
||||
AsyncLoading() => Loading(),
|
||||
AsyncError(:final error, :final stackTrace) => ErrorDialog(
|
||||
error,
|
||||
stackTrace,
|
||||
SliverPadding(
|
||||
padding: EdgeInsetsGeometry.only(bottom: 64),
|
||||
),
|
||||
],
|
||||
),
|
||||
AsyncLoading() => Loading(),
|
||||
AsyncError(:final error, :final stackTrace) =>
|
||||
ErrorDialog(error, stackTrace),
|
||||
},
|
||||
),
|
||||
),
|
||||
ChatBox(
|
||||
node: composerNode,
|
||||
onSend: (text, {required shouldMention, required tags}) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue