The font size is affected by Phone Font Size Setting.

Is there any way to restrict my App from Phone Font Size Setting? OpenAI suggest the following code
// Custom Action: lockTextScaleFactor

import 'package:flutter/material.dart';

Future<void> lockTextScaleFactor(BuildContext context) async {

final mediaQueryData = MediaQuery.of(context);

final scale = mediaQueryData.textScaleFactor.clamp(1.0, 1.3);

runApp( MediaQuery(

data: MediaQuery.of(context).copyWith(textScaleFactor: scale),

child: MaterialApp(

home: YourMainAppScreen(), // Replace 'YourMainAppScreen' with the actual name ), ), ); }

I can't figure out what YourMainAppScreen() is, as I tried page name which is not correct. Is there any custom codes available like the LockScreenOrientation? Dimitar Klaturov suggested Responsive Design for Flutterflow on Youtube, and it is only helpful for App on different devices like phone, tablet and Desktop(web App).

Any suggestions will help.

2
2 replies