diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0ee25fb..c10a1b3cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file. - Portuguese translation (thanks Jonatas De Almeida Barros) +### Removed + +- new version check + +### Fixed + +- loading when system locale uses non-western arabic numerals +- handling timestamps provided in 10^-8 s (18 digits) + ## [v1.5.10] - 2022-01-07 ### Added diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 42b169247..6ee2c7e33 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -230,13 +230,6 @@ "aboutLinkLicense": "Lizenz", "aboutLinkPolicy": "Datenschutzrichtlinie", - "aboutUpdate": "Neue Version verfügbar", - "aboutUpdateLinks1": "Eine neue Version von Aves ist verfügbar unter", - "aboutUpdateLinks2": "und", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "github", - "aboutUpdateGooglePlay": "Google Play", - "aboutBug": "Fehlerbericht", "aboutBugSaveLogInstruction": "Anwendungsprotokolle in einer Datei speichern", "aboutBugSaveLogButton": "Speichern", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 796241878..c8cc1ca4b 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -342,13 +342,6 @@ "aboutLinkLicense": "License", "aboutLinkPolicy": "Privacy Policy", - "aboutUpdate": "New Version Available", - "aboutUpdateLinks1": "A new version of Aves is available on", - "aboutUpdateLinks2": "and", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "GitHub", - "aboutUpdateGooglePlay": "Google Play", - "aboutBug": "Bug Report", "aboutBugSaveLogInstruction": "Save app logs to a file", "aboutBugSaveLogButton": "Save", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 4ab87bc60..210df2ddc 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -231,13 +231,6 @@ "aboutLinkLicense": "Licencia", "aboutLinkPolicy": "Política de privacidad", - "aboutUpdate": "Nueva versión disponible", - "aboutUpdateLinks1": "Una nueva versión de Aves se encuentra disponible en", - "aboutUpdateLinks2": "y", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "GitHub", - "aboutUpdateGooglePlay": "Google Play", - "aboutBug": "Reporte de errores", "aboutBugSaveLogInstruction": "Guardar registros de la aplicación a un archivo", "aboutBugSaveLogButton": "Guardar", diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 16cfef726..06182af36 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -230,13 +230,6 @@ "aboutLinkLicense": "Licence", "aboutLinkPolicy": "Politique de confidentialité", - "aboutUpdate": "Nouvelle Version", - "aboutUpdateLinks1": "Une nouvelle version d’Aves est disponible sur", - "aboutUpdateLinks2": "et", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "GitHub", - "aboutUpdateGooglePlay": "Google Play", - "aboutBug": "Rapports d’erreur", "aboutBugSaveLogInstruction": "Sauvegarder les logs de l’app vers un fichier", "aboutBugSaveLogButton": "Sauvegarder", diff --git a/lib/l10n/app_ko.arb b/lib/l10n/app_ko.arb index eb867fba8..0496814fb 100644 --- a/lib/l10n/app_ko.arb +++ b/lib/l10n/app_ko.arb @@ -230,13 +230,6 @@ "aboutLinkLicense": "라이선스", "aboutLinkPolicy": "개인정보 보호정책", - "aboutUpdate": "업데이트 사용 가능", - "aboutUpdateLinks1": "앱의 최신 버전을", - "aboutUpdateLinks2": "와", - "aboutUpdateLinks3": "에서 다운로드 사용 가능합니다.", - "aboutUpdateGitHub": "깃허브", - "aboutUpdateGooglePlay": "구글 플레이", - "aboutBug": "버그 보고", "aboutBugSaveLogInstruction": "앱 로그를 파일에 저장하기", "aboutBugSaveLogButton": "저장", diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index 5c63c736a..bbe8c56bb 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -230,13 +230,6 @@ "aboutLinkLicense": "Licença", "aboutLinkPolicy": "Política de Privacidade", - "aboutUpdate": "Nova versão disponível", - "aboutUpdateLinks1": "Uma nova versão do Aves está disponível em", - "aboutUpdateLinks2": "e", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "GitHub", - "aboutUpdateGooglePlay": "Google Play", - "aboutBug": "Relatório de erro", "aboutBugSaveLogInstruction": "Salvar registros de aplicativos em um arquivo", "aboutBugSaveLogButton": "Salve", diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index 1d8649cc9..e2e5d26eb 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -230,13 +230,6 @@ "aboutLinkLicense": "Лицензия", "aboutLinkPolicy": "Политика конфиденциальности", - "aboutUpdate": "Доступна новая версия", - "aboutUpdateLinks1": "Новая версия Aves доступна на", - "aboutUpdateLinks2": "и", - "aboutUpdateLinks3": ".", - "aboutUpdateGitHub": "GitHub", - "aboutUpdateGooglePlay": "Play Маркет", - "aboutBug": "Отчет об ошибке", "aboutBugSaveLogInstruction": "Сохраните логи приложения в файл", "aboutBugSaveLogButton": "Сохранить", diff --git a/lib/model/availability.dart b/lib/model/availability.dart index 008d0e76c..bdbb691fd 100644 --- a/lib/model/availability.dart +++ b/lib/model/availability.dart @@ -1,12 +1,7 @@ import 'package:aves/model/device.dart'; -import 'package:aves/model/settings/settings.dart'; -import 'package:aves/theme/durations.dart'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/foundation.dart'; -import 'package:github/github.dart'; import 'package:google_api_availability/google_api_availability.dart'; -import 'package:package_info_plus/package_info_plus.dart'; -import 'package:version/version.dart'; abstract class AvesAvailability { void onResume(); @@ -18,12 +13,10 @@ abstract class AvesAvailability { Future get canLocatePlaces; Future get canUseGoogleMaps; - - Future get isNewVersionAvailable; } class LiveAvesAvailability implements AvesAvailability { - bool? _isConnected, _hasPlayServices, _isNewVersionAvailable; + bool? _isConnected, _hasPlayServices; LiveAvesAvailability() { Connectivity().onConnectivityChanged.listen(_updateConnectivityFromResult); @@ -63,30 +56,4 @@ class LiveAvesAvailability implements AvesAvailability { @override Future get canUseGoogleMaps async => device.canRenderGoogleMaps && await hasPlayServices; - - @override - Future get isNewVersionAvailable async { - if (_isNewVersionAvailable != null) return SynchronousFuture(_isNewVersionAvailable!); - - final now = DateTime.now(); - final dueDate = settings.lastVersionCheckDate.add(Durations.lastVersionCheckInterval); - if (now.isBefore(dueDate)) { - _isNewVersionAvailable = false; - return SynchronousFuture(_isNewVersionAvailable!); - } - - if (!(await isConnected)) return false; - - Version version(String s) => Version.parse(s.replaceFirst('v', '')); - final currentTag = (await PackageInfo.fromPlatform()).version; - final latestTag = (await GitHub().repositories.getLatestRelease(RepositorySlug('deckerst', 'aves'))).tagName!; - _isNewVersionAvailable = version(latestTag) > version(currentTag); - if (_isNewVersionAvailable!) { - debugPrint('Aves $latestTag is available on github'); - } else { - debugPrint('Aves $currentTag is the latest version'); - settings.lastVersionCheckDate = now; - } - return _isNewVersionAvailable!; - } } diff --git a/lib/model/settings/settings.dart b/lib/model/settings/settings.dart index 1b7f9c872..707804c4d 100644 --- a/lib/model/settings/settings.dart +++ b/lib/model/settings/settings.dart @@ -35,7 +35,6 @@ class Settings extends ChangeNotifier { catalogTimeZoneKey, videoShowRawTimedTextKey, searchHistoryKey, - lastVersionCheckDateKey, }; // app @@ -116,9 +115,6 @@ class Settings extends ChangeNotifier { static const accessibilityAnimationsKey = 'accessibility_animations'; static const timeToTakeActionKey = 'time_to_take_action'; - // version - static const lastVersionCheckDateKey = 'last_version_check_date'; - // file picker static const filePickerShowHiddenFilesKey = 'file_picker_show_hidden_files'; @@ -478,12 +474,6 @@ class Settings extends ChangeNotifier { set timeToTakeAction(AccessibilityTimeout newValue) => setAndNotify(timeToTakeActionKey, newValue.toString()); - // version - - DateTime get lastVersionCheckDate => DateTime.fromMillisecondsSinceEpoch(_prefs!.getInt(lastVersionCheckDateKey) ?? 0); - - set lastVersionCheckDate(DateTime newValue) => setAndNotify(lastVersionCheckDateKey, newValue.millisecondsSinceEpoch); - // file picker bool get filePickerShowHiddenFiles => getBoolOrDefault(filePickerShowHiddenFilesKey, SettingsDefaults.filePickerShowHiddenFiles); diff --git a/lib/theme/durations.dart b/lib/theme/durations.dart index 92909675c..bed800993 100644 --- a/lib/theme/durations.dart +++ b/lib/theme/durations.dart @@ -20,9 +20,6 @@ class Durations { static const appBarTitleAnimation = Duration(milliseconds: 300); static const appBarActionChangeAnimation = Duration(milliseconds: 200); - // drawer - static const newsBadgeAnimation = Duration(milliseconds: 200); - // filter grids animations static const chipDecorationAnimation = Duration(milliseconds: 200); static const highlightScrollAnimationMinMillis = 400; @@ -68,9 +65,6 @@ class Durations { static const contentChangeDebounceDelay = Duration(milliseconds: 1000); static const mapInfoDebounceDelay = Duration(milliseconds: 150); static const mapIdleDebounceDelay = Duration(milliseconds: 100); - - // app life - static const lastVersionCheckInterval = Duration(days: 7); } class DurationsProvider extends StatelessWidget { diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index d2c111bef..8d434e1e0 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -296,11 +296,6 @@ class Constants { license: 'MIT', sourceUrl: 'https://github.com/fluttercommunity/get_it', ), - Dependency( - name: 'GitHub', - license: 'MIT', - sourceUrl: 'https://github.com/SpinlockLabs/github.dart', - ), Dependency( name: 'Intl', license: 'BSD 3-Clause', @@ -331,11 +326,6 @@ class Constants { license: 'BSD 2-Clause', sourceUrl: 'https://github.com/google/tuple.dart', ), - Dependency( - name: 'Version', - license: 'BSD 3-Clause', - sourceUrl: 'https://github.com/dartninja/version', - ), Dependency( name: 'XML', license: 'MIT', diff --git a/lib/widgets/about/about_page.dart b/lib/widgets/about/about_page.dart index 7e124c114..f87841ab4 100644 --- a/lib/widgets/about/about_page.dart +++ b/lib/widgets/about/about_page.dart @@ -2,7 +2,6 @@ import 'package:aves/widgets/about/app_ref.dart'; import 'package:aves/widgets/about/bug_report.dart'; import 'package:aves/widgets/about/credits.dart'; import 'package:aves/widgets/about/licenses.dart'; -import 'package:aves/widgets/about/update.dart'; import 'package:aves/widgets/common/extensions/build_context.dart'; import 'package:flutter/material.dart'; @@ -27,7 +26,6 @@ class AboutPage extends StatelessWidget { const [ AppReference(), Divider(), - AboutUpdate(), BugReport(), Divider(), AboutCredits(), diff --git a/lib/widgets/about/news_badge.dart b/lib/widgets/about/news_badge.dart deleted file mode 100644 index c0557a82e..000000000 --- a/lib/widgets/about/news_badge.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:flutter/material.dart'; - -class AboutNewsBadge extends StatelessWidget { - const AboutNewsBadge({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return const Icon( - Icons.circle, - size: 12, - color: Colors.red, - ); - } -} diff --git a/lib/widgets/about/update.dart b/lib/widgets/about/update.dart deleted file mode 100644 index 8401c170d..000000000 --- a/lib/widgets/about/update.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:aves/services/common/services.dart'; -import 'package:aves/utils/constants.dart'; -import 'package:aves/widgets/about/news_badge.dart'; -import 'package:aves/widgets/common/basic/link_chip.dart'; -import 'package:aves/widgets/common/extensions/build_context.dart'; -import 'package:flutter/material.dart'; - -class AboutUpdate extends StatefulWidget { - const AboutUpdate({Key? key}) : super(key: key); - - @override - _AboutUpdateState createState() => _AboutUpdateState(); -} - -class _AboutUpdateState extends State { - late Future _updateChecker; - - @override - void initState() { - super.initState(); - _updateChecker = availability.isNewVersionAvailable; - } - - @override - Widget build(BuildContext context) { - return FutureBuilder( - future: _updateChecker, - builder: (context, snapshot) { - final newVersionAvailable = snapshot.data == true; - if (!newVersionAvailable) return const SizedBox(); - return Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ConstrainedBox( - constraints: const BoxConstraints(minHeight: 48), - child: Align( - alignment: AlignmentDirectional.centerStart, - child: Text.rich( - TextSpan( - children: [ - const WidgetSpan( - child: Padding( - padding: EdgeInsetsDirectional.only(end: 8), - child: AboutNewsBadge(), - ), - alignment: PlaceholderAlignment.middle, - ), - TextSpan(text: context.l10n.aboutUpdate, style: Constants.titleTextStyle), - ], - ), - ), - ), - ), - Text.rich( - TextSpan( - children: [ - TextSpan(text: context.l10n.aboutUpdateLinks1), - WidgetSpan( - child: LinkChip( - text: context.l10n.aboutUpdateGitHub, - url: '${Constants.avesGithub}/releases', - textStyle: const TextStyle(fontWeight: FontWeight.bold), - ), - alignment: PlaceholderAlignment.middle, - ), - TextSpan(text: context.l10n.aboutUpdateLinks2), - WidgetSpan( - child: LinkChip( - text: context.l10n.aboutUpdateGooglePlay, - url: 'https://play.google.com/store/apps/details?id=deckers.thibault.aves', - textStyle: const TextStyle(fontWeight: FontWeight.bold), - ), - alignment: PlaceholderAlignment.middle, - ), - TextSpan(text: context.l10n.aboutUpdateLinks3), - ], - ), - ), - const SizedBox(height: 16), - ], - ), - ), - const Divider(), - ], - ); - }, - ); - } -} diff --git a/lib/widgets/debug/settings.dart b/lib/widgets/debug/settings.dart index b3461bea8..de9cf5806 100644 --- a/lib/widgets/debug/settings.dart +++ b/lib/widgets/debug/settings.dart @@ -66,7 +66,6 @@ class DebugSettingsSection extends StatelessWidget { 'pinnedFilters': toMultiline(settings.pinnedFilters), 'hiddenFilters': toMultiline(settings.hiddenFilters), 'searchHistory': toMultiline(settings.searchHistory), - 'lastVersionCheckDate': '${settings.lastVersionCheckDate}', 'locale': '${settings.locale}', 'systemLocales': '${WidgetsBinding.instance!.window.locales}', }, diff --git a/lib/widgets/drawer/app_drawer.dart b/lib/widgets/drawer/app_drawer.dart index c1bbdf53f..3604fa3e0 100644 --- a/lib/widgets/drawer/app_drawer.dart +++ b/lib/widgets/drawer/app_drawer.dart @@ -5,7 +5,6 @@ import 'package:aves/model/source/album.dart'; import 'package:aves/model/source/collection_source.dart'; import 'package:aves/model/source/location.dart'; import 'package:aves/model/source/tag.dart'; -import 'package:aves/services/common/services.dart'; import 'package:aves/theme/durations.dart'; import 'package:aves/theme/icons.dart'; import 'package:aves/utils/android_file_utils.dart'; @@ -25,12 +24,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class AppDrawer extends StatefulWidget { +class AppDrawer extends StatelessWidget { const AppDrawer({Key? key}) : super(key: key); - @override - _AppDrawerState createState() => _AppDrawerState(); - static List getDefaultAlbums(BuildContext context) { final source = context.read(); final specialAlbums = source.rawAlbums.where((album) { @@ -40,26 +36,14 @@ class AppDrawer extends StatefulWidget { ..sort(source.compareAlbumsByName); return specialAlbums; } -} - -class _AppDrawerState extends State { - late Future _newVersionLoader; - - CollectionSource get source => context.read(); - - @override - void initState() { - super.initState(); - _newVersionLoader = availability.isNewVersionAvailable; - } @override Widget build(BuildContext context) { final drawerItems = [ _buildHeader(context), ..._buildTypeLinks(), - _buildAlbumLinks(), - ..._buildPageLinks(), + _buildAlbumLinks(context), + ..._buildPageLinks(context), if (!kReleaseMode) ...[ const Divider(), debugTile, @@ -148,38 +132,7 @@ class _AppDrawerState extends State { key: const Key('drawer-about-button'), onPressed: () => goTo(AboutPage.routeName, (_) => const AboutPage()), icon: const Icon(AIcons.info), - label: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(context.l10n.aboutPageTitle), - FutureBuilder( - future: _newVersionLoader, - builder: (context, snapshot) { - final newVersion = snapshot.data == true; - final badgeSize = 8.0 * MediaQuery.textScaleFactorOf(context); - return AnimatedOpacity( - duration: Durations.newsBadgeAnimation, - opacity: newVersion ? 1 : 0, - child: Padding( - padding: const EdgeInsetsDirectional.only(start: 2), - child: DecoratedBox( - decoration: BoxDecoration( - border: const Border.fromBorderSide(BorderSide(color: Colors.white70)), - borderRadius: BorderRadius.all(Radius.circular(badgeSize)), - ), - child: Icon( - Icons.circle, - size: badgeSize, - color: Colors.red, - ), - ), - ), - ); - }, - ), - ], - ), + label: Text(context.l10n.aboutPageTitle), ), OutlinedButton.icon( // key is expected by test driver @@ -212,7 +165,8 @@ class _AppDrawerState extends State { .toList(); } - Widget _buildAlbumLinks() { + Widget _buildAlbumLinks(BuildContext context) { + final source = context.read(); return StreamBuilder( stream: source.eventBus.on(), builder: (context, snapshot) { @@ -227,10 +181,11 @@ class _AppDrawerState extends State { }); } - List _buildPageLinks() { + List _buildPageLinks(BuildContext context) { final pageBookmarks = settings.drawerPageBookmarks; if (pageBookmarks.isEmpty) return []; + final source = context.read(); return [ const Divider(), ...pageBookmarks.map((route) { diff --git a/pubspec.lock b/pubspec.lock index f4f7601ac..52bb31a05 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -441,13 +441,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.2.0" - github: - dependency: "direct main" - description: - name: github - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.0" glob: dependency: transitive description: @@ -532,13 +525,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.3" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "4.4.0" latlong2: dependency: "direct main" description: @@ -1183,13 +1169,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" - version: - dependency: "direct main" - description: - name: version - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" vm_service: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e406a82ec..af78461c3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,7 +41,6 @@ dependencies: flutter_markdown: flutter_staggered_animations: get_it: - github: google_api_availability: google_maps_flutter: intl: @@ -66,7 +65,6 @@ dependencies: transparent_image: tuple: url_launcher: - version: xml: dev_dependencies: