child: Text(
'MENTALnPREPARATION',
textAlign: TextAlign.center,
style: FlutterFlowTheme.of(context).headlineMedium.override(
fontFamily:
FlutterFlowTheme.of(context).headlineMediumFamily,
color: Colors.black,
fontSize: () {
if (MediaQuery.sizeOf(context).width <
kBreakpointSmall) {
return 32;
} else if (MediaQuery.sizeOf(context).width <
kBreakpointMedium) {
return 35;
} else if (MediaQuery.sizeOf(context).width <
kBreakpointLarge) {
return 40;
} else {
return 45;
}
}()
The text "MENTAL PREPARATION" is a two line text when opened on a smartphone. I want it to change to a single line when opened in Tablet and desktop.
I am not aware of how to go about doing the code changes for the expected functionality
2
Answers
You can check if the current is mobile, desktop or tablet. Here’s an example
Manual way:
//Using above Class
Another way: Just use this package
You can try Screen Size Util package to adapt the screen size. You can have a look at the implementation documentation.