Corrected scaling
This commit is contained in:
@@ -67,7 +67,6 @@ class _RoundViewState extends State<RoundView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bottomInset = MediaQuery.of(context).viewInsets.bottom;
|
||||
final maxLength = widget.gameSession.getMaxLengthOfPlayerNames();
|
||||
|
||||
return CupertinoPageScaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
@@ -126,9 +125,8 @@ class _RoundViewState extends State<RoundView> {
|
||||
return MapEntry(
|
||||
index,
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 4 +
|
||||
_getSegmentedControlPadding(maxLength),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 6,
|
||||
),
|
||||
child: FittedBox(
|
||||
@@ -137,10 +135,8 @@ class _RoundViewState extends State<RoundView> {
|
||||
name,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: _getSegmentedControlFontSize(
|
||||
maxLength),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -393,32 +389,6 @@ class _RoundViewState extends State<RoundView> {
|
||||
}
|
||||
}
|
||||
|
||||
double _getSegmentedControlFontSize(int maxLength) {
|
||||
if (maxLength > 8) {
|
||||
// 9 - 12 characters
|
||||
return 9.0;
|
||||
} else if (maxLength > 4) {
|
||||
// 5 - 8 characters
|
||||
return 15.0;
|
||||
} else {
|
||||
// 0 - 4 characters
|
||||
return 18.0;
|
||||
}
|
||||
}
|
||||
|
||||
double _getSegmentedControlPadding(int maxLength) {
|
||||
if (maxLength > 8) {
|
||||
// 9 - 12 characters
|
||||
return 0.0;
|
||||
} else if (maxLength > 4) {
|
||||
// 5 - 8 characters
|
||||
return 5.0;
|
||||
} else {
|
||||
// 0 - 4 characters
|
||||
return 8.0;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
for (final controller in _scoreControllerList) {
|
||||
|
||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
||||
description: "Mobile app for the card game Cabo"
|
||||
publish_to: 'none'
|
||||
|
||||
version: 0.4.3+476
|
||||
version: 0.4.3+477
|
||||
|
||||
environment:
|
||||
sdk: ^3.5.4
|
||||
|
||||
Reference in New Issue
Block a user