2024年11月10日星期日

How to make Flutter app font size independent from device settings?

 Widget build(BuildContext context) {

  return MaterialApp(
title:
'',
theme:
ThemeData(
colorScheme:
ColorScheme.fromSeed(seedColor: Colors.black),
scaffoldBackgroundColor:
Color(globalBackgroundColor),
useMaterial3:
true,
),
home:
const MyHomePage(title: ''),
builder: (context, child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaler: const TextScaler.linear(1.0)),
child: child!,
);
},

沒有留言:

發佈留言