Created
January 15, 2024 12:45
-
-
Save ademar111190/deac09eedd06a4ce9e776fff55e33db6 to your computer and use it in GitHub Desktop.
Font size experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BAT extends StatelessWidget { | |
final double fontSize; | |
const BAT({ | |
super.key, | |
required this.fontSize, | |
}); | |
@override | |
Widget build(BuildContext context) { | |
return Stack( | |
alignment: AlignmentDirectional.topCenter, | |
children: [ | |
Column( | |
children: [ | |
const SizedBox(height: 44), | |
SizedBox(height: 64, child: Container(color: const Color(0xFF0085fb))), | |
], | |
), | |
Column( | |
children: [ | |
const SizedBox(height: 24), | |
BottomAppBar( | |
color: Colors.transparent, | |
child: SizedBox( | |
height: 60, | |
child: Row( | |
mainAxisSize: MainAxisSize.max, | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: [ | |
Expanded( | |
child: TextButton( | |
style: TextButton.styleFrom( | |
padding: EdgeInsets.zero, | |
), | |
onPressed: () {}, | |
child: Text( | |
"FONT SIZE: $fontSize", | |
textAlign: TextAlign.center, | |
style: theme.bottomAppBarBtnStyle.copyWith( | |
fontSize: MediaQuery.of(context).textScaler.scale(fontSize), | |
), | |
maxLines: 1, | |
), | |
), | |
), | |
Container(width: 64), | |
Expanded( | |
child: TextButton( | |
style: TextButton.styleFrom( | |
padding: EdgeInsets.zero, | |
), | |
onPressed: () {}, | |
child: Text( | |
"FONT SIZE: $fontSize", | |
textAlign: TextAlign.center, | |
style: theme.bottomAppBarBtnStyle.copyWith( | |
fontSize: MediaQuery.of(context).textScaler.scale(fontSize), | |
), | |
maxLines: 1, | |
), | |
), | |
), | |
], | |
), | |
), | |
), | |
], | |
), | |
QrActionButton(GlobalKey()), | |
], | |
); | |
} | |
} | |
class SampleBAT extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return const Scaffold( | |
backgroundColor: Colors.white, | |
body: SingleChildScrollView( | |
child: Column( | |
children: [ | |
BAT(fontSize: 13.5), | |
BAT(fontSize: 13.6), | |
BAT(fontSize: 13.8), | |
BAT(fontSize: 14.0), | |
BAT(fontSize: 14.2), | |
BAT(fontSize: 14.4), | |
BAT(fontSize: 14.6), | |
BAT(fontSize: 14.8), | |
BAT(fontSize: 15.0), | |
BAT(fontSize: 15.5), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment