removed new version check
This commit is contained in:
parent
290465ba17
commit
81caf10ebc
19 changed files with 18 additions and 295 deletions
|
@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
- Portuguese translation (thanks Jonatas De Almeida Barros)
|
- 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)
|
||||||
|
|
||||||
## <a id="v1.5.10"></a>[v1.5.10] - 2022-01-07
|
## <a id="v1.5.10"></a>[v1.5.10] - 2022-01-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -230,13 +230,6 @@
|
||||||
"aboutLinkLicense": "Lizenz",
|
"aboutLinkLicense": "Lizenz",
|
||||||
"aboutLinkPolicy": "Datenschutzrichtlinie",
|
"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",
|
"aboutBug": "Fehlerbericht",
|
||||||
"aboutBugSaveLogInstruction": "Anwendungsprotokolle in einer Datei speichern",
|
"aboutBugSaveLogInstruction": "Anwendungsprotokolle in einer Datei speichern",
|
||||||
"aboutBugSaveLogButton": "Speichern",
|
"aboutBugSaveLogButton": "Speichern",
|
||||||
|
|
|
@ -342,13 +342,6 @@
|
||||||
"aboutLinkLicense": "License",
|
"aboutLinkLicense": "License",
|
||||||
"aboutLinkPolicy": "Privacy Policy",
|
"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",
|
"aboutBug": "Bug Report",
|
||||||
"aboutBugSaveLogInstruction": "Save app logs to a file",
|
"aboutBugSaveLogInstruction": "Save app logs to a file",
|
||||||
"aboutBugSaveLogButton": "Save",
|
"aboutBugSaveLogButton": "Save",
|
||||||
|
|
|
@ -231,13 +231,6 @@
|
||||||
"aboutLinkLicense": "Licencia",
|
"aboutLinkLicense": "Licencia",
|
||||||
"aboutLinkPolicy": "Política de privacidad",
|
"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",
|
"aboutBug": "Reporte de errores",
|
||||||
"aboutBugSaveLogInstruction": "Guardar registros de la aplicación a un archivo",
|
"aboutBugSaveLogInstruction": "Guardar registros de la aplicación a un archivo",
|
||||||
"aboutBugSaveLogButton": "Guardar",
|
"aboutBugSaveLogButton": "Guardar",
|
||||||
|
|
|
@ -230,13 +230,6 @@
|
||||||
"aboutLinkLicense": "Licence",
|
"aboutLinkLicense": "Licence",
|
||||||
"aboutLinkPolicy": "Politique de confidentialité",
|
"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",
|
"aboutBug": "Rapports d’erreur",
|
||||||
"aboutBugSaveLogInstruction": "Sauvegarder les logs de l’app vers un fichier",
|
"aboutBugSaveLogInstruction": "Sauvegarder les logs de l’app vers un fichier",
|
||||||
"aboutBugSaveLogButton": "Sauvegarder",
|
"aboutBugSaveLogButton": "Sauvegarder",
|
||||||
|
|
|
@ -230,13 +230,6 @@
|
||||||
"aboutLinkLicense": "라이선스",
|
"aboutLinkLicense": "라이선스",
|
||||||
"aboutLinkPolicy": "개인정보 보호정책",
|
"aboutLinkPolicy": "개인정보 보호정책",
|
||||||
|
|
||||||
"aboutUpdate": "업데이트 사용 가능",
|
|
||||||
"aboutUpdateLinks1": "앱의 최신 버전을",
|
|
||||||
"aboutUpdateLinks2": "와",
|
|
||||||
"aboutUpdateLinks3": "에서 다운로드 사용 가능합니다.",
|
|
||||||
"aboutUpdateGitHub": "깃허브",
|
|
||||||
"aboutUpdateGooglePlay": "구글 플레이",
|
|
||||||
|
|
||||||
"aboutBug": "버그 보고",
|
"aboutBug": "버그 보고",
|
||||||
"aboutBugSaveLogInstruction": "앱 로그를 파일에 저장하기",
|
"aboutBugSaveLogInstruction": "앱 로그를 파일에 저장하기",
|
||||||
"aboutBugSaveLogButton": "저장",
|
"aboutBugSaveLogButton": "저장",
|
||||||
|
|
|
@ -230,13 +230,6 @@
|
||||||
"aboutLinkLicense": "Licença",
|
"aboutLinkLicense": "Licença",
|
||||||
"aboutLinkPolicy": "Política de Privacidade",
|
"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",
|
"aboutBug": "Relatório de erro",
|
||||||
"aboutBugSaveLogInstruction": "Salvar registros de aplicativos em um arquivo",
|
"aboutBugSaveLogInstruction": "Salvar registros de aplicativos em um arquivo",
|
||||||
"aboutBugSaveLogButton": "Salve",
|
"aboutBugSaveLogButton": "Salve",
|
||||||
|
|
|
@ -230,13 +230,6 @@
|
||||||
"aboutLinkLicense": "Лицензия",
|
"aboutLinkLicense": "Лицензия",
|
||||||
"aboutLinkPolicy": "Политика конфиденциальности",
|
"aboutLinkPolicy": "Политика конфиденциальности",
|
||||||
|
|
||||||
"aboutUpdate": "Доступна новая версия",
|
|
||||||
"aboutUpdateLinks1": "Новая версия Aves доступна на",
|
|
||||||
"aboutUpdateLinks2": "и",
|
|
||||||
"aboutUpdateLinks3": ".",
|
|
||||||
"aboutUpdateGitHub": "GitHub",
|
|
||||||
"aboutUpdateGooglePlay": "Play Маркет",
|
|
||||||
|
|
||||||
"aboutBug": "Отчет об ошибке",
|
"aboutBug": "Отчет об ошибке",
|
||||||
"aboutBugSaveLogInstruction": "Сохраните логи приложения в файл",
|
"aboutBugSaveLogInstruction": "Сохраните логи приложения в файл",
|
||||||
"aboutBugSaveLogButton": "Сохранить",
|
"aboutBugSaveLogButton": "Сохранить",
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
import 'package:aves/model/device.dart';
|
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:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:github/github.dart';
|
|
||||||
import 'package:google_api_availability/google_api_availability.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 {
|
abstract class AvesAvailability {
|
||||||
void onResume();
|
void onResume();
|
||||||
|
@ -18,12 +13,10 @@ abstract class AvesAvailability {
|
||||||
Future<bool> get canLocatePlaces;
|
Future<bool> get canLocatePlaces;
|
||||||
|
|
||||||
Future<bool> get canUseGoogleMaps;
|
Future<bool> get canUseGoogleMaps;
|
||||||
|
|
||||||
Future<bool> get isNewVersionAvailable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class LiveAvesAvailability implements AvesAvailability {
|
class LiveAvesAvailability implements AvesAvailability {
|
||||||
bool? _isConnected, _hasPlayServices, _isNewVersionAvailable;
|
bool? _isConnected, _hasPlayServices;
|
||||||
|
|
||||||
LiveAvesAvailability() {
|
LiveAvesAvailability() {
|
||||||
Connectivity().onConnectivityChanged.listen(_updateConnectivityFromResult);
|
Connectivity().onConnectivityChanged.listen(_updateConnectivityFromResult);
|
||||||
|
@ -63,30 +56,4 @@ class LiveAvesAvailability implements AvesAvailability {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<bool> get canUseGoogleMaps async => device.canRenderGoogleMaps && await hasPlayServices;
|
Future<bool> get canUseGoogleMaps async => device.canRenderGoogleMaps && await hasPlayServices;
|
||||||
|
|
||||||
@override
|
|
||||||
Future<bool> 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!;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ class Settings extends ChangeNotifier {
|
||||||
catalogTimeZoneKey,
|
catalogTimeZoneKey,
|
||||||
videoShowRawTimedTextKey,
|
videoShowRawTimedTextKey,
|
||||||
searchHistoryKey,
|
searchHistoryKey,
|
||||||
lastVersionCheckDateKey,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// app
|
// app
|
||||||
|
@ -116,9 +115,6 @@ class Settings extends ChangeNotifier {
|
||||||
static const accessibilityAnimationsKey = 'accessibility_animations';
|
static const accessibilityAnimationsKey = 'accessibility_animations';
|
||||||
static const timeToTakeActionKey = 'time_to_take_action';
|
static const timeToTakeActionKey = 'time_to_take_action';
|
||||||
|
|
||||||
// version
|
|
||||||
static const lastVersionCheckDateKey = 'last_version_check_date';
|
|
||||||
|
|
||||||
// file picker
|
// file picker
|
||||||
static const filePickerShowHiddenFilesKey = 'file_picker_show_hidden_files';
|
static const filePickerShowHiddenFilesKey = 'file_picker_show_hidden_files';
|
||||||
|
|
||||||
|
@ -478,12 +474,6 @@ class Settings extends ChangeNotifier {
|
||||||
|
|
||||||
set timeToTakeAction(AccessibilityTimeout newValue) => setAndNotify(timeToTakeActionKey, newValue.toString());
|
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
|
// file picker
|
||||||
|
|
||||||
bool get filePickerShowHiddenFiles => getBoolOrDefault(filePickerShowHiddenFilesKey, SettingsDefaults.filePickerShowHiddenFiles);
|
bool get filePickerShowHiddenFiles => getBoolOrDefault(filePickerShowHiddenFilesKey, SettingsDefaults.filePickerShowHiddenFiles);
|
||||||
|
|
|
@ -20,9 +20,6 @@ class Durations {
|
||||||
static const appBarTitleAnimation = Duration(milliseconds: 300);
|
static const appBarTitleAnimation = Duration(milliseconds: 300);
|
||||||
static const appBarActionChangeAnimation = Duration(milliseconds: 200);
|
static const appBarActionChangeAnimation = Duration(milliseconds: 200);
|
||||||
|
|
||||||
// drawer
|
|
||||||
static const newsBadgeAnimation = Duration(milliseconds: 200);
|
|
||||||
|
|
||||||
// filter grids animations
|
// filter grids animations
|
||||||
static const chipDecorationAnimation = Duration(milliseconds: 200);
|
static const chipDecorationAnimation = Duration(milliseconds: 200);
|
||||||
static const highlightScrollAnimationMinMillis = 400;
|
static const highlightScrollAnimationMinMillis = 400;
|
||||||
|
@ -68,9 +65,6 @@ class Durations {
|
||||||
static const contentChangeDebounceDelay = Duration(milliseconds: 1000);
|
static const contentChangeDebounceDelay = Duration(milliseconds: 1000);
|
||||||
static const mapInfoDebounceDelay = Duration(milliseconds: 150);
|
static const mapInfoDebounceDelay = Duration(milliseconds: 150);
|
||||||
static const mapIdleDebounceDelay = Duration(milliseconds: 100);
|
static const mapIdleDebounceDelay = Duration(milliseconds: 100);
|
||||||
|
|
||||||
// app life
|
|
||||||
static const lastVersionCheckInterval = Duration(days: 7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class DurationsProvider extends StatelessWidget {
|
class DurationsProvider extends StatelessWidget {
|
||||||
|
|
|
@ -296,11 +296,6 @@ class Constants {
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
sourceUrl: 'https://github.com/fluttercommunity/get_it',
|
sourceUrl: 'https://github.com/fluttercommunity/get_it',
|
||||||
),
|
),
|
||||||
Dependency(
|
|
||||||
name: 'GitHub',
|
|
||||||
license: 'MIT',
|
|
||||||
sourceUrl: 'https://github.com/SpinlockLabs/github.dart',
|
|
||||||
),
|
|
||||||
Dependency(
|
Dependency(
|
||||||
name: 'Intl',
|
name: 'Intl',
|
||||||
license: 'BSD 3-Clause',
|
license: 'BSD 3-Clause',
|
||||||
|
@ -331,11 +326,6 @@ class Constants {
|
||||||
license: 'BSD 2-Clause',
|
license: 'BSD 2-Clause',
|
||||||
sourceUrl: 'https://github.com/google/tuple.dart',
|
sourceUrl: 'https://github.com/google/tuple.dart',
|
||||||
),
|
),
|
||||||
Dependency(
|
|
||||||
name: 'Version',
|
|
||||||
license: 'BSD 3-Clause',
|
|
||||||
sourceUrl: 'https://github.com/dartninja/version',
|
|
||||||
),
|
|
||||||
Dependency(
|
Dependency(
|
||||||
name: 'XML',
|
name: 'XML',
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
|
|
|
@ -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/bug_report.dart';
|
||||||
import 'package:aves/widgets/about/credits.dart';
|
import 'package:aves/widgets/about/credits.dart';
|
||||||
import 'package:aves/widgets/about/licenses.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:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -27,7 +26,6 @@ class AboutPage extends StatelessWidget {
|
||||||
const [
|
const [
|
||||||
AppReference(),
|
AppReference(),
|
||||||
Divider(),
|
Divider(),
|
||||||
AboutUpdate(),
|
|
||||||
BugReport(),
|
BugReport(),
|
||||||
Divider(),
|
Divider(),
|
||||||
AboutCredits(),
|
AboutCredits(),
|
||||||
|
|
|
@ -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,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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<AboutUpdate> {
|
|
||||||
late Future<bool> _updateChecker;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_updateChecker = availability.isNewVersionAvailable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return FutureBuilder<bool>(
|
|
||||||
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(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -66,7 +66,6 @@ class DebugSettingsSection extends StatelessWidget {
|
||||||
'pinnedFilters': toMultiline(settings.pinnedFilters),
|
'pinnedFilters': toMultiline(settings.pinnedFilters),
|
||||||
'hiddenFilters': toMultiline(settings.hiddenFilters),
|
'hiddenFilters': toMultiline(settings.hiddenFilters),
|
||||||
'searchHistory': toMultiline(settings.searchHistory),
|
'searchHistory': toMultiline(settings.searchHistory),
|
||||||
'lastVersionCheckDate': '${settings.lastVersionCheckDate}',
|
|
||||||
'locale': '${settings.locale}',
|
'locale': '${settings.locale}',
|
||||||
'systemLocales': '${WidgetsBinding.instance!.window.locales}',
|
'systemLocales': '${WidgetsBinding.instance!.window.locales}',
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,6 @@ import 'package:aves/model/source/album.dart';
|
||||||
import 'package:aves/model/source/collection_source.dart';
|
import 'package:aves/model/source/collection_source.dart';
|
||||||
import 'package:aves/model/source/location.dart';
|
import 'package:aves/model/source/location.dart';
|
||||||
import 'package:aves/model/source/tag.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/durations.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/utils/android_file_utils.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:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class AppDrawer extends StatefulWidget {
|
class AppDrawer extends StatelessWidget {
|
||||||
const AppDrawer({Key? key}) : super(key: key);
|
const AppDrawer({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
|
||||||
_AppDrawerState createState() => _AppDrawerState();
|
|
||||||
|
|
||||||
static List<String> getDefaultAlbums(BuildContext context) {
|
static List<String> getDefaultAlbums(BuildContext context) {
|
||||||
final source = context.read<CollectionSource>();
|
final source = context.read<CollectionSource>();
|
||||||
final specialAlbums = source.rawAlbums.where((album) {
|
final specialAlbums = source.rawAlbums.where((album) {
|
||||||
|
@ -40,26 +36,14 @@ class AppDrawer extends StatefulWidget {
|
||||||
..sort(source.compareAlbumsByName);
|
..sort(source.compareAlbumsByName);
|
||||||
return specialAlbums;
|
return specialAlbums;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class _AppDrawerState extends State<AppDrawer> {
|
|
||||||
late Future<bool> _newVersionLoader;
|
|
||||||
|
|
||||||
CollectionSource get source => context.read<CollectionSource>();
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
_newVersionLoader = availability.isNewVersionAvailable;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final drawerItems = <Widget>[
|
final drawerItems = <Widget>[
|
||||||
_buildHeader(context),
|
_buildHeader(context),
|
||||||
..._buildTypeLinks(),
|
..._buildTypeLinks(),
|
||||||
_buildAlbumLinks(),
|
_buildAlbumLinks(context),
|
||||||
..._buildPageLinks(),
|
..._buildPageLinks(context),
|
||||||
if (!kReleaseMode) ...[
|
if (!kReleaseMode) ...[
|
||||||
const Divider(),
|
const Divider(),
|
||||||
debugTile,
|
debugTile,
|
||||||
|
@ -148,38 +132,7 @@ class _AppDrawerState extends State<AppDrawer> {
|
||||||
key: const Key('drawer-about-button'),
|
key: const Key('drawer-about-button'),
|
||||||
onPressed: () => goTo(AboutPage.routeName, (_) => const AboutPage()),
|
onPressed: () => goTo(AboutPage.routeName, (_) => const AboutPage()),
|
||||||
icon: const Icon(AIcons.info),
|
icon: const Icon(AIcons.info),
|
||||||
label: Row(
|
label: Text(context.l10n.aboutPageTitle),
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(context.l10n.aboutPageTitle),
|
|
||||||
FutureBuilder<bool>(
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
OutlinedButton.icon(
|
OutlinedButton.icon(
|
||||||
// key is expected by test driver
|
// key is expected by test driver
|
||||||
|
@ -212,7 +165,8 @@ class _AppDrawerState extends State<AppDrawer> {
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildAlbumLinks() {
|
Widget _buildAlbumLinks(BuildContext context) {
|
||||||
|
final source = context.read<CollectionSource>();
|
||||||
return StreamBuilder(
|
return StreamBuilder(
|
||||||
stream: source.eventBus.on<AlbumsChangedEvent>(),
|
stream: source.eventBus.on<AlbumsChangedEvent>(),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
@ -227,10 +181,11 @@ class _AppDrawerState extends State<AppDrawer> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _buildPageLinks() {
|
List<Widget> _buildPageLinks(BuildContext context) {
|
||||||
final pageBookmarks = settings.drawerPageBookmarks;
|
final pageBookmarks = settings.drawerPageBookmarks;
|
||||||
if (pageBookmarks.isEmpty) return [];
|
if (pageBookmarks.isEmpty) return [];
|
||||||
|
|
||||||
|
final source = context.read<CollectionSource>();
|
||||||
return [
|
return [
|
||||||
const Divider(),
|
const Divider(),
|
||||||
...pageBookmarks.map((route) {
|
...pageBookmarks.map((route) {
|
||||||
|
|
21
pubspec.lock
21
pubspec.lock
|
@ -441,13 +441,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.2.0"
|
version: "7.2.0"
|
||||||
github:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: github
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "9.0.0"
|
|
||||||
glob:
|
glob:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -532,13 +525,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.3"
|
version: "0.6.3"
|
||||||
json_annotation:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: json_annotation
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "4.4.0"
|
|
||||||
latlong2:
|
latlong2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1183,13 +1169,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.1"
|
version: "2.1.1"
|
||||||
version:
|
|
||||||
dependency: "direct main"
|
|
||||||
description:
|
|
||||||
name: version
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.0"
|
|
||||||
vm_service:
|
vm_service:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -41,7 +41,6 @@ dependencies:
|
||||||
flutter_markdown:
|
flutter_markdown:
|
||||||
flutter_staggered_animations:
|
flutter_staggered_animations:
|
||||||
get_it:
|
get_it:
|
||||||
github:
|
|
||||||
google_api_availability:
|
google_api_availability:
|
||||||
google_maps_flutter:
|
google_maps_flutter:
|
||||||
intl:
|
intl:
|
||||||
|
@ -66,7 +65,6 @@ dependencies:
|
||||||
transparent_image:
|
transparent_image:
|
||||||
tuple:
|
tuple:
|
||||||
url_launcher:
|
url_launcher:
|
||||||
version:
|
|
||||||
xml:
|
xml:
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
Loading…
Reference in a new issue