Merge branch 'krille/fix-chatview-safearea' into 'main'

fix: ChatView safearea on iPad

See merge request famedly/fluffychat!588
This commit is contained in:
Krille Fear 2021-11-27 10:39:17 +00:00
commit afc9afb391

View File

@ -177,7 +177,8 @@ class ChatView extends StatelessWidget {
height: double.infinity,
fit: BoxFit.cover,
),
Column(
SafeArea(
child: Column(
children: <Widget>[
TombstoneDisplay(controller),
Expanded(
@ -229,15 +230,16 @@ class ChatView extends StatelessWidget {
: controller.canLoadMore
? Center(
child: OutlinedButton(
style: OutlinedButton.styleFrom(
style:
OutlinedButton.styleFrom(
backgroundColor: Theme.of(
context)
.scaffoldBackgroundColor,
),
onPressed:
controller.requestHistory,
child: Text(
L10n.of(context).loadMore),
child: Text(L10n.of(context)
.loadMore),
),
)
: Container()
@ -257,13 +259,14 @@ class ChatView extends StatelessWidget {
controller.scrollController,
child: Swipeable(
key: ValueKey(controller
.filteredEvents[i - 1].eventId),
.filteredEvents[i - 1]
.eventId),
background: const Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.0),
child: Center(
child:
Icon(Icons.reply_outlined),
child: Icon(
Icons.reply_outlined),
),
),
direction:
@ -271,7 +274,8 @@ class ChatView extends StatelessWidget {
onSwipe: (direction) =>
controller.replyAction(
replyTo: controller
.filteredEvents[i - 1]),
.filteredEvents[
i - 1]),
child: Message(
controller
.filteredEvents[i - 1],
@ -291,11 +295,10 @@ class ChatView extends StatelessWidget {
),
),
unfold: controller.unfold,
onSelect:
controller.onSelectMessage,
scrollToEventId: (String eventId) =>
controller.scrollToEventId(
eventId),
onSelect: controller
.onSelectMessage,
scrollToEventId: (String eventId) => controller
.scrollToEventId(eventId),
longPressSelect: controller
.selectedEvents.isEmpty,
selected: controller.selectedEvents.any((e) =>
@ -304,17 +307,19 @@ class ChatView extends StatelessWidget {
.filteredEvents[i - 1]
.eventId),
timeline: controller.timeline,
nextEvent:
i < controller.filteredEvents.length
? controller
.filteredEvents[i]
nextEvent: i <
controller
.filteredEvents
.length
? controller.filteredEvents[i]
: null),
),
);
},
childCount: controller.filteredEvents.length + 2,
findChildIndexCallback: (key) => controller
.findChildIndexCallback(key, thisEventsKeyMap),
findChildIndexCallback: (key) =>
controller.findChildIndexCallback(
key, thisEventsKeyMap),
),
);
},
@ -334,7 +339,8 @@ class ChatView extends StatelessWidget {
child: Material(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(AppConfig.borderRadius),
bottomRight: Radius.circular(AppConfig.borderRadius),
bottomRight:
Radius.circular(AppConfig.borderRadius),
),
elevation: 6,
shadowColor: Theme.of(context)
@ -342,7 +348,6 @@ class ChatView extends StatelessWidget {
.withAlpha(100),
clipBehavior: Clip.hardEdge,
color: Theme.of(context).appBarTheme.backgroundColor,
child: SafeArea(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@ -355,9 +360,9 @@ class ChatView extends StatelessWidget {
),
),
),
),
],
),
),
],
),
),