Added licenses to settings

This commit is contained in:
2026-01-11 15:43:11 +01:00
parent e384230a0b
commit c5fa540c5f
9 changed files with 7486 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
"all_players": "Alle Spieler:innen",
"all_players_selected": "Alle Spieler:innen ausgewählt",
"amount_of_matches": "Anzahl der Spiele",
"app_name": "Game Tracker",
"cancel": "Abbrechen",
"choose_game": "Spielvorlage wählen",
"choose_group": "Gruppe wählen",
@@ -33,6 +34,10 @@
"import_data": "Daten importieren",
"info": "Info",
"invalid_schema": "Ungültiges Schema",
"licenses": "Lizenzen",
"no_licenses_found": "Keine Lizenzen gefunden",
"no_license_text_available": "Kein Lizenztext verfügbar",
"error": "Fehler",
"least_points": "Niedrigste Punkte",
"match_in_progress": "Spiel läuft...",
"match_name": "Spieltitel",

View File

@@ -107,6 +107,18 @@
"@invalid_schema": {
"description": "Error message for invalid schema"
},
"@licenses": {
"description": "Licenses menu item"
},
"@no_licenses_found": {
"description": "Message when no licenses are found"
},
"@no_license_text_available": {
"description": "Message when no license text is available"
},
"@error": {
"description": "Error label"
},
"@least_points": {
"description": "Title for least points ruleset"
},
@@ -293,6 +305,10 @@
"import_data": "Import data",
"info": "Info",
"invalid_schema": "Invalid Schema",
"licenses": "Licenses",
"no_licenses_found": "No licenses found",
"no_license_text_available": "No license text available",
"error": "Error",
"least_points": "Least Points",
"match_in_progress": "Match in progress...",
"match_name": "Match name",

View File

@@ -5,7 +5,7 @@ import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/views/main_menu/group_view/groups_view.dart';
import 'package:game_tracker/presentation/views/main_menu/home_view.dart';
import 'package:game_tracker/presentation/views/main_menu/match_view/match_view.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/settings_view.dart';
import 'package:game_tracker/presentation/views/main_menu/statistics_view.dart';
import 'package:game_tracker/presentation/widgets/navbar_item.dart';

View File

@@ -0,0 +1,100 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/oss_licenses.dart';
class LicenseDetailView extends StatelessWidget {
final Package package;
const LicenseDetailView({super.key, required this.package});
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(title: const Text('Lizenzdetails')),
body: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Column(
children: [
Text(
package.name,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
if (package.version != null) ...[
const SizedBox(height: 8),
Text(
'Version ${package.version}',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
color: Colors.grey.shade300,
fontWeight: FontWeight.bold,
),
),
],
if (package.authors.isNotEmpty) ...[
const SizedBox(height: 8),
Text(
package.authors.join(', '),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
color: Colors.grey.shade500,
),
),
],
if (package.homepage != null &&
package.homepage!.isNotEmpty) ...[
const SizedBox(height: 4),
Text(
package.homepage!,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
color: Colors.grey.shade500,
),
),
],
],
),
),
const SizedBox(height: 24),
Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
decoration: CustomTheme.standardBoxDecoration,
child: (package.license != null && package.license!.isNotEmpty)
? SelectableText(
package.license!,
style: TextStyle(
fontSize: 12,
color: Colors.grey.shade300,
height: 1.5,
fontFamily: 'monospace',
),
)
: Center(
heightFactor: 25,
child: Text(
loc.no_license_text_available,
style: TextStyle(color: Colors.grey.shade500),
),
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/oss_licenses.dart';
import 'package:game_tracker/presentation/widgets/tiles/license_tile.dart';
class LicensesView extends StatelessWidget {
const LicensesView({super.key});
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);
return Scaffold(
appBar: AppBar(
title: Text(loc.licenses),
backgroundColor: CustomTheme.backgroundColor,
),
backgroundColor: CustomTheme.backgroundColor,
body: ListView.builder(
itemCount: allDependencies.length,
itemBuilder: (context, index) {
final package = allDependencies[index];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 12),
child: LicenseTile(package: package),
);
},
),
);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/core/enums.dart';
import 'package:game_tracker/l10n/generated/app_localizations.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/licenses_view.dart';
import 'package:game_tracker/presentation/widgets/tiles/settings_list_tile.dart';
import 'package:game_tracker/services/data_transfer_service.dart';
import 'package:intl/intl.dart';
@@ -131,10 +132,14 @@ class _SettingsViewState extends State<SettingsView> {
),
),
SettingsListTile(
title: 'Lizenzen',
title: loc.licenses,
icon: Icons.insert_drive_file,
suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16),
onPressed: () {},
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const LicensesView()),
);
},
),
const Spacer(),
Padding(

View File

@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:game_tracker/core/custom_theme.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/license_detail_view.dart';
import 'package:game_tracker/presentation/views/main_menu/settings_view/oss_licenses.dart';
class LicenseTile extends StatelessWidget {
final Package package;
const LicenseTile({super.key, required this.package});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => LicenseDetailView(package: package),
),
);
},
child: Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
decoration: CustomTheme.standardBoxDecoration,
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
package.name,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 4),
Text(
package.description,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 12, color: Colors.grey.shade400),
),
],
),
),
const Icon(Icons.arrow_forward_ios, size: 16),
],
),
),
);
}
}

View File

@@ -1,7 +1,7 @@
name: game_tracker
description: "Game Tracking App for Card Games"
publish_to: 'none'
version: 0.0.4+109
version: 0.0.4+118
environment:
sdk: ^3.8.1
@@ -27,6 +27,7 @@ dependencies:
url_launcher: ^6.3.2
dev_dependencies:
dart_pubspec_licenses: ^3.0.14
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0