Skip to content

Instantly share code, notes, and snippets.

@ademar111190
Created January 15, 2024 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ademar111190/deac09eedd06a4ce9e776fff55e33db6 to your computer and use it in GitHub Desktop.
Save ademar111190/deac09eedd06a4ce9e776fff55e33db6 to your computer and use it in GitHub Desktop.
Font size experiment
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