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
|
||||
unnecessary_const: true
|
||||
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 {
|
||||
static const String appDevPhase = 'Beta';
|
||||
|
||||
static const String INSTAGRAM_LINK = 'https://instagram.felixkirchner.de';
|
||||
static const String GITHUB_LINK = 'https://github.felixkirchner.de';
|
||||
static const String GITHUB_ISSUES_LINK =
|
||||
static const String kInstagramLink = 'https://instagram.felixkirchner.de';
|
||||
static const String kGithubLink = 'https://github.felixkirchner.de';
|
||||
static const String kGithubIssuesLink =
|
||||
'https://cabocounter-issues.felixkirchner.de';
|
||||
static const String GITHUB_WIKI_LINK =
|
||||
static const String kGithubWikiLink =
|
||||
'https://cabocounter-wiki.felixkirchner.de';
|
||||
static const String EMAIL = 'cabocounter@felixkirchner.de';
|
||||
static const String PRIVACY_POLICY_LINK =
|
||||
static const String kEmail = 'cabocounter@felixkirchner.de';
|
||||
static const String kPrivacyPolicyLink =
|
||||
'https://www.privacypolicies.com/live/1b3759d4-b2f1-4511-8e3b-21bb1626be68';
|
||||
|
||||
static RateMyApp rateMyApp = RateMyApp(
|
||||
|
||||
@@ -60,15 +60,15 @@ class AboutView extends StatelessWidget {
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.INSTAGRAM_LINK)),
|
||||
launchUrl(Uri.parse(Constants.kInstagramLink)),
|
||||
icon: const Icon(FontAwesomeIcons.instagram)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse('mailto:${Constants.EMAIL}')),
|
||||
launchUrl(Uri.parse('mailto:${Constants.kEmail}')),
|
||||
icon: const Icon(CupertinoIcons.envelope)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.GITHUB_LINK)),
|
||||
launchUrl(Uri.parse(Constants.kGithubLink)),
|
||||
icon: const Icon(FontAwesomeIcons.github)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -227,7 +227,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
||||
|
||||
final Uri emailUri = Uri(
|
||||
scheme: 'mailto',
|
||||
path: Constants.EMAIL,
|
||||
path: Constants.kEmail,
|
||||
query: 'subject=$emailSubject'
|
||||
'&body=$emailBody',
|
||||
);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -149,21 +149,21 @@ class _SettingsViewState extends State<SettingsView> {
|
||||
prefixText: AppLocalizations.of(context).wiki,
|
||||
prefixIcon: CupertinoIcons.book,
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.GITHUB_WIKI_LINK)),
|
||||
launchUrl(Uri.parse(Constants.kGithubWikiLink)),
|
||||
suffixWidget: const CupertinoListTileChevron(),
|
||||
),
|
||||
CustomFormRow(
|
||||
prefixText: AppLocalizations.of(context).privacy_policy,
|
||||
prefixIcon: CupertinoIcons.doc_append,
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.PRIVACY_POLICY_LINK)),
|
||||
launchUrl(Uri.parse(Constants.kPrivacyPolicyLink)),
|
||||
suffixWidget: const CupertinoListTileChevron(),
|
||||
),
|
||||
CustomFormRow(
|
||||
prefixText: AppLocalizations.of(context).error_found,
|
||||
prefixIcon: FontAwesomeIcons.github,
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.GITHUB_ISSUES_LINK)),
|
||||
launchUrl(Uri.parse(Constants.kGithubIssuesLink)),
|
||||
suffixWidget: const CupertinoListTileChevron(),
|
||||
),
|
||||
CustomFormRow(
|
||||
|
||||
@@ -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