tv: overscan

This commit is contained in:
Thibault Deckers 2023-01-05 20:13:48 +01:00
parent 665a79c488
commit 96f72fcdb3
8 changed files with 458 additions and 413 deletions

View file

@ -1,6 +1,5 @@
import 'dart:ui';
import 'package:aves/app_flavor.dart';
import 'package:flutter/material.dart';
import 'package:latlong2/latlong.dart';
@ -69,367 +68,4 @@ class Constants {
static const int infoGroupMaxValueLength = 140;
static const String avesGithub = 'https://github.com/deckerst/aves';
static const String apache2 = 'Apache License 2.0';
static const String bsd2 = 'BSD 2-Clause "Simplified" License';
static const String bsd3 = 'BSD 3-Clause "Revised" License';
static const String eclipse1 = 'Eclipse Public License 1.0';
static const String mit = 'MIT License';
static const List<Dependency> androidDependencies = [
Dependency(
name: 'AndroidSVG',
license: apache2,
sourceUrl: 'https://github.com/BigBadaboom/androidsvg',
),
Dependency(
name: 'AndroidX (Core Kotlin, Exifinterface, Lifecycle Process, Multidex)',
license: apache2,
licenseUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-main/LICENSE.txt',
sourceUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-main/core/core-ktx',
),
Dependency(
name: 'CWAC-Document',
license: apache2,
sourceUrl: 'https://github.com/commonsguy/cwac-document',
),
Dependency(
name: 'Glide',
license: '$apache2, $bsd2',
sourceUrl: 'https://github.com/bumptech/glide',
),
Dependency(
name: 'Metadata Extractor',
license: apache2,
sourceUrl: 'https://github.com/drewnoakes/metadata-extractor',
),
Dependency(
name: 'MP4 Parser (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/deckerst/mp4parser',
),
Dependency(
name: 'PixyMeta Android (Aves fork)',
license: eclipse1,
sourceUrl: 'https://github.com/deckerst/pixymeta-android',
),
Dependency(
name: 'Tiff Bitmap Factory (Aves fork)',
license: mit,
licenseUrl: 'https://github.com/deckerst/Android-TiffBitmapFactory/blob/master/license.txt',
sourceUrl: 'https://github.com/deckerst/Android-TiffBitmapFactory',
),
];
static const List<Dependency> _flutterPluginsCommon = [
Dependency(
name: 'Connectivity Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/connectivity_plus',
),
Dependency(
name: 'Device Info Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/device_info_plus/device_info_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus',
),
Dependency(
name: 'Dynamic Color',
license: bsd3,
sourceUrl: 'https://github.com/material-foundation/material-dynamic-color-flutter',
),
Dependency(
name: 'fijkplayer (Aves fork)',
license: mit,
sourceUrl: 'https://github.com/deckerst/fijkplayer',
),
Dependency(
name: 'Flutter Display Mode',
license: mit,
sourceUrl: 'https://github.com/ajinasokan/flutter_displaymode',
),
Dependency(
name: 'Package Info Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus',
),
Dependency(
name: 'Permission Handler',
license: mit,
sourceUrl: 'https://github.com/Baseflow/flutter-permission-handler',
),
Dependency(
name: 'Printing',
license: apache2,
sourceUrl: 'https://github.com/DavBfr/dart_pdf',
),
Dependency(
name: 'Screen Brightness',
license: mit,
sourceUrl: 'https://github.com/aaassseee/screen_brightness',
),
Dependency(
name: 'Shared Preferences',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/shared_preferences/shared_preferences/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences',
),
Dependency(
name: 'sqflite',
license: bsd2,
sourceUrl: 'https://github.com/tekartik/sqflite',
),
Dependency(
name: 'Streams Channel (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/deckerst/aves_streams_channel',
),
Dependency(
name: 'URL Launcher',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/url_launcher/url_launcher/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher',
),
];
static const List<Dependency> _googleMobileServices = [
Dependency(
name: 'Google API Availability',
license: mit,
sourceUrl: 'https://github.com/Baseflow/flutter-google-api-availability',
),
Dependency(
name: 'Google Maps for Flutter',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/google_maps_flutter/google_maps_flutter/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter',
),
];
static const List<Dependency> _huaweiMobileServices = [
Dependency(
name: 'Huawei Mobile Services (Availability, Map)',
license: apache2,
licenseUrl: 'https://github.com/HMS-Core/hms-flutter-plugin/blob/master/LICENCE',
sourceUrl: 'https://github.com/HMS-Core/hms-flutter-plugin',
),
];
static const List<Dependency> _flutterPluginsHuaweiOnly = [
..._huaweiMobileServices,
];
static const List<Dependency> _flutterPluginsIzzyOnly = [
..._googleMobileServices,
];
static const List<Dependency> _flutterPluginsLibreOnly = [];
static const List<Dependency> _flutterPluginsPlayOnly = [
..._googleMobileServices,
Dependency(
name: 'FlutterFire (Core, Crashlytics)',
license: bsd3,
sourceUrl: 'https://github.com/FirebaseExtended/flutterfire',
),
];
static List<Dependency> flutterPlugins(AppFlavor flavor) => [
..._flutterPluginsCommon,
if (flavor == AppFlavor.huawei) ..._flutterPluginsHuaweiOnly,
if (flavor == AppFlavor.izzy) ..._flutterPluginsIzzyOnly,
if (flavor == AppFlavor.libre) ..._flutterPluginsLibreOnly,
if (flavor == AppFlavor.play) ..._flutterPluginsPlayOnly,
];
static const List<Dependency> flutterPackages = [
Dependency(
name: 'Charts',
license: apache2,
sourceUrl: 'https://github.com/google/charts',
),
Dependency(
name: 'Custom rounded rectangle border',
license: mit,
sourceUrl: 'https://github.com/lekanbar/custom_rounded_rectangle_border',
),
Dependency(
name: 'Decorated Icon',
license: mit,
sourceUrl: 'https://github.com/benPesso/flutter_decorated_icon',
),
Dependency(
name: 'Expansion Tile Card (Aves fork)',
license: bsd3,
sourceUrl: 'https://github.com/deckerst/expansion_tile_card',
),
Dependency(
name: 'FlexColorPicker',
license: bsd3,
sourceUrl: 'https://github.com/rydmike/flex_color_picker',
),
Dependency(
name: 'Flutter Highlight',
license: mit,
sourceUrl: 'https://github.com/git-touch/highlight',
),
Dependency(
name: 'Flutter Map',
license: bsd3,
sourceUrl: 'https://github.com/fleaflet/flutter_map',
),
Dependency(
name: 'Flutter Markdown',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/flutter_markdown/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/flutter_markdown',
),
Dependency(
name: 'Flutter Staggered Animations',
license: mit,
sourceUrl: 'https://github.com/mobiten/flutter_staggered_animations',
),
Dependency(
name: 'Material Design Icons Flutter',
license: mit,
sourceUrl: 'https://github.com/ziofat/material_design_icons_flutter',
),
Dependency(
name: 'Overlay Support',
license: apache2,
sourceUrl: 'https://github.com/boyan01/overlay_support',
),
Dependency(
name: 'Palette Generator',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/palette_generator/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/palette_generator',
),
Dependency(
name: 'Panorama (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/zesage/panorama',
),
Dependency(
name: 'Percent Indicator',
license: bsd2,
sourceUrl: 'https://github.com/diegoveloper/flutter_percent_indicator',
),
Dependency(
name: 'Provider',
license: mit,
sourceUrl: 'https://github.com/rrousselGit/provider',
),
Dependency(
name: 'Smooth Page Indicator',
license: mit,
sourceUrl: 'https://github.com/Milad-Akarie/smooth_page_indicator',
),
];
static const List<Dependency> dartPackages = [
Dependency(
name: 'Collection',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/collection',
),
Dependency(
name: 'Country Code',
license: mit,
sourceUrl: 'https://github.com/denixport/dart.country',
),
Dependency(
name: 'Equatable',
license: mit,
sourceUrl: 'https://github.com/felangel/equatable',
),
Dependency(
name: 'Event Bus',
license: mit,
sourceUrl: 'https://github.com/marcojakob/dart-event-bus',
),
Dependency(
name: 'Fluster',
license: mit,
sourceUrl: 'https://github.com/alfonsocejudo/fluster',
),
Dependency(
name: 'Flutter Lints',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/flutter_lints/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/flutter_lints',
),
Dependency(
name: 'Get It',
license: mit,
sourceUrl: 'https://github.com/fluttercommunity/get_it',
),
Dependency(
name: 'Intl',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/intl',
),
Dependency(
name: 'LatLong2',
license: apache2,
sourceUrl: 'https://github.com/jifalops/dart-latlong',
),
Dependency(
name: 'Material Color Utilities',
license: apache2,
licenseUrl: 'https://github.com/material-foundation/material-color-utilities/tree/main/dart/LICENSE',
sourceUrl: 'https://github.com/material-foundation/material-color-utilities/tree/main/dart',
),
Dependency(
name: 'Path',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/path',
),
Dependency(
name: 'PDF for Dart and Flutter',
license: apache2,
sourceUrl: 'https://github.com/DavBfr/dart_pdf',
),
Dependency(
name: 'Proj4dart',
license: mit,
sourceUrl: 'https://github.com/maRci002/proj4dart',
),
Dependency(
name: 'Stack Trace',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/stack_trace',
),
Dependency(
name: 'Transparent Image',
license: mit,
sourceUrl: 'https://github.com/brianegan/transparent_image',
),
Dependency(
name: 'Tuple',
license: bsd2,
sourceUrl: 'https://github.com/google/tuple.dart',
),
Dependency(
name: 'XML',
license: mit,
sourceUrl: 'https://github.com/renggli/dart-xml',
),
];
}
class Dependency {
final String name;
final String license;
final String sourceUrl;
final String licenseUrl;
const Dependency({
required this.name,
required this.license,
String? licenseUrl,
required this.sourceUrl,
}) : licenseUrl = licenseUrl ?? '$sourceUrl/blob/master/LICENSE';
}

366
lib/utils/dependencies.dart Normal file
View file

@ -0,0 +1,366 @@
import 'package:aves/app_flavor.dart';
class Dependencies {
static const String apache2 = 'Apache License 2.0';
static const String bsd2 = 'BSD 2-Clause "Simplified" License';
static const String bsd3 = 'BSD 3-Clause "Revised" License';
static const String eclipse1 = 'Eclipse Public License 1.0';
static const String mit = 'MIT License';
static const List<Dependency> androidDependencies = [
Dependency(
name: 'AndroidSVG',
license: apache2,
sourceUrl: 'https://github.com/BigBadaboom/androidsvg',
),
Dependency(
name: 'AndroidX (Core Kotlin, Exifinterface, Lifecycle Process, Multidex)',
license: apache2,
licenseUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-main/LICENSE.txt',
sourceUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-main/core/core-ktx',
),
Dependency(
name: 'CWAC-Document',
license: apache2,
sourceUrl: 'https://github.com/commonsguy/cwac-document',
),
Dependency(
name: 'Glide',
license: '$apache2, $bsd2',
sourceUrl: 'https://github.com/bumptech/glide',
),
Dependency(
name: 'Metadata Extractor',
license: apache2,
sourceUrl: 'https://github.com/drewnoakes/metadata-extractor',
),
Dependency(
name: 'MP4 Parser (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/deckerst/mp4parser',
),
Dependency(
name: 'PixyMeta Android (Aves fork)',
license: eclipse1,
sourceUrl: 'https://github.com/deckerst/pixymeta-android',
),
Dependency(
name: 'Tiff Bitmap Factory (Aves fork)',
license: mit,
licenseUrl: 'https://github.com/deckerst/Android-TiffBitmapFactory/blob/master/license.txt',
sourceUrl: 'https://github.com/deckerst/Android-TiffBitmapFactory',
),
];
static const List<Dependency> _flutterPluginsCommon = [
Dependency(
name: 'Connectivity Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/connectivity_plus/connectivity_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/connectivity_plus',
),
Dependency(
name: 'Device Info Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/device_info_plus/device_info_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus',
),
Dependency(
name: 'Dynamic Color',
license: bsd3,
sourceUrl: 'https://github.com/material-foundation/material-dynamic-color-flutter',
),
Dependency(
name: 'fijkplayer (Aves fork)',
license: mit,
sourceUrl: 'https://github.com/deckerst/fijkplayer',
),
Dependency(
name: 'Flutter Display Mode',
license: mit,
sourceUrl: 'https://github.com/ajinasokan/flutter_displaymode',
),
Dependency(
name: 'Package Info Plus',
license: bsd3,
licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/LICENSE',
sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus',
),
Dependency(
name: 'Permission Handler',
license: mit,
sourceUrl: 'https://github.com/Baseflow/flutter-permission-handler',
),
Dependency(
name: 'Printing',
license: apache2,
sourceUrl: 'https://github.com/DavBfr/dart_pdf',
),
Dependency(
name: 'Screen Brightness',
license: mit,
sourceUrl: 'https://github.com/aaassseee/screen_brightness',
),
Dependency(
name: 'Shared Preferences',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/shared_preferences/shared_preferences/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences',
),
Dependency(
name: 'sqflite',
license: bsd2,
sourceUrl: 'https://github.com/tekartik/sqflite',
),
Dependency(
name: 'Streams Channel (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/deckerst/aves_streams_channel',
),
Dependency(
name: 'URL Launcher',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/url_launcher/url_launcher/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher',
),
];
static const List<Dependency> _googleMobileServices = [
Dependency(
name: 'Google API Availability',
license: mit,
sourceUrl: 'https://github.com/Baseflow/flutter-google-api-availability',
),
Dependency(
name: 'Google Maps for Flutter',
license: bsd3,
licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/google_maps_flutter/google_maps_flutter/LICENSE',
sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter',
),
];
static const List<Dependency> _huaweiMobileServices = [
Dependency(
name: 'Huawei Mobile Services (Availability, Map)',
license: apache2,
licenseUrl: 'https://github.com/HMS-Core/hms-flutter-plugin/blob/master/LICENCE',
sourceUrl: 'https://github.com/HMS-Core/hms-flutter-plugin',
),
];
static const List<Dependency> _flutterPluginsHuaweiOnly = [
..._huaweiMobileServices,
];
static const List<Dependency> _flutterPluginsIzzyOnly = [
..._googleMobileServices,
];
static const List<Dependency> _flutterPluginsLibreOnly = [];
static const List<Dependency> _flutterPluginsPlayOnly = [
..._googleMobileServices,
Dependency(
name: 'FlutterFire (Core, Crashlytics)',
license: bsd3,
sourceUrl: 'https://github.com/FirebaseExtended/flutterfire',
),
];
static List<Dependency> flutterPlugins(AppFlavor flavor) => [
..._flutterPluginsCommon,
if (flavor == AppFlavor.huawei) ..._flutterPluginsHuaweiOnly,
if (flavor == AppFlavor.izzy) ..._flutterPluginsIzzyOnly,
if (flavor == AppFlavor.libre) ..._flutterPluginsLibreOnly,
if (flavor == AppFlavor.play) ..._flutterPluginsPlayOnly,
];
static const List<Dependency> flutterPackages = [
Dependency(
name: 'Charts',
license: apache2,
sourceUrl: 'https://github.com/google/charts',
),
Dependency(
name: 'Custom rounded rectangle border',
license: mit,
sourceUrl: 'https://github.com/lekanbar/custom_rounded_rectangle_border',
),
Dependency(
name: 'Decorated Icon',
license: mit,
sourceUrl: 'https://github.com/benPesso/flutter_decorated_icon',
),
Dependency(
name: 'Expansion Tile Card (Aves fork)',
license: bsd3,
sourceUrl: 'https://github.com/deckerst/expansion_tile_card',
),
Dependency(
name: 'FlexColorPicker',
license: bsd3,
sourceUrl: 'https://github.com/rydmike/flex_color_picker',
),
Dependency(
name: 'Flutter Highlight',
license: mit,
sourceUrl: 'https://github.com/git-touch/highlight',
),
Dependency(
name: 'Flutter Map',
license: bsd3,
sourceUrl: 'https://github.com/fleaflet/flutter_map',
),
Dependency(
name: 'Flutter Markdown',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/flutter_markdown/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/flutter_markdown',
),
Dependency(
name: 'Flutter Staggered Animations',
license: mit,
sourceUrl: 'https://github.com/mobiten/flutter_staggered_animations',
),
Dependency(
name: 'Material Design Icons Flutter',
license: mit,
sourceUrl: 'https://github.com/ziofat/material_design_icons_flutter',
),
Dependency(
name: 'Overlay Support',
license: apache2,
sourceUrl: 'https://github.com/boyan01/overlay_support',
),
Dependency(
name: 'Palette Generator',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/palette_generator/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/palette_generator',
),
Dependency(
name: 'Panorama (Aves fork)',
license: apache2,
sourceUrl: 'https://github.com/zesage/panorama',
),
Dependency(
name: 'Percent Indicator',
license: bsd2,
sourceUrl: 'https://github.com/diegoveloper/flutter_percent_indicator',
),
Dependency(
name: 'Provider',
license: mit,
sourceUrl: 'https://github.com/rrousselGit/provider',
),
Dependency(
name: 'Smooth Page Indicator',
license: mit,
sourceUrl: 'https://github.com/Milad-Akarie/smooth_page_indicator',
),
];
static const List<Dependency> dartPackages = [
Dependency(
name: 'Collection',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/collection',
),
Dependency(
name: 'Country Code',
license: mit,
sourceUrl: 'https://github.com/denixport/dart.country',
),
Dependency(
name: 'Equatable',
license: mit,
sourceUrl: 'https://github.com/felangel/equatable',
),
Dependency(
name: 'Event Bus',
license: mit,
sourceUrl: 'https://github.com/marcojakob/dart-event-bus',
),
Dependency(
name: 'Fluster',
license: mit,
sourceUrl: 'https://github.com/alfonsocejudo/fluster',
),
Dependency(
name: 'Flutter Lints',
license: bsd3,
licenseUrl: 'https://github.com/flutter/packages/blob/master/packages/flutter_lints/LICENSE',
sourceUrl: 'https://github.com/flutter/packages/tree/master/packages/flutter_lints',
),
Dependency(
name: 'Get It',
license: mit,
sourceUrl: 'https://github.com/fluttercommunity/get_it',
),
Dependency(
name: 'Intl',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/intl',
),
Dependency(
name: 'LatLong2',
license: apache2,
sourceUrl: 'https://github.com/jifalops/dart-latlong',
),
Dependency(
name: 'Material Color Utilities',
license: apache2,
licenseUrl: 'https://github.com/material-foundation/material-color-utilities/tree/main/dart/LICENSE',
sourceUrl: 'https://github.com/material-foundation/material-color-utilities/tree/main/dart',
),
Dependency(
name: 'Path',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/path',
),
Dependency(
name: 'PDF for Dart and Flutter',
license: apache2,
sourceUrl: 'https://github.com/DavBfr/dart_pdf',
),
Dependency(
name: 'Proj4dart',
license: mit,
sourceUrl: 'https://github.com/maRci002/proj4dart',
),
Dependency(
name: 'Stack Trace',
license: bsd3,
sourceUrl: 'https://github.com/dart-lang/stack_trace',
),
Dependency(
name: 'Transparent Image',
license: mit,
sourceUrl: 'https://github.com/brianegan/transparent_image',
),
Dependency(
name: 'Tuple',
license: bsd2,
sourceUrl: 'https://github.com/google/tuple.dart',
),
Dependency(
name: 'XML',
license: mit,
sourceUrl: 'https://github.com/renggli/dart-xml',
),
];
}
class Dependency {
final String name;
final String license;
final String sourceUrl;
final String licenseUrl;
const Dependency({
required this.name,
required this.license,
String? licenseUrl,
required this.sourceUrl,
}) : licenseUrl = licenseUrl ?? '$sourceUrl/blob/master/LICENSE';
}

View file

@ -20,6 +20,7 @@ class AboutPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final appBarTitle = Text(context.l10n.aboutPageTitle);
final useTvLayout = settings.useTvLayout;
final body = CustomScrollView(
slivers: [
SliverPadding(
@ -27,7 +28,7 @@ class AboutPage extends StatelessWidget {
sliver: SliverList(
delegate: SliverChildListDelegate(
[
const AppReference(),
AppReference(showLogo: !useTvLayout),
if (!settings.useTvLayout) ...[
const Divider(),
const BugReport(),
@ -46,7 +47,7 @@ class AboutPage extends StatelessWidget {
],
);
if (settings.useTvLayout) {
if (useTvLayout) {
return Scaffold(
body: AvesPopScope(
handlers: const [TvNavigationPopHandler.pop],

View file

@ -10,7 +10,12 @@ import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
class AppReference extends StatefulWidget {
const AppReference({super.key});
final bool showLogo;
const AppReference({
super.key,
required this.showLogo,
});
@override
State<AppReference> createState() => _AppReferenceState();
@ -52,10 +57,12 @@ class _AppReferenceState extends State<AppReference> {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
AvesLogo(
size: style.fontSize! * MediaQuery.textScaleFactorOf(context) * 1.3,
),
const SizedBox(width: 8),
if (widget.showLogo) ...[
AvesLogo(
size: style.fontSize! * MediaQuery.textScaleFactorOf(context) * 1.3,
),
const SizedBox(width: 8),
],
Text(
'${context.l10n.appName} ${snapshot.data?.version}',
style: style,

View file

@ -2,6 +2,7 @@ import 'package:aves/app_flavor.dart';
import 'package:aves/ref/brand_colors.dart';
import 'package:aves/theme/colors.dart';
import 'package:aves/utils/constants.dart';
import 'package:aves/utils/dependencies.dart';
import 'package:aves/widgets/common/basic/link_chip.dart';
import 'package:aves/widgets/common/extensions/build_context.dart';
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
@ -24,10 +25,10 @@ class _LicensesState extends State<Licenses> {
@override
void initState() {
super.initState();
_platform = List<Dependency>.from(Constants.androidDependencies);
_flutterPlugins = List<Dependency>.from(Constants.flutterPlugins(context.read<AppFlavor>()));
_flutterPackages = List<Dependency>.from(Constants.flutterPackages);
_dartPackages = List<Dependency>.from(Constants.dartPackages);
_platform = List<Dependency>.from(Dependencies.androidDependencies);
_flutterPlugins = List<Dependency>.from(Dependencies.flutterPlugins(context.read<AppFlavor>()));
_flutterPackages = List<Dependency>.from(Dependencies.flutterPackages);
_dartPackages = List<Dependency>.from(Dependencies.dartPackages);
_sortPackages();
}

View file

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:math';
import 'dart:ui';
import 'package:aves/app_flavor.dart';
@ -436,10 +437,36 @@ class _AvesAppState extends State<AvesApp> with WidgetsBindingObserver {
settings.applyTvSettings();
_pageTransitionsBuilderNotifier.value = const TvPageTransitionsBuilder();
_tvMediaQueryModifierNotifier.value = (mq) => mq.copyWith(
textScaleFactor: 1.1,
navigationMode: NavigationMode.directional,
);
_tvMediaQueryModifierNotifier.value = (mq) {
// cf https://developer.android.com/training/tv/start/layouts.html#overscan
final screenSize = mq.size;
const overscanFactor = .05;
final overscanInsets = EdgeInsets.symmetric(
vertical: screenSize.shortestSide * overscanFactor,
horizontal: screenSize.longestSide * overscanFactor,
);
final oldViewPadding = mq.viewPadding;
final newViewPadding = EdgeInsets.only(
top: max(oldViewPadding.top, overscanInsets.top),
right: max(oldViewPadding.right, overscanInsets.right),
bottom: max(oldViewPadding.bottom, overscanInsets.bottom),
left: max(oldViewPadding.left, overscanInsets.left),
);
var newPadding = newViewPadding - mq.viewInsets;
newPadding = EdgeInsets.only(
top: max(0.0, newPadding.top),
right: max(0.0, newPadding.right),
bottom: max(0.0, newPadding.bottom),
left: max(0.0, newPadding.left),
);
return mq.copyWith(
textScaleFactor: 1.1,
padding: newPadding,
viewPadding: newViewPadding,
navigationMode: NavigationMode.directional,
);
};
if (settings.forceTvLayout) {
await windowService.requestOrientation(Orientation.landscape);
}

View file

@ -86,10 +86,15 @@ class _SettingsPageState extends State<SettingsPage> with FeedbackMixin {
child: Column(
children: [
const SizedBox(height: 8),
AppBar(
automaticallyImplyLeading: false,
title: appBarTitle,
elevation: 0,
DirectionalSafeArea(
start: false,
bottom: false,
child: AppBar(
automaticallyImplyLeading: false,
title: appBarTitle,
elevation: 0,
primary: false,
),
),
Expanded(
child: ValueListenableBuilder<int>(

View file

@ -35,9 +35,9 @@ class InfoAppBar extends StatelessWidget {
Widget build(BuildContext context) {
final commonActions = EntryActions.commonMetadataActions.where((v) => actionDelegate.isVisible(entry, v));
final formatSpecificActions = EntryActions.formatSpecificMetadataActions.where((v) => actionDelegate.isVisible(entry, v));
final useTvLayout = settings.useTvLayout;
return SliverAppBar(
leading: settings.useTvLayout
leading: useTvLayout
? null
: IconButton(
// key is expected by test driver
@ -53,34 +53,36 @@ class InfoAppBar extends StatelessWidget {
child: Text(context.l10n.viewerInfoPageTitle),
),
),
actions: [
IconButton(
icon: const Icon(AIcons.search),
onPressed: () => _goToSearch(context),
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
),
if (entry.canEdit)
MenuIconTheme(
child: PopupMenuButton<EntryAction>(
itemBuilder: (context) => [
...commonActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
if (formatSpecificActions.isNotEmpty) ...[
const PopupMenuDivider(),
...formatSpecificActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
],
if (!kReleaseMode) ...[
const PopupMenuDivider(),
_toMenuItem(context, EntryAction.debug, enabled: true),
]
],
onSelected: (action) async {
// wait for the popup menu to hide before proceeding with the action
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
actionDelegate.onActionSelected(context, entry, collection, action);
},
),
),
],
actions: useTvLayout
? []
: [
IconButton(
icon: const Icon(AIcons.search),
onPressed: () => _goToSearch(context),
tooltip: MaterialLocalizations.of(context).searchFieldLabel,
),
if (entry.canEdit)
MenuIconTheme(
child: PopupMenuButton<EntryAction>(
itemBuilder: (context) => [
...commonActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
if (formatSpecificActions.isNotEmpty) ...[
const PopupMenuDivider(),
...formatSpecificActions.map((action) => _toMenuItem(context, action, enabled: actionDelegate.canApply(entry, action))),
],
if (!kReleaseMode) ...[
const PopupMenuDivider(),
_toMenuItem(context, EntryAction.debug, enabled: true),
]
],
onSelected: (action) async {
// wait for the popup menu to hide before proceeding with the action
await Future.delayed(Durations.popupMenuAnimation * timeDilation);
actionDelegate.onActionSelected(context, entry, collection, action);
},
),
),
],
floating: true,
);
}