Commit 100115b4 authored by Wilko Manger's avatar Wilko Manger

Fix ripple not showing on send button

parent 33d0758a
...@@ -183,7 +183,11 @@ class ChatPageState extends State<ChatPage> { ...@@ -183,7 +183,11 @@ class ChatPageState extends State<ChatPage> {
child: PlatformWidget( child: PlatformWidget(
android: (_) => Material( android: (_) => Material(
elevation: elevation, elevation: elevation,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8)
),
color: Colors.white,
child: TextField( child: TextField(
controller: textController, controller: textController,
textInputAction: TextInputAction.newline, textInputAction: TextInputAction.newline,
...@@ -191,10 +195,9 @@ class ChatPageState extends State<ChatPage> { ...@@ -191,10 +195,9 @@ class ChatPageState extends State<ChatPage> {
textCapitalization: TextCapitalization.sentences, textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration( decoration: InputDecoration(
border: UnderlineInputBorder( border: UnderlineInputBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(8)) borderRadius: BorderRadius.vertical(top: Radius.circular(8))
), ),
filled: true, filled: true,
fillColor: Colors.white,
hintText: l(context).typeAMessage, hintText: l(context).typeAMessage,
suffixIcon: sendButton suffixIcon: sendButton
), ),
...@@ -270,39 +273,44 @@ class ChatPageState extends State<ChatPage> { ...@@ -270,39 +273,44 @@ class ChatPageState extends State<ChatPage> {
case ConnectionState.active: case ConnectionState.active:
case ConnectionState.done: case ConnectionState.done:
var chatEvents = snapshot.data; var chatEvents = snapshot.data;
return ListView.builder(
final widgets = List<Widget>();
var index = 0;
for (final item in chatEvents) {
if (item is ChatEvent) {
final event = item.event;
final isMine = event.sender.isIdenticalTo(me);
var previousItem, nextItem;
// Note: Because the items are reversed in the
// ListView.builder, the 'previous' event is actually the next
// one in the list.
if (index != chatEvents.length - 1) {
previousItem = chatEvents[index + 1];
}
if (index != 0) {
nextItem = chatEvents[index - 1];
}
widgets.add(Bubble.fromItem(
item: item,
previousItem: previousItem,
nextItem: nextItem,
isMine: isMine,
) ?? Container());
} else if (item is DateItem) {
widgets.add(DateHeader(item));
}
index++;
}
return ListView(
controller: scrollController, controller: scrollController,
reverse: true, reverse: true,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
itemCount: chatEvents.length, children: widgets,
itemBuilder: (context, index) {
final item = chatEvents[index];
if (item is ChatEvent) {
final event = item.event;
final isMine = event.sender.isIdenticalTo(me);
var previousItem, nextItem;
// Note: Because the items are reversed in the
// ListView.builder, the 'previous' event is actually the next
// one in the list.
if (index != chatEvents.length - 1) {
previousItem = chatEvents[index + 1];
}
if (index != 0) {
nextItem = chatEvents[index - 1];
}
return Bubble.fromItem(
item: item,
previousItem: previousItem,
nextItem: nextItem,
isMine: isMine,
) ?? Container();
} else if (item is DateItem) {
return DateHeader(item);
}
}
); );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment