-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🌟 use column instead of stack to remove arbitrary paddings #196
base: main
Are you sure you want to change the base?
feat: 🌟 use column instead of stack to remove arbitrary paddings #196
Conversation
The screenshot you showed me is using a Stack I guess. |
Talking about this Stack:
You are putting/rendering the
...on top of e.g. the ChatListWidget ...
...only to push the latter out from underneath it with a SizedBox.
There is no reason to do that. flutter_chatview/lib/src/widgets/chat_groupedlist_widget.dart Lines 211 to 213 in 2e3eccf
Because the TextField will push the chat further up when it grows due to a reply being initiated. |
I have shared a screenshot for your branch only. |
check this PR. #197 |
Are you talking about the padding above the text field? 😅 |
Or do you want to have the messages be shown behind the text field? |
Yes, it should be displayed behind the field, primarily behind the top corners of the text field. I initially tried using a column but then realized the reason for using a stack and reverted it back to a stack. 😅 |
425f716
to
5624473
Compare
I'm offering a better solution (and fixing a weird thing where I did not see any error or anything due to the config not having settings that would show anything). |
I could make the overflow smaller, but it is working. |
5624473
to
83b5896
Compare
Please test my changes again and let me know what you think. |
Hello @jonasbadstuebner, I tested your code and have found following two things:
Can you please address above mentioned changes and update your PR? |
83b5896
to
70e2cb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue 2 from previously mentioned issues is resolved, but the first issue of texts appearing below the textfield still exists.
This is the current version from this PR:
https://github.com/SimformSolutionsPvtLtd/flutter_chatview/assets/98031138/bc564f35-088d-4e41-bf92-057ff0ece64c
This is what we desire:
https://github.com/SimformSolutionsPvtLtd/flutter_chatview/assets/98031138/a75c44b0-fab6-4249-8cef-125f302a1395
clipBehavior: Clip.none, | ||
children: [ | ||
Positioned.fill( | ||
bottom: -MediaQuery.of(context).size.height, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, this should be as big as the textfield is and not some large value like screen height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot know how large the Textfield is, because the Textfield is built after the chat list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a different solution, let me know what you think after my next push.
@override | ||
Widget buildScrollbar( | ||
BuildContext context, Widget child, ScrollableDetails details) { | ||
switch (getPlatform(context)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please convert this to switch expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way it is implemented in the parent class. I don't think the switch expression would help here, considering I would have to be very verbose.
@@ -0,0 +1,32 @@ | |||
import 'package:flutter/material.dart'; | |||
|
|||
class CustomScrollBehavior extends ScrollBehavior { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe a more specific name would make more sense than just using custom as prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a recommendation?
BottomPaddedScrollBehavior
?
Yes, I am not done with the implementation yet. But I will address your comments later. |
@jonasbadstuebner any progess? |
Description
Unless you have had a reason to make the setup stacked instead of a column in the first place, we can stop guessing the bottom inset for the chat message list now.
I don't like that you hardcoded the 100-height SizedBox.
Also I added the padding to the top of the Textfield, so we don't have to remember to put a bottom padding in all the other places.
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
ordocs
.Breaking Change?
Related Issues
part of #187