chili_text_scale_factor:
git:
url: https://github.com/ChiliLabs/chili-text-scale-factor.git
ref: main
final textScaleFactor = MediaQuery.textScaleFactorOf(context);
final designSystemData = DesignSystemThemeData.light(textScaleFactor);
final textScaleFactorStyle = TextScaleFactorStyle.fromTextScaleFactor(
textScaleFactor,
);
final class DesignSystemTypography extends Equatable {
final TextScaleFactorStyle textScaleFactorStyle;
final TextStyle largeTitle;
const DesignSystemTypography({
required this.textScaleFactorStyle,
required this.largeTitle,
});
factory DesignSystemTypography.main({
required Color defaultTextColor,
required TextScaleFactorStyle scaleStyle,
}) =>
DesignSystemTypography(
textScaleFactorStyle: scaleStyle,
largeTitle: TextStyle(
color: defaultTextColor,
fontSize: TextScaleFactorSize.largeTitle.size(scaleStyle),
fontWeight: FontWeight.w600,
height: 41 / 34,
decoration: TextDecoration.none,
decorationColor: Colors.transparent,
decorationThickness: 0.01,
fontFamily: FontFamily.poppins,
),
);
@override
List<Object?> get props => [
textScaleFactorStyle,
largeTitle,
];
}
MaterialApp.router(
...
builder: (_, child) => LimitTextScaleFactorWrapper(
child: child ?? emptyMargin,
),
...
),