Merge pull request #99 from flixcoo/bug/93-scaling-of-cabo-player-selection
Adjustment of name scaling in RoundView
This commit is contained in:
@@ -11,4 +11,3 @@ linter:
|
|||||||
prefer_const_literals_to_create_immutables: true
|
prefer_const_literals_to_create_immutables: true
|
||||||
unnecessary_const: true
|
unnecessary_const: true
|
||||||
lines_longer_than_80_chars: false
|
lines_longer_than_80_chars: false
|
||||||
constant_identifier_names: false
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import 'package:rate_my_app/rate_my_app.dart';
|
|||||||
class Constants {
|
class Constants {
|
||||||
static const String appDevPhase = 'Beta';
|
static const String appDevPhase = 'Beta';
|
||||||
|
|
||||||
static const String INSTAGRAM_LINK = 'https://instagram.felixkirchner.de';
|
static const String kInstagramLink = 'https://instagram.felixkirchner.de';
|
||||||
static const String GITHUB_LINK = 'https://github.felixkirchner.de';
|
static const String kGithubLink = 'https://github.felixkirchner.de';
|
||||||
static const String GITHUB_ISSUES_LINK =
|
static const String kGithubIssuesLink =
|
||||||
'https://cabocounter-issues.felixkirchner.de';
|
'https://cabocounter-issues.felixkirchner.de';
|
||||||
static const String GITHUB_WIKI_LINK =
|
static const String kGithubWikiLink =
|
||||||
'https://cabocounter-wiki.felixkirchner.de';
|
'https://cabocounter-wiki.felixkirchner.de';
|
||||||
static const String EMAIL = 'cabocounter@felixkirchner.de';
|
static const String kEmail = 'cabocounter@felixkirchner.de';
|
||||||
static const String PRIVACY_POLICY_LINK =
|
static const String kPrivacyPolicyLink =
|
||||||
'https://www.privacypolicies.com/live/1b3759d4-b2f1-4511-8e3b-21bb1626be68';
|
'https://www.privacypolicies.com/live/1b3759d4-b2f1-4511-8e3b-21bb1626be68';
|
||||||
|
|
||||||
static RateMyApp rateMyApp = RateMyApp(
|
static RateMyApp rateMyApp = RateMyApp(
|
||||||
|
|||||||
@@ -60,15 +60,15 @@ class AboutView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse(Constants.INSTAGRAM_LINK)),
|
launchUrl(Uri.parse(Constants.kInstagramLink)),
|
||||||
icon: const Icon(FontAwesomeIcons.instagram)),
|
icon: const Icon(FontAwesomeIcons.instagram)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse('mailto:${Constants.EMAIL}')),
|
launchUrl(Uri.parse('mailto:${Constants.kEmail}')),
|
||||||
icon: const Icon(CupertinoIcons.envelope)),
|
icon: const Icon(CupertinoIcons.envelope)),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse(Constants.GITHUB_LINK)),
|
launchUrl(Uri.parse(Constants.kGithubLink)),
|
||||||
icon: const Icon(FontAwesomeIcons.github)),
|
icon: const Icon(FontAwesomeIcons.github)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
|
|
||||||
final Uri emailUri = Uri(
|
final Uri emailUri = Uri(
|
||||||
scheme: 'mailto',
|
scheme: 'mailto',
|
||||||
path: Constants.EMAIL,
|
path: Constants.kEmail,
|
||||||
query: 'subject=$emailSubject'
|
query: 'subject=$emailSubject'
|
||||||
'&body=$emailBody',
|
'&body=$emailBody',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -149,21 +149,21 @@ class _SettingsViewState extends State<SettingsView> {
|
|||||||
prefixText: AppLocalizations.of(context).wiki,
|
prefixText: AppLocalizations.of(context).wiki,
|
||||||
prefixIcon: CupertinoIcons.book,
|
prefixIcon: CupertinoIcons.book,
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse(Constants.GITHUB_WIKI_LINK)),
|
launchUrl(Uri.parse(Constants.kGithubWikiLink)),
|
||||||
suffixWidget: const CupertinoListTileChevron(),
|
suffixWidget: const CupertinoListTileChevron(),
|
||||||
),
|
),
|
||||||
CustomFormRow(
|
CustomFormRow(
|
||||||
prefixText: AppLocalizations.of(context).privacy_policy,
|
prefixText: AppLocalizations.of(context).privacy_policy,
|
||||||
prefixIcon: CupertinoIcons.doc_append,
|
prefixIcon: CupertinoIcons.doc_append,
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse(Constants.PRIVACY_POLICY_LINK)),
|
launchUrl(Uri.parse(Constants.kPrivacyPolicyLink)),
|
||||||
suffixWidget: const CupertinoListTileChevron(),
|
suffixWidget: const CupertinoListTileChevron(),
|
||||||
),
|
),
|
||||||
CustomFormRow(
|
CustomFormRow(
|
||||||
prefixText: AppLocalizations.of(context).error_found,
|
prefixText: AppLocalizations.of(context).error_found,
|
||||||
prefixIcon: FontAwesomeIcons.github,
|
prefixIcon: FontAwesomeIcons.github,
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
launchUrl(Uri.parse(Constants.GITHUB_ISSUES_LINK)),
|
launchUrl(Uri.parse(Constants.kGithubIssuesLink)),
|
||||||
suffixWidget: const CupertinoListTileChevron(),
|
suffixWidget: const CupertinoListTileChevron(),
|
||||||
),
|
),
|
||||||
CustomFormRow(
|
CustomFormRow(
|
||||||
|
|||||||
@@ -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