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,6 +18,7 @@ class AboutView extends StatelessWidget {
middle: Text(AppLocalizations.of(context).about), middle: Text(AppLocalizations.of(context).about),
), ),
child: SafeArea( child: SafeArea(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@@ -51,6 +53,10 @@ class AboutView extends StatelessWidget {
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
CupertinoButton(
child: Text(AppLocalizations.of(context).licenses),
onPressed: () => Navigator.push(context,
CupertinoPageRoute(builder: (_) => const LicenseView()))),
const Text( const Text(
'\u00A9 Felix Kirchner', '\u00A9 Felix Kirchner',
style: TextStyle(fontSize: 16), style: TextStyle(fontSize: 16),
@@ -73,6 +79,7 @@ class AboutView extends StatelessWidget {
], ],
), ),
], ],
),
))); )));
} }
} }

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: