Open berthojoris opened 5 years ago
Please attach the screenshot or give a link to that.
You can check https://ibb.co/zXyjPmR
Or you can try change TextSpan(text: lastPlayedGame.name, style: headingTwoTextStyle,)
to TextSpan(text: "very loooooooooooooooooonnnnnnnnngggggg teeeeeeeeeeeeeeeeeeeeexxxxxxxxxxxxxxxxxxttttttttttt", style: headingTwoTextStyle,)
I got the issue here. Its dealing with text not scaling at first for different devices, I am learning how to do that. Second is I can ellipsize it, but this will also solve issue temporarily. Wait for sometime and I will come up with a good and generic solution
Maybe you can try wrap inside Flexible
widget like
Flexible(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: RichText(
text: TextSpan(children: [
TextSpan(text: lastPlayedGame.name, style: headingTwoTextStyle,),
TextSpan(text: '\n'),
TextSpan(text: "${lastPlayedGame.hoursPlayed} hours played", style: bodyTextStyle)
]),
),
),
),
Your issue was gone. (My solution) but if you have a another solution maybe we can share your trick :)
When you apply your solution, do you see don't size change for assassin row and remaining lines have different fontsize. Can you share the screenshot(app) of your solution
When I build to release version (android) I got some weird output
. The progress bar not shown. You can see in this picture https://ibb.co/djHsHTt
In this picture I already use my code for fix this issue (Flexible widget
)
But when I run on Emulator or build for debug mode, progress bar shown
Release version seems bad.. I didn't expect that. But the fix with flexible seems to be working, I wanted to check in iPhone SE. One subscriber asked to make app for many screens. But don't issues seems to be very weird in Flutter. Don't know how to handle them. Flexible seems to be good one. I assumed that Flexible will reduce the size of don't for top item and rest all will have a larger font size.
Flexible widget
is nice one for handle case like this. Maybe you can use for next every tutorial on youtube :) I one of the subscriber your channel. Nice inspire UI
I'm still confuse why the progress bar doesn't work in release mode? Using emulator is running well :(
I/flutter ( 1814): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter ( 1814): The following assertion was thrown during layout: I/flutter ( 1814): A RenderFlex overflowed by 15 pixels on the right. I/flutter ( 1814): I/flutter ( 1814): The overflowing RenderFlex has an orientation of Axis.horizontal. I/flutter ( 1814): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and I/flutter ( 1814): black striped pattern. This is usually caused by the contents being too big for the RenderFlex. I/flutter ( 1814): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the I/flutter ( 1814): RenderFlex to fit within the available space instead of being sized to their natural size. I/flutter ( 1814): This is considered an error condition because it indicates that there is content that cannot be I/flutter ( 1814): seen. If the content is legitimately bigger than the available space, consider clipping it with a I/flutter ( 1814): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, I/flutter ( 1814): like a ListView. I/flutter ( 1814): The specific RenderFlex in question is: RenderFlex#ec3be relayoutBoundary=up17 OVERFLOWING: I/flutter ( 1814): creator: Row ← Expanded ← Row ← Padding ← LastPlayedGameTile ← Column ← Padding ← Column ← I/flutter ( 1814): _SingleChildViewport ← IgnorePointer-[GlobalKey#b856d] ← Semantics ← Listener ← ⋯ I/flutter ( 1814): parentData: offset=Offset(0.0, 0.0); flex=2; fit=FlexFit.tight (can use size) I/flutter ( 1814): constraints: BoxConstraints(w=218.7, 0.0<=h<=Infinity) I/flutter ( 1814): size: Size(218.7, 60.0) I/flutter ( 1814): direction: horizontal I/flutter ( 1814): mainAxisAlignment: start I/flutter ( 1814): mainAxisSize: max I/flutter ( 1814): crossAxisAlignment: center I/flutter ( 1814): textDirection: ltr I/flutter ( 1814): verticalDirection: down I/flutter ( 1814): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤ I/flutter ( 1814): ════════════════════════════════════════════════════════════════════════════════════════════════════