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