Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
sadespresso committed Apr 29, 2024
2 parents 86c67ff + a1f15ba commit b6d6afe
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## Next

* Fixed transaction page date selector's time was always set to **zero** (12AM)
* Now uses [pie_menu](https://pub.dev/packages/pie_menu) from pub.dev since
fork's additional features have are in the new release
* Uses serializer from [`moment_dart`](https://github.com/sadespresso/moment_dart)
* Saves automated backups in app data, fixes [#131](https://github.com/flow-mn/flow/issues/131) for now
* Minor improvements

## Beta 0.5.0

Expand Down
1 change: 1 addition & 0 deletions assets/l10n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"preferences.numpad.haptics.description": "Sound/haptic feedback upon click",
"preferences.transactionButtonOrder": "Button placement",
"preferences.transactionButtonOrder.description": "Change new transaction button placement",
"preferences.transactionButtonOrder.guide": "Drag the buttons to reorder",
"preferences.transfer": "Transfers",
"preferences.transfer.description": "Combine into one, exclude from expense/income",
"preferences.transfer.combineTransferTransaction": "Layout",
Expand Down
1 change: 1 addition & 0 deletions assets/l10n/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"preferences.numpad.haptics.description": "Feedback sonoro/tattile alla pressione",
"preferences.transactionButtonOrder": "Posizione pulsanti",
"preferences.transactionButtonOrder.description": "Modifica la posizione del pulsante per le nuove transazioni",
"preferences.transactionButtonOrder.guide": "Trascina i pulsanti per riordinare",
"preferences.transfer": "Trasferimenti",
"preferences.transfer.description": "Combina in uno, escludi da spese/entrate",
"preferences.transfer.combineTransferTransaction": "Layout",
Expand Down
1 change: 1 addition & 0 deletions assets/l10n/mn_MN.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"preferences.numpad.haptics.description": "Дарах үед дуу/чичиргээ тоглуулна",
"preferences.transactionButtonOrder": "Товчны байрлал",
"preferences.transactionButtonOrder.description": "Шинэ гүйлгээ хийх товчны байрлал өөрчлөх",
"preferences.transactionButtonOrder.guide": "Чирж байрлалыг өөрчлөөрэй",
"preferences.transfer": "Шижлүүлэг",
"preferences.transfer.description": "Нэгтгэж харах, орлого/зарлагаас хасах",
"preferences.transfer.combineTransferTransaction": "Харагдах байдал",
Expand Down
8 changes: 8 additions & 0 deletions lib/routes/preferences/button_order_preferences_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flow/entity/transaction.dart';
import 'package:flow/l10n/extensions.dart';
import 'package:flow/prefs.dart';
import 'package:flow/routes/preferences/button_order_preferences/transaction_type_button.dart';
import 'package:flow/widgets/general/info_text.dart';
import 'package:flutter/material.dart';

class ButtonOrderPreferencesPage extends StatefulWidget {
Expand Down Expand Up @@ -34,9 +35,16 @@ class ButtonOrderPreferencesPageState
),
body: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 16.0),
InfoText(
child: Text(
"preferences.transactionButtonOrder.guide".t(context),
),
),
const SizedBox(height: 16.0),
Row(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/preferences_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class _PreferencesPageState extends State<PreferencesPage> {
leading: const Icon(Symbols.action_key_rounded),
onTap: openTransactionButtonOrderPrefs,
subtitle: Text(
"preferences.transfer.description".t(context),
"preferences.transactionButtonOrder.description".t(context),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Expand Down
4 changes: 3 additions & 1 deletion lib/routes/transaction_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ class _TransactionPageState extends State<TransactionPage> {
}

void selectTransactionDate() async {
final TimeOfDay currentTimeOfDay = TimeOfDay.fromDateTime(_transactionDate);

final DateTime? result = await showDatePicker(
context: context,
firstDate: DateTime.fromMicrosecondsSinceEpoch(0),
Expand All @@ -503,7 +505,7 @@ class _TransactionPageState extends State<TransactionPage> {

final TimeOfDay? timeResult = await showTimePicker(
context: context,
initialTime: TimeOfDay.fromDateTime(_transactionDate),
initialTime: currentTimeOfDay,
);

if (timeResult == null) return;
Expand Down
14 changes: 11 additions & 3 deletions lib/sync/export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Future<ExportStatus> export({
isShareSupported,
fileExt: mode.fileExt,
subfolder: subfolder,
type: type,
);

// Try to add backup record
Expand Down Expand Up @@ -69,13 +70,20 @@ Future<String> saveBackupFile(
String backupContent,
bool isShareSupported, {
required String fileExt,
required BackupEntryType type,
String? subfolder,
}) async {
// Save to cache if it's possible to share later.
// Otherwise, save to documents directory, and reveal the file on system.
final Directory saveDir = isShareSupported
? await getApplicationCacheDirectory()
: await getApplicationDocumentsDirectory();

final Directory saveDir = switch (type) {
BackupEntryType.automated ||
BackupEntryType.preAccountDeletion ||
BackupEntryType.preImport =>
Directory(ObjectBox.appDataDirectory),
_ when isShareSupported => await getApplicationCacheDirectory(),
_ => await getApplicationDocumentsDirectory()
};

final String dateTime = Moment.now().lll.replaceAll(RegExp("\\s"), "_");
final String randomValue = math.Random().nextInt(536870912).toRadixString(36);
Expand Down
2 changes: 1 addition & 1 deletion lib/theme/pie_menu_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PieTheme pieThemeLight = PieTheme(
pointerSize: 2.0,
tooltipTextStyle: lightTheme.textTheme.displaySmall,
rightClickShowsMenu: true,
alwaysPlaceActionFromCenter: true,
menuAlignment: Alignment.center,
);
PieTheme pieThemeDark = pieThemeLight.copyWith(
buttonTheme: PieButtonTheme(
Expand Down
11 changes: 5 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -920,12 +920,11 @@ packages:
pie_menu:
dependency: "direct main"
description:
path: "."
ref: HEAD
resolved-ref: "4d5478f06e39568e0b1c2ad4293865d8eb567515"
url: "https://github.com/sadespresso/flutter-pie-menu.git"
source: git
version: "3.1.3"
name: pie_menu
sha256: ec570849e84318698bf76ca7ddb6b1661740ad8da33f730be14ff27e9d73cbac
url: "https://pub.dev"
source: hosted
version: "3.2.0"
platform:
dependency: transitive
description:
Expand Down
7 changes: 2 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A personal finance managing app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: "0.5.1+44"
version: "0.5.2+45"

environment:
sdk: ">=3.1.3 <4.0.0"
Expand Down Expand Up @@ -42,10 +42,7 @@ dependencies:
package_info_plus: ^7.0.0
path: ^1.8.3
path_provider: ^2.1.1
# pie_menu: ^3.1.3
pie_menu:
git:
url: https://github.com/sadespresso/flutter-pie-menu.git
pie_menu: ^3.2.0
salomon_bottom_bar: ^3.3.2
share_plus: ^8.0.2
shared_preferences: ^2.2.2
Expand Down

0 comments on commit b6d6afe

Please sign in to comment.