How do I prevent error message from overflowing console width? - google-chrome-devtools

Is there a way to prevent long error messages from overflowing the console width?
It is a great pain to have to double click the message everytime and have to navigate in the string to be able to read it.
Example

Related

Swipe a container (message box like telegram) left in flutter

I'm trying to implement left dragging to a specific container or actually a message box like the one in Telegram where you can swipe the message left to reply to it.
Telegram message dragging when reply
I tried the Flutter Dismissible Widget but firstly it destroys the widget or remove it and secondly couldn't find a way to drag it to the center only.
What I want is the same technique in Telegram to implement it on Flutter
Any ideas?
You can use swipeable package, it allows you to wrap a widget with some threshold and a few callbacks that you can react, onSwipeLeft or onSwipeRight for this case. Then you save the selected message and render the message box on top of the message bar.

Is there a way to know which position text overflow occurred in Flutter?

I have several text boxes of different widths sequentially in one of my layouts, and I need to know where overflow occurred in a Text widget so the next Text widget can pick up where the last one left off.
Been looking around in the documentation for a way to check wherein a Text widget an overflow occurred, but haven't been able to find anything. Is this possible at this point?

how to disable bottom overflowed messages in flutter

i want to disable the bottom overflowed messages (like this one: ) before I upload the app in case someone has a to small screen size. Is there a way to disable the bottom overflowed messages in flutter?
thanks for answers
When you build app in release mode, users don't see this warning, however this warning help us to solve overflowed UI.
I would not recommend you to do so.
Though you will be able to remove those messages, you would not able to enable proper functionalities.
Thus I would recommend to use singlechildscrollview wherever possible, or some listviews depending upon layout.
Just wrap your widgets inside
SingleChildScrollView(
child: yourWidgets(
...)
)

Flutter TextFormFiled inside the Card with elevation

I have taken a TextFormField in a Card Widget.I am not able to show the error message outside the Card Widget.The error message is showing inside the Card Widget which is not looking good .I have attached the image of the View which I wanted to show.Please Help me out regarding this.
This is what I get
Since you've not provided the code I'm going to assume that the card and button have been placed in a Column widget. Also, if you press the button it checks if phone number is present or not, if not present it adds the error message to the card.
If my assumptions are correct, you can use the following instead for the Error message,
Visibility (
visible: errmsgvisibility,
child: Text('Please enter phone number.'),
),
Where, 'errmsgvisibility' is a bool value which can be simply changed to true to display the message and made to false to hide the message. Make sure you initialize it to false.
Place the code in the Column widget between the Card and the sign in button.

Flutter refreshing data without screen flickering and scroll issues

I have a page that presents chat messages and has the dates of a group of messages as a divider in my flutter app. The data is pulled from localDB and I am trying to make it refresh the data by polling the DB for updates, however everytime I rebuild the stream or even future it makes the screen flicker and it automatically scrolls to the top of the list. The code is too big for here so I have posted it here.
It uses a Stream builder that calls a widget with data it gets from the first stream and uses another streambuilder to build the messages. I am sure this has something to do with it, but have no idea how to change that or fix the flicker and scroll weirdness.
Hoping someone has some ideas of how to handle this better or fix the flickering.
What you could try is creating a "app state" for each page, for example:
Loading app state - which displays a Progress Indicator when you're polling from DB/server.
Success app state - this dismisses the Progress Indicator and just shows an empty container, displaying your data.
Failed app state - Displays an error icon of your choice.
Perhaps you could try this library, Flutter GetX , and I recommend this library because of how simple it is to use.
It has state management library, which saved me lots of time and code using streams and setState({}).