Implemented license_detail_view and license_view
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
"home": "Home",
|
||||
"about": "Über",
|
||||
"licenses": "Lizenzen",
|
||||
"license_details": "Lizenzdetails",
|
||||
|
||||
"empty_text_1": "Ganz schön leer hier...",
|
||||
"empty_text_2": "Füge über den Button oben rechts eine neue Runde hinzu",
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
"home": "Home",
|
||||
"about": "About",
|
||||
"licenses": "Licenses",
|
||||
"license_details": "License Details",
|
||||
|
||||
"empty_text_1": "Pretty empty here...",
|
||||
"empty_text_2": "Create a new game using the button in the top right.",
|
||||
|
||||
@@ -194,6 +194,18 @@ abstract class AppLocalizations {
|
||||
/// **'Über'**
|
||||
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.
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
|
||||
@@ -56,6 +56,12 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
@override
|
||||
String get about => 'Über';
|
||||
|
||||
@override
|
||||
String get licenses => 'Lizenzen';
|
||||
|
||||
@override
|
||||
String get license_details => 'Lizenzdetails';
|
||||
|
||||
@override
|
||||
String get empty_text_1 => 'Ganz schön leer hier...';
|
||||
|
||||
|
||||
@@ -56,6 +56,12 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||
@override
|
||||
String get about => 'About';
|
||||
|
||||
@override
|
||||
String get licenses => 'Licenses';
|
||||
|
||||
@override
|
||||
String get license_details => 'License Details';
|
||||
|
||||
@override
|
||||
String get empty_text_1 => 'Pretty empty here...';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:cabo_counter/core/constants.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:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -17,62 +18,68 @@ class AboutView extends StatelessWidget {
|
||||
middle: Text(AppLocalizations.of(context).about),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).app_name,
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).app_name,
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${AppLocalizations.of(context).app_version} ${VersionService.getVersionWithBuild()}',
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey[300]),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: Image.asset('assets/cabo_counter-logo_rounded.png'),
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).about_text,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: true,
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
const Text(
|
||||
'\u00A9 Felix Kirchner',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.kInstagramLink)),
|
||||
icon: const Icon(FontAwesomeIcons.instagram)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse('mailto:${Constants.kEmail}')),
|
||||
icon: const Icon(CupertinoIcons.envelope)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.kGithubLink)),
|
||||
icon: const Icon(FontAwesomeIcons.github)),
|
||||
],
|
||||
),
|
||||
],
|
||||
Text(
|
||||
'${AppLocalizations.of(context).app_version} ${VersionService.getVersionWithBuild()}',
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey[300]),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: Image.asset('assets/cabo_counter-logo_rounded.png'),
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: Text(
|
||||
AppLocalizations.of(context).about_text,
|
||||
textAlign: TextAlign.center,
|
||||
softWrap: true,
|
||||
)),
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
CupertinoButton(
|
||||
child: Text(AppLocalizations.of(context).licenses),
|
||||
onPressed: () => Navigator.push(context,
|
||||
CupertinoPageRoute(builder: (_) => const LicenseView()))),
|
||||
const Text(
|
||||
'\u00A9 Felix Kirchner',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.kInstagramLink)),
|
||||
icon: const Icon(FontAwesomeIcons.instagram)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse('mailto:${Constants.kEmail}')),
|
||||
icon: const Icon(CupertinoIcons.envelope)),
|
||||
IconButton(
|
||||
onPressed: () =>
|
||||
launchUrl(Uri.parse(Constants.kGithubLink)),
|
||||
icon: const Icon(FontAwesomeIcons.github)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
58
lib/presentation/views/licenses/license_detail_view.dart
Normal file
58
lib/presentation/views/licenses/license_detail_view.dart
Normal 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),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
60
lib/presentation/views/licenses/license_view.dart
Normal file
60
lib/presentation/views/licenses/license_view.dart
Normal 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),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
5464
lib/presentation/views/licenses/oss_licenses.dart
Normal file
5464
lib/presentation/views/licenses/oss_licenses.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@ name: cabo_counter
|
||||
description: "Mobile app for the card game Cabo"
|
||||
publish_to: 'none'
|
||||
|
||||
version: 0.5.5+639
|
||||
version: 0.5.6+648
|
||||
|
||||
environment:
|
||||
sdk: ^3.5.4
|
||||
@@ -31,6 +31,8 @@ dependencies:
|
||||
reorderables: ^0.4.2
|
||||
collection: ^1.18.0
|
||||
confetti: ^0.6.0
|
||||
flutter_oss_licenses: ^2.0.1
|
||||
google_fonts: ^6.3.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user