lisenGoogleFont static method
dynamic
lisenGoogleFont(
- TextStyle googleFontsName, {
- int? h,
})
Implementation
static lisenGoogleFont(TextStyle googleFontsName, {int? h}) {
if (h != null) {
switch (h) {
case 1:
{
h1Dark = h1 = h1.copyWith(fontFamily: googleFontsName.fontFamily);
h1Dark = h1Dark.copyWith(color: Colors.white);
return;
}
case 2:
{
h2Dark = h2 = h2.copyWith(fontFamily: googleFontsName.fontFamily);
h2Dark = h2Dark.copyWith(color: Colors.white);
return;
}
case 3:
{
h3Dark = h3 = h3.copyWith(fontFamily: googleFontsName.fontFamily);
h3Dark = h3Dark.copyWith(color: Colors.white);
return;
}
case 4:
{
h4Dark = h4 = h4.copyWith(fontFamily: googleFontsName.fontFamily);
h4Dark = h4Dark.copyWith(color: Colors.white);
return;
}
case 5:
{
h5Dark = h5 = b1 =
b1Dark = h5.copyWith(fontFamily: googleFontsName.fontFamily);
h5Dark = h5Dark.copyWith(color: Colors.white);
b1Dark = b1Dark.copyWith(color: Colors.white);
return;
}
case 6:
{
h6 = h6Dark = b2 =
b2Dark = h6.copyWith(fontFamily: googleFontsName.fontFamily);
h6Dark = h6Dark.copyWith(color: Colors.white);
b2Dark = b2Dark.copyWith(color: Colors.white);
return;
}
default:
{
return null;
}
}
} else {
h1Dark = h1 = googleFontsName.copyWith(
fontSize: 40, fontWeight: FontWeight.bold, height: 1.2);
h1Dark = h1Dark.copyWith(color: Colors.white);
h2Dark = h2 = googleFontsName.copyWith(
fontSize: 32, fontWeight: FontWeight.w600, height: 1.2);
h2Dark = h2Dark.copyWith(color: Colors.white);
h3Dark = h3 = googleFontsName.copyWith(
fontSize: 28, fontWeight: FontWeight.w600, height: 1.2);
h3Dark = h3Dark.copyWith(color: Colors.white);
h4Dark = h4 = googleFontsName.copyWith(
fontSize: 24, fontWeight: FontWeight.w500, height: 1.2);
h4Dark = h4Dark.copyWith(color: Colors.white);
h5Dark = h5 =
b1 = b1Dark = googleFontsName.copyWith(fontSize: 20, height: 1.2);
h5Dark = h5Dark.copyWith(color: Colors.white);
b1Dark = b1Dark.copyWith(color: Colors.white);
h6 = h6Dark =
b2 = b2Dark = googleFontsName.copyWith(fontSize: 16, height: 1.2);
h6Dark = h6Dark.copyWith(color: Colors.white);
b2Dark = b2Dark.copyWith(color: Colors.white);
}
}