fontResponsive static method
- @Deprecated("Use responsiveFontSize instead. it is deprecated in 0.0.6")
void
fontResponsive(
- double screenWidth, {
- bool useCastomFontSize = false,
})
Implementation
@Deprecated("Use responsiveFontSize instead. it is deprecated in 0.0.6")
static void fontResponsive(double screenWidth,
{bool useCastomFontSize = false}) {
if (!useCastomFontSize) {
if (screenWidth < 1200) {
h1 = h1.copyWith(fontSize: 22 + ((1.5 * screenWidth) / 100));
h1Dark = h1Dark.copyWith(fontSize: 22 + ((1.5 * screenWidth) / 100));
h2 = h2.copyWith(fontSize: 21.2 + ((.9 * screenWidth) / 100));
h2Dark = h2Dark.copyWith(fontSize: 21.2 + ((.9 * screenWidth) / 100));
h3 = h3.copyWith(fontSize: 20.8 + ((.6 * screenWidth) / 100));
h3Dark = h3Dark.copyWith(fontSize: 20.8 + ((.6 * screenWidth) / 100));
h4 = h4.copyWith(fontSize: 20.4 + ((.3 * screenWidth) / 100));
h4Dark = h4Dark.copyWith(fontSize: 20.4 + ((.3 * screenWidth) / 100));
} else {
h1 =
h1.copyWith(fontSize: 40, fontWeight: FontWeight.bold, height: 1.2);
h1Dark = h1Dark.copyWith(
fontSize: 40, fontWeight: FontWeight.bold, height: 1.2);
h2 =
h2.copyWith(fontSize: 32, fontWeight: FontWeight.w600, height: 1.2);
h2Dark = h2Dark.copyWith(
fontSize: 32, fontWeight: FontWeight.w600, height: 1.2);
h3 =
h3.copyWith(fontSize: 28, fontWeight: FontWeight.w600, height: 1.2);
h3Dark = h3Dark.copyWith(
fontSize: 28, fontWeight: FontWeight.w600, height: 1.2);
h4 = h4.copyWith(fontSize: 24, fontWeight: FontWeight.w500);
h4Dark = h4Dark.copyWith(fontSize: 24, fontWeight: FontWeight.w500);
}
} else {
if (screenWidth < 1200) {
h1 = h1.copyWith(fontSize: h1.fontSize! + ((1.5 * screenWidth) / 100));
h1Dark = h1Dark.copyWith(
fontSize: h1.fontSize! + ((1.5 * screenWidth) / 100));
h2 = h2.copyWith(fontSize: h2.fontSize! + ((.9 * screenWidth) / 100));
h2Dark = h2Dark.copyWith(
fontSize: h2.fontSize! + ((.9 * screenWidth) / 100));
h3 = h3.copyWith(fontSize: h3.fontSize! + ((.6 * screenWidth) / 100));
h3Dark = h3Dark.copyWith(
fontSize: h3.fontSize! + ((.6 * screenWidth) / 100));
h4 = h4.copyWith(fontSize: h4.fontSize! + ((.3 * screenWidth) / 100));
h4Dark = h4Dark.copyWith(
fontSize: h4.fontSize! + ((.3 * screenWidth) / 100));
} else {
h1 = h1.copyWith(
fontSize: h1.fontSize!, fontWeight: FontWeight.bold, height: 1.2);
h1Dark = h1Dark.copyWith(
fontSize: h1.fontSize!, fontWeight: FontWeight.bold, height: 1.2);
h2 = h2.copyWith(
fontSize: h2.fontSize!, fontWeight: FontWeight.w600, height: 1.2);
h2Dark = h2Dark.copyWith(
fontSize: h2.fontSize!, fontWeight: FontWeight.w600, height: 1.2);
h3 = h3.copyWith(
fontSize: h3.fontSize!, fontWeight: FontWeight.w600, height: 1.2);
h3Dark = h3Dark.copyWith(
fontSize: h3.fontSize!, fontWeight: FontWeight.w600, height: 1.2);
h4 = h4.copyWith(fontSize: h4.fontSize!, fontWeight: FontWeight.w500);
h4Dark = h4Dark.copyWith(
fontSize: h4.fontSize!, fontWeight: FontWeight.w500);
}
}
}