Implemented license_detail_view and license_view

This commit is contained in:
2025-08-04 21:16:48 +02:00
parent e00dcd7715
commit 7691d74f37
10 changed files with 5674 additions and 55 deletions

View File

@@ -18,6 +18,8 @@
"home": "Home", "home": "Home",
"about": "Über", "about": "Über",
"licenses": "Lizenzen",
"license_details": "Lizenzdetails",
"empty_text_1": "Ganz schön leer hier...", "empty_text_1": "Ganz schön leer hier...",
"empty_text_2": "Füge über den Button oben rechts eine neue Runde hinzu", "empty_text_2": "Füge über den Button oben rechts eine neue Runde hinzu",

View File

@@ -18,6 +18,8 @@
"home": "Home", "home": "Home",
"about": "About", "about": "About",
"licenses": "Licenses",
"license_details": "License Details",
"empty_text_1": "Pretty empty here...", "empty_text_1": "Pretty empty here...",
"empty_text_2": "Create a new game using the button in the top right.", "empty_text_2": "Create a new game using the button in the top right.",

View File

@@ -194,6 +194,18 @@ abstract class AppLocalizations {
/// **'Über'** /// **'Über'**
String get about; String get about;
/// No description provided for @licenses.
///
/// In de, this message translates to:
/// **'Lizenzen'**
String get licenses;
/// No description provided for @license_details.
///
/// In de, this message translates to:
/// **'Lizenzdetails'**
String get license_details;
/// No description provided for @empty_text_1. /// No description provided for @empty_text_1.
/// ///
/// In de, this message translates to: /// In de, this message translates to:

View File

@@ -56,6 +56,12 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get about => 'Über'; String get about => 'Über';
@override
String get licenses => 'Lizenzen';
@override
String get license_details => 'Lizenzdetails';
@override @override
String get empty_text_1 => 'Ganz schön leer hier...'; String get empty_text_1 => 'Ganz schön leer hier...';

View File

@@ -56,6 +56,12 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get about => 'About'; String get about => 'About';
@override
String get licenses => 'Licenses';
@override
String get license_details => 'License Details';
@override @override
String get empty_text_1 => 'Pretty empty here...'; String get empty_text_1 => 'Pretty empty here...';

View File

@@ -1,5 +1,6 @@
import 'package:cabo_counter/core/constants.dart'; import 'package:cabo_counter/core/constants.dart';
import 'package:cabo_counter/l10n/generated/app_localizations.dart'; import 'package:cabo_counter/l10n/generated/app_localizations.dart';
import 'package:cabo_counter/presentation/views/licenses/license_view.dart';
import 'package:cabo_counter/services/version_service.dart'; import 'package:cabo_counter/services/version_service.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -17,62 +18,68 @@ class AboutView extends StatelessWidget {
middle: Text(AppLocalizations.of(context).about), middle: Text(AppLocalizations.of(context).about),
), ),
child: SafeArea( child: SafeArea(
child: Column( child: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Padding( children: [
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0), Padding(
child: Text( padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
AppLocalizations.of(context).app_name, child: Text(
style: const TextStyle( AppLocalizations.of(context).app_name,
fontSize: 30, style: const TextStyle(
fontWeight: FontWeight.bold, fontSize: 30,
fontWeight: FontWeight.bold,
),
), ),
), ),
), Text(
Text( '${AppLocalizations.of(context).app_version} ${VersionService.getVersionWithBuild()}',
'${AppLocalizations.of(context).app_version} ${VersionService.getVersionWithBuild()}', style: TextStyle(fontSize: 15, color: Colors.grey[300]),
style: TextStyle(fontSize: 15, color: Colors.grey[300]), ),
), Padding(
Padding( padding:
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
const EdgeInsets.symmetric(horizontal: 20, vertical: 15), child: SizedBox(
child: SizedBox( height: 200,
height: 200, child: Image.asset('assets/cabo_counter-logo_rounded.png'),
child: Image.asset('assets/cabo_counter-logo_rounded.png'), )),
)), Padding(
Padding( padding: const EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 30), child: Text(
child: Text( AppLocalizations.of(context).about_text,
AppLocalizations.of(context).about_text, textAlign: TextAlign.center,
textAlign: TextAlign.center, softWrap: true,
softWrap: true, )),
)), const SizedBox(
const SizedBox( height: 30,
height: 30, ),
), CupertinoButton(
const Text( child: Text(AppLocalizations.of(context).licenses),
'\u00A9 Felix Kirchner', onPressed: () => Navigator.push(context,
style: TextStyle(fontSize: 16), CupertinoPageRoute(builder: (_) => const LicenseView()))),
), const Text(
Row( '\u00A9 Felix Kirchner',
mainAxisAlignment: MainAxisAlignment.center, style: TextStyle(fontSize: 16),
children: [ ),
IconButton( Row(
onPressed: () => mainAxisAlignment: MainAxisAlignment.center,
launchUrl(Uri.parse(Constants.kInstagramLink)), children: [
icon: const Icon(FontAwesomeIcons.instagram)), IconButton(
IconButton( onPressed: () =>
onPressed: () => launchUrl(Uri.parse(Constants.kInstagramLink)),
launchUrl(Uri.parse('mailto:${Constants.kEmail}')), icon: const Icon(FontAwesomeIcons.instagram)),
icon: const Icon(CupertinoIcons.envelope)), IconButton(
IconButton( onPressed: () =>
onPressed: () => launchUrl(Uri.parse('mailto:${Constants.kEmail}')),
launchUrl(Uri.parse(Constants.kGithubLink)), icon: const Icon(CupertinoIcons.envelope)),
icon: const Icon(FontAwesomeIcons.github)), IconButton(
], onPressed: () =>
), launchUrl(Uri.parse(Constants.kGithubLink)),
], icon: const Icon(FontAwesomeIcons.github)),
],
),
],
),
))); )));
} }
} }

View File

@@ -0,0 +1,58 @@
import 'package:cabo_counter/core/custom_theme.dart';
import 'package:cabo_counter/l10n/generated/app_localizations.dart'
show AppLocalizations;
import 'package:flutter/cupertino.dart';
class LicenceDetailView extends StatelessWidget {
final String title, licence;
const LicenceDetailView(
{super.key, required this.title, required this.licence});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
previousPageTitle: AppLocalizations.of(context).licenses,
middle: Text(
AppLocalizations.of(context).license_details,
),
),
child: SafeArea(
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Column(
children: [
Padding(
padding:
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
child: FittedBox(
fit: BoxFit.fill,
child: Text(
title,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
Container(
margin: const EdgeInsets.all(8),
padding:
const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
decoration: BoxDecoration(
color: CustomTheme.buttonBackgroundColor,
borderRadius: BorderRadius.circular(16)),
child: Text(
licence,
style: const TextStyle(fontSize: 15),
),
)
],
),
),
),
);
}
}

View File

@@ -0,0 +1,60 @@
import 'package:cabo_counter/core/custom_theme.dart';
import 'package:cabo_counter/l10n/generated/app_localizations.dart';
import 'package:cabo_counter/presentation/views/licenses/license_detail_view.dart';
import 'package:cabo_counter/presentation/views/licenses/oss_licenses.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class LicenseView extends StatelessWidget {
const LicenseView({super.key});
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text(AppLocalizations.of(context).licenses),
previousPageTitle: AppLocalizations.of(context).about,
),
child: SafeArea(
child: ListView.builder(
physics: const BouncingScrollPhysics(),
itemCount: ossLicenses.length,
itemBuilder: (_, index) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 4),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.circular(8),
),
child: CupertinoListTile(
backgroundColor: CustomTheme.backgroundColor,
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (_) => LicenceDetailView(
title: ossLicenses[index].name[0].toUpperCase() +
ossLicenses[index].name.substring(1),
licence: ossLicenses[index].license!,
),
),
);
},
trailing: const CupertinoListTileChevron(),
title: Text(
ossLicenses[index].name[0].toUpperCase() +
ossLicenses[index].name.substring(1),
style: GoogleFonts.roboto(),
),
subtitle: Text(ossLicenses[index].description),
),
),
);
},
),
),
);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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.5.5+639 version: 0.5.6+648
environment: environment:
sdk: ^3.5.4 sdk: ^3.5.4
@@ -31,6 +31,8 @@ dependencies:
reorderables: ^0.4.2 reorderables: ^0.4.2
collection: ^1.18.0 collection: ^1.18.0
confetti: ^0.6.0 confetti: ^0.6.0
flutter_oss_licenses: ^2.0.1
google_fonts: ^6.3.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: