Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flutter_release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

env:
FLUTTER_VERSION: "3.27.1"
FLUTTER_VERSION: "3.38.7"
LINUX_DEPENDENCIES: git unzip zip xz-utils curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libjsoncpp25 libsecret-1-dev libsecret-1-0 librhash0 libsqlite3-dev libappindicator3-dev gettext

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.27.x"
flutter-version: "3.38.x"
- name: Disable Google Analytics
run: flutter config --no-analytics
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Enter the following command in the terminal to build the project:
- **Android APK**

```
flutter build apk --flavor main
flutter build apk --flavor base
```
or

```
flutter build apk --flavor main --target-platform [android-arm|android-arm64|android-x64]
flutter build apk --flavor base --target-platform [android-arm|android-arm64|android-x64]
```

The built APK will be located in the `build/app/outputs/flutter-apk/` directory.
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ android {

splits {
abi {
def isBuildingBundle = gradle.startParameter.taskNames.any { it.lowercase().contains("bundle") }
def isBuildingBundle = gradle.startParameter.taskNames.any { it.toLowerCase().contains("bundle") }
enable !isBuildingBundle
reset()
include "armeabi-v7a", "arm64-v8a", "x86_64"
Expand Down
1 change: 0 additions & 1 deletion lib/core/notification_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import 'package:libretrack/ui/model/utils.dart';
import 'package:libretrack/ui/theme.dart';
import 'package:quiver/core.dart';

import '../l10n/app_localizations.dart';
import '../locale.dart';
import 'crash_report/crash_report_manager.dart';
import 'entity/entity.dart';
Expand Down
4 changes: 1 addition & 3 deletions lib/core/work_manager/work_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class _MobileWorkManager implements _PlatformWorkManager {
final PlatformInfo _platform;
final _IOSWorkManager _iosWm;
final WorkersProvider _workersProvider;
final bool _isDebug;
final wm.Workmanager _wm;

_MobileWorkManager(
Expand All @@ -254,15 +253,14 @@ class _MobileWorkManager implements _PlatformWorkManager {
dateTimeProvider: dateTimeProvider,
),
),
_isDebug = isDebug,
_wm = wm.Workmanager();

static ConstraintsManager _getConstraintsManager(PlatformInfo platform) =>
ConstraintsManagerImpl(platform);

@override
Future<void> init() async {
await _wm.initialize(callbackDispatcher, isInDebugMode: _isDebug);
await _wm.initialize(callbackDispatcher); // TODO: `flutter_workmanager` v0.9.0 says "Replace with hook-based debug system using WorkmanagerDebug.setCurrent()"
if (_platform.isIOS) {
_iosWm.init();
}
Expand Down
14 changes: 7 additions & 7 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;

import 'app_localizations_cmn.dart';
import 'app_localizations_en.dart';
import 'app_localizations_es.dart';
import 'app_localizations_fr.dart';
import 'app_localizations_it.dart';
import 'app_localizations_ru.dart';
import 'app_localizations_sk.dart';
import 'app_localizations_zh.dart';

// ignore_for_file: type=lint

Expand Down Expand Up @@ -99,13 +99,13 @@ abstract class AppLocalizations {

/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Locale('cmn'),
Locale('en'),
Locale('es'),
Locale('fr'),
Locale('it'),
Locale('ru'),
Locale('sk')
Locale('sk'),
Locale('zh')
];

/// No description provided for @projectIssuesPage.
Expand Down Expand Up @@ -1656,13 +1656,13 @@ class _AppLocalizationsDelegate

@override
bool isSupported(Locale locale) => <String>[
'cmn',
'en',
'es',
'fr',
'it',
'ru',
'sk'
'sk',
'zh'
].contains(locale.languageCode);

@override
Expand All @@ -1672,8 +1672,6 @@ class _AppLocalizationsDelegate
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'cmn':
return AppLocalizationsCmn();
case 'en':
return AppLocalizationsEn();
case 'es':
Expand All @@ -1686,6 +1684,8 @@ AppLocalizations lookupAppLocalizations(Locale locale) {
return AppLocalizationsRu();
case 'sk':
return AppLocalizationsSk();
case 'zh':
return AppLocalizationsZh();
}

throw FlutterError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import 'app_localizations.dart';

// ignore_for_file: type=lint

/// The translations for Mandarin Chinese (`cmn`).
class AppLocalizationsCmn extends AppLocalizations {
AppLocalizationsCmn([String locale = 'cmn']) : super(locale);
/// The translations for Chinese (`zh`).
class AppLocalizationsZh extends AppLocalizations {
AppLocalizationsZh([String locale = 'zh']) : super(locale);

@override
String get projectIssuesPage =>
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_cmn.arb → lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@locale": "cmn",
"@@locale": "zh",
"projectIssuesPage": "https://github.com/proninyaroslav/libretrack/issues",
"appChangelogUrl": "https://github.com/proninyaroslav/libretrack/blob/HEAD/NEWS.md",
"appDescription": "注重隐私,跨平台的包裹跟踪应用.\n更多信息以及为项目提供帮助: https://github.com/proninyaroslav/libretrack",
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/components/page_indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PageIndicator extends StatelessWidget {
dotWidth: 6.0,
dotHeight: 6.0,
dotColor: theme.disabledColor,
activeDotColor: theme.indicatorColor,
activeDotColor: theme.colorScheme.primary,
),
),
);
Expand Down
26 changes: 8 additions & 18 deletions lib/ui/parcel_details/parcel_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ class _BodyState extends State<_Body> {
loadingFailed: (trackNumber, error) {
error?.when(
database: (e, stackTrace) {
log().e('Unable to load parcel details',
error: e, stackTrace: stackTrace);
log().e('Unable to load parcel details', error: e, stackTrace: stackTrace);
},
);
},
Expand Down Expand Up @@ -217,8 +216,7 @@ class _BodyState extends State<_Body> {
deleteFailed: (error) {
error.when(
database: (e, stackTrace) {
log()
.e("Unable to delete parcel", error: e, stackTrace: stackTrace);
log().e("Unable to delete parcel", error: e, stackTrace: stackTrace);
AdaptiveScaffold.of(context).showAdaptiveToast(
text: S.of(context).deleteParcelsFailed(1),
);
Expand All @@ -228,8 +226,7 @@ class _BodyState extends State<_Body> {
markAsReadFailed: (error) {
error.when(
database: (e, stackTrace) {
log().e("Unable to mark parcel as read",
error: e, stackTrace: stackTrace);
log().e("Unable to mark parcel as read", error: e, stackTrace: stackTrace);
AdaptiveScaffold.of(context).showAdaptiveToast(
text: S.of(context).markAsReadParcelFailed(1),
);
Expand All @@ -251,8 +248,7 @@ class _BodyState extends State<_Body> {
refreshFailed: (error) {
error.when(
database: (e, stackTrace) {
log().e("Unable to refresh parcel",
error: e, stackTrace: stackTrace);
log().e("Unable to refresh parcel", error: e, stackTrace: stackTrace);
AdaptiveScaffold.of(context).showAdaptiveToast(
text: S.of(context).refreshParcelsFailed(1),
);
Expand All @@ -261,7 +257,7 @@ class _BodyState extends State<_Body> {
},
shareStringSuccess: (text) async {
try {
await Share.share(text);
await SharePlus.instance.share(ShareParams(text: text));
} on Exception catch (e, stackTrace) {
log().e("Unable to share", error: e, stackTrace: stackTrace);
if (context.mounted) {
Expand All @@ -284,8 +280,7 @@ class _BodyState extends State<_Body> {
activateFailed: (error) {
error.when(
database: (e, stackTrace) {
log().e("Unable to activate tracking",
error: e, stackTrace: stackTrace);
log().e("Unable to activate tracking", error: e, stackTrace: stackTrace);
AdaptiveScaffold.of(context).showAdaptiveToast(
text: S.of(context).activateTrackingFailed,
);
Expand Down Expand Up @@ -408,9 +403,7 @@ class _AppBarTitle extends StatelessWidget {
notFound: (trackNumber) => Text(trackNumber),
loadingFailed: (trackNumber, e) => Text(trackNumber),
loaded: (trackNumber, info) => Text(
info.trackInfo.description?.isEmpty ?? true
? trackNumber
: info.trackInfo.description!,
info.trackInfo.description?.isEmpty ?? true ? trackNumber : info.trackInfo.description!,
),
);
},
Expand Down Expand Up @@ -442,10 +435,7 @@ class _ParcelNotFound extends StatelessWidget {
const SizedBox(height: 20.0),
Text(
S.of(context).parcelNotFound,
style: Theme.of(context)
.textTheme
.headlineSmall!
.copyWith(color: Colors.blueGrey),
style: Theme.of(context).textTheme.headlineSmall!.copyWith(color: Colors.blueGrey),
),
const SizedBox(height: 24.0),
FloatingActionButton.extended(
Expand Down
Loading
Loading