diff --git a/analysis_options.yaml b/analysis_options.yaml index 46e2dbe..b3623a1 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -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 diff --git a/lib/core/constants.dart b/lib/core/constants.dart index 5b6e90e..e716464 100644 --- a/lib/core/constants.dart +++ b/lib/core/constants.dart @@ -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( diff --git a/lib/presentation/views/about_view.dart b/lib/presentation/views/about_view.dart index 128f91f..481e294 100644 --- a/lib/presentation/views/about_view.dart +++ b/lib/presentation/views/about_view.dart @@ -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)), ], ), diff --git a/lib/presentation/views/main_menu_view.dart b/lib/presentation/views/main_menu_view.dart index fa537c6..86ff208 100644 --- a/lib/presentation/views/main_menu_view.dart +++ b/lib/presentation/views/main_menu_view.dart @@ -227,7 +227,7 @@ class _MainMenuViewState extends State { final Uri emailUri = Uri( scheme: 'mailto', - path: Constants.EMAIL, + path: Constants.kEmail, query: 'subject=$emailSubject' '&body=$emailBody', ); diff --git a/lib/presentation/views/round_view.dart b/lib/presentation/views/round_view.dart index b4d2212..39e5cc8 100644 --- a/lib/presentation/views/round_view.dart +++ b/lib/presentation/views/round_view.dart @@ -67,7 +67,6 @@ class _RoundViewState extends State { @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 { 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 { 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 { } } - 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) { diff --git a/lib/presentation/views/settings_view.dart b/lib/presentation/views/settings_view.dart index ab8ec7d..d6f0833 100644 --- a/lib/presentation/views/settings_view.dart +++ b/lib/presentation/views/settings_view.dart @@ -149,21 +149,21 @@ class _SettingsViewState extends State { 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( diff --git a/pubspec.yaml b/pubspec.yaml index 8e8a264..ab51129 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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