diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 8cf139144..1d20ed1e5 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -3,6 +3,9 @@ import 'package:flutter/painting.dart'; import 'package:tuple/tuple.dart'; class Constants { + static const Color androidGreen = Color(0xFF3DDC84); + static const Color flutterBlue = Color(0xFF47D1FD); + // as of Flutter v1.22.3, overflowing `Text` miscalculates height and some text (e.g. 'Å') is clipped // so we give it a `strutStyle` with a slightly larger height static const overflowStrutStyle = StrutStyle(height: 1.3); @@ -26,6 +29,18 @@ class Constants { static const int infoGroupMaxValueLength = 140; static const List androidDependencies = [ + Dependency( + name: 'AndroidX Core-KTX', + license: 'Apache 2.0', + licenseUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/LICENSE.txt', + sourceUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/core/core-ktx', + ), + Dependency( + name: 'AndroidX Exifinterface', + license: 'Apache 2.0', + licenseUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/LICENSE.txt', + sourceUrl: 'https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/exifinterface/exifinterface', + ), Dependency( name: 'Android-TiffBitmapFactory', license: 'MIT', @@ -96,7 +111,7 @@ class Constants { sourceUrl: 'https://github.com/Skylled/expansion_tile_card', ), Dependency( - name: 'FlutterFire', + name: 'FlutterFire (Core, Analytics, Crashlytics)', license: 'BSD 3-Clause', licenseUrl: 'https://github.com/FirebaseExtended/flutterfire/blob/master/LICENSE', sourceUrl: 'https://github.com/FirebaseExtended/flutterfire', @@ -186,7 +201,7 @@ class Constants { sourceUrl: 'https://github.com/boyan01/overlay_support', ), Dependency( - name: 'Package info', + name: 'Package Info', license: 'BSD 3-Clause', licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/package_info/LICENSE', sourceUrl: 'https://github.com/flutter/plugins/tree/master/packages/package_info', @@ -275,12 +290,6 @@ class Constants { licenseUrl: 'https://github.com/flutter/plugins/blob/master/packages/url_launcher/url_launcher/LICENSE', sourceUrl: 'https://github.com/flutter/plugins/blob/master/packages/url_launcher/url_launcher', ), - Dependency( - name: 'UUID', - license: 'MIT', - licenseUrl: 'https://github.com/Daegalus/dart-uuid/blob/master/LICENSE', - sourceUrl: 'https://github.com/Daegalus/dart-uuid', - ), ]; } diff --git a/lib/widgets/about/about_page.dart b/lib/widgets/about/about_page.dart index 6e35112f6..a2bba1eee 100644 --- a/lib/widgets/about/about_page.dart +++ b/lib/widgets/about/about_page.dart @@ -3,7 +3,6 @@ import 'package:aves/widgets/about/licenses.dart'; import 'package:aves/widgets/common/aves_logo.dart'; import 'package:aves/widgets/common/link_chip.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:package_info/package_info.dart'; class AboutPage extends StatelessWidget { @@ -16,24 +15,58 @@ class AboutPage extends StatelessWidget { title: Text('About'), ), body: SafeArea( - child: AnimationLimiter( - child: CustomScrollView( - slivers: [ - SliverPadding( - padding: EdgeInsets.only(top: 16), - sliver: SliverList( - delegate: SliverChildListDelegate( - [ - AppReference(), - SizedBox(height: 16), - Divider(), - ], - ), + child: CustomScrollView( + slivers: [ + SliverPadding( + padding: EdgeInsets.only(top: 16), + sliver: SliverList( + delegate: SliverChildListDelegate( + [ + AppReference(), + SizedBox(height: 16), + Divider(), + Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ConstrainedBox( + constraints: BoxConstraints(minHeight: 48), + child: Align( + alignment: AlignmentDirectional.centerStart, + child: Text( + 'Credits', + style: Theme.of(context).textTheme.headline6.copyWith(fontFamily: 'Concourse Caps'), + ), + ), + ), + RichText( + text: TextSpan( + children: [ + TextSpan(text: 'This app uses the font '), + WidgetSpan( + child: LinkChip( + text: 'Concourse', + url: 'https://mbtype.com/fonts/concourse/', + textStyle: TextStyle(fontWeight: FontWeight.bold), + ), + alignment: PlaceholderAlignment.middle, + ), + TextSpan(text: ' for titles and the media information page.'), + ], + ), + ), + SizedBox(height: 16), + ], + ), + ), + Divider(), + ], ), ), - Licenses(), - ], - ), + ), + Licenses(), + ], ), ), ); diff --git a/lib/widgets/about/licenses.dart b/lib/widgets/about/licenses.dart index e8241cc70..f56456504 100644 --- a/lib/widgets/about/licenses.dart +++ b/lib/widgets/about/licenses.dart @@ -1,11 +1,10 @@ import 'package:aves/utils/constants.dart'; -import 'package:aves/utils/durations.dart'; +import 'package:aves/widgets/common/aves_expansion_tile.dart'; import 'package:aves/widgets/common/icons.dart'; import 'package:aves/widgets/common/link_chip.dart'; import 'package:aves/widgets/common/menu_row.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; class Licenses extends StatefulWidget { @override @@ -13,18 +12,20 @@ class Licenses extends StatefulWidget { } class _LicensesState extends State { + final ValueNotifier _expandedNotifier = ValueNotifier(null); LicenseSort _sort = LicenseSort.name; - List _packages; + List _platform, _flutter; @override void initState() { super.initState(); - _packages = [...Constants.androidDependencies, ...Constants.flutterPackages]; + _platform = List.from(Constants.androidDependencies); + _flutter = List.from(Constants.flutterPackages); _sortPackages(); } void _sortPackages() { - _packages.sort((a, b) { + int compare(Dependency a, Dependency b) { switch (_sort) { case LicenseSort.license: final c = compareAsciiUpperCase(a.license, b.license); @@ -33,7 +34,10 @@ class _LicensesState extends State { default: return compareAsciiUpperCase(a.name, b.name); } - }); + } + + _platform.sort(compare); + _flutter.sort(compare); } @override @@ -41,25 +45,29 @@ class _LicensesState extends State { return SliverPadding( padding: EdgeInsets.symmetric(horizontal: 8), sliver: SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) { - if (index-- == 0) { - return _buildHeader(); - } - final child = LicenseRow(_packages[index]); - return AnimationConfiguration.staggeredList( - position: index, - duration: Durations.staggeredAnimation, - delay: Durations.staggeredAnimationDelay, - child: SlideAnimation( - verticalOffset: 50.0, - child: FadeInAnimation( - child: child, - ), + delegate: SliverChildListDelegate( + [ + _buildHeader(), + SizedBox(height: 16), + AvesExpansionTile( + title: 'Android Libraries', + color: Constants.androidGreen, + expandedNotifier: _expandedNotifier, + children: _platform.map((package) => LicenseRow(package)).toList(), + ), + AvesExpansionTile( + title: 'Flutter Packages', + color: Constants.flutterBlue, + expandedNotifier: _expandedNotifier, + children: _flutter.map((package) => LicenseRow(package)).toList(), + ), + Center( + child: TextButton( + onPressed: () => showLicensePage(context: context), + child: Text('All Licenses'.toUpperCase()), ), - ); - }, - childCount: _packages.length + 1, + ), + ], ), ), ); @@ -122,7 +130,7 @@ class LicenseRow extends StatelessWidget { final subColor = bodyTextStyle.color.withOpacity(.6); return Padding( - padding: EdgeInsets.only(top: 16), + padding: EdgeInsets.symmetric(vertical: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/common/aves_expansion_tile.dart b/lib/widgets/common/aves_expansion_tile.dart index 9155483ed..e1a60a9fd 100644 --- a/lib/widgets/common/aves_expansion_tile.dart +++ b/lib/widgets/common/aves_expansion_tile.dart @@ -4,11 +4,13 @@ import 'package:flutter/material.dart'; class AvesExpansionTile extends StatelessWidget { final String title; + final Color color; final List children; final ValueNotifier expandedNotifier; const AvesExpansionTile({ @required this.title, + this.color, this.expandedNotifier, @required this.children, }); @@ -27,6 +29,7 @@ class AvesExpansionTile extends StatelessWidget { expandedNotifier: expandedNotifier, title: HighlightTitle( title, + color: color, fontSize: 18, enabled: enabled, ), diff --git a/lib/widgets/common/highlight_title.dart b/lib/widgets/common/highlight_title.dart index 11c8ba448..f34e69880 100644 --- a/lib/widgets/common/highlight_title.dart +++ b/lib/widgets/common/highlight_title.dart @@ -4,11 +4,13 @@ import 'package:flutter/material.dart'; class HighlightTitle extends StatelessWidget { final String name; + final Color color; final double fontSize; final bool enabled; const HighlightTitle( this.name, { + this.color, this.fontSize = 20, this.enabled = true, }) : assert(name != null); @@ -21,7 +23,7 @@ class HighlightTitle extends StatelessWidget { alignment: AlignmentDirectional.centerStart, child: Container( decoration: HighlightDecoration( - color: enabled ? stringToColor(name) : disabledColor, + color: enabled ? color ?? stringToColor(name) : disabledColor, ), margin: EdgeInsets.symmetric(vertical: 4.0), child: Text( diff --git a/lib/widgets/fullscreen/info/location_section.dart b/lib/widgets/fullscreen/info/location_section.dart index c1c98445a..c6a1e3db2 100644 --- a/lib/widgets/fullscreen/info/location_section.dart +++ b/lib/widgets/fullscreen/info/location_section.dart @@ -173,7 +173,7 @@ extension ExtraEntryMapStyle on EntryMapStyle { case EntryMapStyle.googleTerrain: return 'Google Maps (Terrain)'; case EntryMapStyle.osmHot: - return 'Humanitarian OpenStreetMap'; + return 'Humanitarian OSM'; case EntryMapStyle.stamenToner: return 'Stamen Toner'; case EntryMapStyle.stamenWatercolor: diff --git a/pubspec.lock b/pubspec.lock index 8da6ecfb9..b505bdcad 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1048,7 +1048,7 @@ packages: source: hosted version: "0.9.0+5" uuid: - dependency: "direct main" + dependency: transitive description: name: uuid url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index a6b8ddc1f..696fa5589 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -93,7 +93,6 @@ dependencies: streams_channel: tuple: url_launcher: - uuid: dev_dependencies: flutter_test: