1.0.0 release #31

Merged
hernik merged 31 commits from dev into main 2024-02-10 16:27:33 +01:00
69 changed files with 1887 additions and 853 deletions

@ -1 +1 @@
Subproject commit c1df7d07ac60336309bae9dd2d48e7cb8844ec98 Subproject commit b7e7d46a046ba8a22897a514bf2311a0f81ab198

View file

@ -27,6 +27,13 @@ the three dots > 'About' or in app info in your device's setting
### What actually happened ### What actually happened
<!-- Here describe what ACTUALLY happened --> <!-- Here describe what ACTUALLY happened -->
### Relevant logs
```
Paste your logs here
Make sure it is a codebloc
```
### Steps to reproduce ### Steps to reproduce
<!-- <!--
Enter the exact steps that you made when you encountered the bug, Enter the exact steps that you made when you encountered the bug,

View file

@ -1,4 +1,24 @@
# 1.0.0
- Change icon
- Placeholder text is now inserted into the field in setup, instead of showing as label
- Show version text in about dialog
- Added tessdata license text into about dialog
- Added sorting by oldest
- Moved search into three-dot menu
- Make search case-insensitive
- Added titles above graphs
- Some extra optimization for iOS
- Fix starting balance not saving
- Fix overlay disabling tappig on edit/delete buttons on home view
- Allow changing dates on entries
- Graph view now uses tabs
- Graphs now display correct tooltips when displaying only income or only expenses
- Change graph container style when using light mode
- Make pie chart values more visible by adding the category's corresponding color as background
- Welcome text on Setup view is now centered
- Editing entries is now done by tapping the entry, instead of a dedicated button
# 1.0.0-alpha+5 # 1.0.0-alpha+5
- Add tests - Add tests
- Add searching through entries to homepage - Add searching through entries to homepage

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 7 KiB

View file

@ -1,3 +1,15 @@
buildscript {
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects { allprojects {
repositories { repositories {
google() google()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>11.0</string> <string>12.0</string>
</dict> </dict>
</plist> </plist>

View file

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

View file

@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig" #include "Generated.xcconfig"

44
ios/Podfile Normal file
View file

@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

77
ios/Podfile.lock Normal file
View file

@ -0,0 +1,77 @@
PODS:
- Flutter (1.0.0)
- flutter_file_dialog (0.0.1):
- Flutter
- flutter_keyboard_visibility (0.0.1):
- Flutter
- flutter_tesseract_ocr (0.3.4):
- Flutter
- SwiftyTesseract
- fluttertoast (0.0.2):
- Flutter
- Toast
- integration_test (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- SwiftyTesseract (3.1.3)
- Toast (4.1.0)
- url_launcher_ios (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_file_dialog (from `.symlinks/plugins/flutter_file_dialog/ios`)
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
- flutter_tesseract_ocr (from `.symlinks/plugins/flutter_tesseract_ocr/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
SPEC REPOS:
trunk:
- SwiftyTesseract
- Toast
EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_file_dialog:
:path: ".symlinks/plugins/flutter_file_dialog/ios"
flutter_keyboard_visibility:
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
flutter_tesseract_ocr:
:path: ".symlinks/plugins/flutter_tesseract_ocr/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
integration_test:
:path: ".symlinks/plugins/integration_test/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_file_dialog: 4c014a45b105709a27391e266c277d7e588e9299
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
flutter_tesseract_ocr: c01971df9e5817a08563298b8ce571fa10e164f1
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
integration_test: 13825b8a9334a850581300559b8839134b124670
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
SwiftyTesseract: 1f3d96668ae92dc2208d9842c8a59bea9fad2cbb
Toast: ec33c32b8688982cecc6348adeae667c1b9938da
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
COCOAPODS: 1.13.0

View file

@ -8,12 +8,14 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
27C13A219C72D10CF1B85F6B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 994C9DA5FEE9CD99D93E4648 /* Pods_Runner.framework */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
4A5BC0C55FF0637EADEA4623 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E794546B4010524D367E1DF /* Pods_RunnerTests.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -40,11 +42,18 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
0E9CD450BDF6FBBDD2648144 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
13828E8DFD40CA39D8C8CB47 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
17ABB7090CB6BE30852FCD6C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
5E794546B4010524D367E1DF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
77C260DE7FCBF4A81053C399 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@ -53,21 +62,48 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; }; 994C9DA5FEE9CD99D93E4648 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; B68E4862A35101CA30515D78 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
E5D806F9D018078A8C462DC6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
718F82C14172C3E11888290F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4A5BC0C55FF0637EADEA4623 /* Pods_RunnerTests.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
97C146EB1CF9000F007C117D /* Frameworks */ = { 97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
27C13A219C72D10CF1B85F6B /* Pods_Runner.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
331C807B294A618700263BE5 /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "<group>";
};
4BAAA9A11BE10483369792BF /* Frameworks */ = {
isa = PBXGroup;
children = (
994C9DA5FEE9CD99D93E4648 /* Pods_Runner.framework */,
5E794546B4010524D367E1DF /* Pods_RunnerTests.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
9740EEB11CF90186004384FC /* Flutter */ = { 9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -79,14 +115,6 @@
name = Flutter; name = Flutter;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
331C8082294A63A400263BE5 /* RunnerTests */ = {
isa = PBXGroup;
children = (
331C807B294A618700263BE5 /* RunnerTests.swift */,
);
path = RunnerTests;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = { 97C146E51CF9000F007C117D = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -94,6 +122,8 @@
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
331C8082294A63A400263BE5 /* RunnerTests */, 331C8082294A63A400263BE5 /* RunnerTests */,
B47522B456F585175CCE9181 /* Pods */,
4BAAA9A11BE10483369792BF /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -121,6 +151,19 @@
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B47522B456F585175CCE9181 /* Pods */ = {
isa = PBXGroup;
children = (
17ABB7090CB6BE30852FCD6C /* Pods-Runner.debug.xcconfig */,
77C260DE7FCBF4A81053C399 /* Pods-Runner.release.xcconfig */,
E5D806F9D018078A8C462DC6 /* Pods-Runner.profile.xcconfig */,
0E9CD450BDF6FBBDD2648144 /* Pods-RunnerTests.debug.xcconfig */,
B68E4862A35101CA30515D78 /* Pods-RunnerTests.release.xcconfig */,
13828E8DFD40CA39D8C8CB47 /* Pods-RunnerTests.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -128,9 +171,10 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
buildPhases = ( buildPhases = (
C2D4A53BE26B74B847987117 /* [CP] Check Pods Manifest.lock */,
331C807D294A63A400263BE5 /* Sources */, 331C807D294A63A400263BE5 /* Sources */,
331C807E294A63A400263BE5 /* Frameworks */,
331C807F294A63A400263BE5 /* Resources */, 331C807F294A63A400263BE5 /* Resources */,
718F82C14172C3E11888290F /* Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -146,12 +190,14 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
FE41F3D3363ED41B1220D8E1 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
E32B5E26E58AE86205FDFCFA /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
@ -169,7 +215,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
331C8080294A63A400263BE5 = { 331C8080294A63A400263BE5 = {
@ -254,6 +300,67 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
}; };
C2D4A53BE26B74B847987117 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E32B5E26E58AE86205FDFCFA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FE41F3D3363ED41B1220D8E1 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
@ -345,7 +452,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -358,15 +465,19 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ARCHS = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Prasule;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = cafe.caras.prasule; PRODUCT_BUNDLE_IDENTIFIER = cafe.caras.prasule;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -377,7 +488,7 @@
}; };
331C8088294A63A400263BE5 /* Debug */ = { 331C8088294A63A400263BE5 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */; baseConfigurationReference = 0E9CD450BDF6FBBDD2648144 /* Pods-RunnerTests.debug.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -395,7 +506,7 @@
}; };
331C8089294A63A400263BE5 /* Release */ = { 331C8089294A63A400263BE5 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */; baseConfigurationReference = B68E4862A35101CA30515D78 /* Pods-RunnerTests.release.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -411,7 +522,7 @@
}; };
331C808A294A63A400263BE5 /* Profile */ = { 331C808A294A63A400263BE5 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */; baseConfigurationReference = 13828E8DFD40CA39D8C8CB47 /* Pods-RunnerTests.profile.xcconfig */;
buildSettings = { buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)"; BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -472,7 +583,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -521,7 +632,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0; IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -536,11 +647,14 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ARCHS = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Prasule;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -558,15 +672,19 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ARCHS = x86_64;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Prasule;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = cafe.caras.prasule; PRODUCT_BUNDLE_IDENTIFIER = cafe.caras.prasule;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1430" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

View file

@ -4,4 +4,7 @@
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "group:Runner.xcodeproj">
</FileRef> </FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace> </Workspace>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 B

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
@ -24,6 +26,12 @@
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSCameraUsageDescription</key>
<string>Used for data import from pictures</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used for data import from pictures</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
@ -41,13 +49,16 @@
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>UTExportedTypeDeclarations</key>
<true/> <array>
<key>UIApplicationSupportsIndirectInputEvents</key> <dict>
<true/> <key>UTTypeDescription</key>
<key>NSPhotoLibraryUsageDescription</key> <string></string>
<string>Used for data import from pictures</string> <key>UTTypeIconFiles</key>
<key>NSCameraUsageDescription</key> <array/>
<string>Used for data import from pictures</string> <key>UTTypeTagSpecification</key>
<dict/>
</dict>
</array>
</dict> </dict>
</plist> </plist>

View file

@ -14,7 +14,7 @@ class WalletCategory {
required this.color, required this.color,
}); });
/// Connects generated fromJson method /// Connects the generated fromJson method
factory WalletCategory.fromJson(Map<String, dynamic> json) => factory WalletCategory.fromJson(Map<String, dynamic> json) =>
_$WalletCategoryFromJson(json); _$WalletCategoryFromJson(json);
@ -32,7 +32,7 @@ class WalletCategory {
@JsonKey(fromJson: _colorFromJson, toJson: _colorToJson) @JsonKey(fromJson: _colorFromJson, toJson: _colorToJson)
Color color; Color color;
/// Connects generated toJson method /// Connects the generated toJson method
Map<String, dynamic> toJson() => _$WalletCategoryToJson(this); Map<String, dynamic> toJson() => _$WalletCategoryToJson(this);
@override @override

View file

@ -7,7 +7,7 @@ class EntryData {
/// Contains raw data /// Contains raw data
EntryData({required this.name, required this.amount, this.description = ""}); EntryData({required this.name, required this.amount, this.description = ""});
/// Connects generated fromJson method /// Connects the generated fromJson method
factory EntryData.fromJson(Map<String, dynamic> json) => factory EntryData.fromJson(Map<String, dynamic> json) =>
_$EntryDataFromJson(json); _$EntryDataFromJson(json);
@ -20,6 +20,6 @@ class EntryData {
/// Amount for entry /// Amount for entry
double amount; double amount;
/// Connects generated toJson method /// Connects the generated toJson method
Map<String, dynamic> toJson() => _$EntryDataToJson(this); Map<String, dynamic> toJson() => _$EntryDataToJson(this);
} }

View file

@ -20,11 +20,11 @@ class RecurringWalletEntry extends WalletSingleEntry {
this.repeatAfter = 1, this.repeatAfter = 1,
}); });
/// Connects generated fromJson method /// Connects the generated fromJson method
factory RecurringWalletEntry.fromJson(Map<String, dynamic> json) => factory RecurringWalletEntry.fromJson(Map<String, dynamic> json) =>
_$RecurringWalletEntryFromJson(json); _$RecurringWalletEntryFromJson(json);
/// Connects generated toJson method /// Connects the generated toJson method
@override @override
Map<String, dynamic> toJson() => _$RecurringWalletEntryToJson(this); Map<String, dynamic> toJson() => _$RecurringWalletEntryToJson(this);

View file

@ -30,7 +30,7 @@ class Wallet {
this.starterBalance = 0, this.starterBalance = 0,
}); });
/// Connects generated fromJson method /// Connects the generated fromJson method
factory Wallet.fromJson(Map<String, dynamic> json) => _$WalletFromJson(json); factory Wallet.fromJson(Map<String, dynamic> json) => _$WalletFromJson(json);
/// A list of all [RecurringWalletEntry]s /// A list of all [RecurringWalletEntry]s
@ -54,7 +54,7 @@ class Wallet {
@JsonKey(fromJson: _currencyFromJson) @JsonKey(fromJson: _currencyFromJson)
final Currency currency; final Currency currency;
/// Connects generated toJson method /// Connects the generated toJson method
Map<String, dynamic> toJson() => _$WalletToJson(this); Map<String, dynamic> toJson() => _$WalletToJson(this);
/// Getter for the next unused unique number ID in the wallet's **entry** list /// Getter for the next unused unique number ID in the wallet's **entry** list
@ -163,7 +163,7 @@ class Wallet {
/// Returns the current balance /// Returns the current balance
/// ///
/// Basically just takes *starterBalance* and adds all the entries to it /// Basically just takes *starterBalance* and adds all the entries to it
double calculateCurrentBalance() { double get currentBalance {
var toAdd = 0.0; var toAdd = 0.0;
for (final e in entries) { for (final e in entries) {
toAdd += (e.type == EntryType.income) ? e.data.amount : -e.data.amount; toAdd += (e.type == EntryType.income) ? e.data.amount : -e.data.amount;

View file

@ -17,7 +17,7 @@ class WalletSingleEntry {
required this.id, required this.id,
}); });
/// Connects generated fromJson method /// Connects the generated fromJson method
factory WalletSingleEntry.fromJson(Map<String, dynamic> json) => factory WalletSingleEntry.fromJson(Map<String, dynamic> json) =>
_$WalletSingleEntryFromJson(json); _$WalletSingleEntryFromJson(json);
@ -36,6 +36,6 @@ class WalletSingleEntry {
/// Unique entry ID /// Unique entry ID
int id; int id;
/// Connects generated toJson method /// Connects the generated toJson method
Map<String, dynamic> toJson() => _$WalletSingleEntryToJson(this); Map<String, dynamic> toJson() => _$WalletSingleEntryToJson(this);
} }

View file

@ -93,7 +93,7 @@ class WalletManager {
if (!await FlutterFileDialog.isPickDirectorySupported()) { if (!await FlutterFileDialog.isPickDirectorySupported()) {
File("${(await getApplicationDocumentsDirectory()).path}/wallets/$n") File("${(await getApplicationDocumentsDirectory()).path}/wallets/$n")
.copySync( .copySync(
"${await getApplicationDocumentsDirectory()}/export_${n.replaceAll(RegExp('[|\\?*<":>+\[\]/\' ]+'), '_')}_${DateFormat("dd_MM_yyyy").format(DateTime.now())}.json", "${await getApplicationDocumentsDirectory()}/export_${n.replaceAll(RegExp('[|\\?*<":>+[]/\' ]+'), '_')}_${DateFormat("dd_MM_yyyy").format(DateTime.now())}.json",
); );
return; return;
} }
@ -105,7 +105,7 @@ class WalletManager {
File("${(await getApplicationDocumentsDirectory()).path}/wallets/$n") File("${(await getApplicationDocumentsDirectory()).path}/wallets/$n")
.readAsBytesSync(), .readAsBytesSync(),
fileName: fileName:
"export_${n.replaceAll(RegExp('[|\\?*<":>+\[\]/\' ]+'), '_')}_${DateFormat("dd_MM_yyyy").format(DateTime.now())}.json", "export_${n.replaceAll(RegExp('[|\\?*<":>+[]/\' ]+'), '_')}_${DateFormat("dd_MM_yyyy").format(DateTime.now())}.json",
mimeType: "application/json", mimeType: "application/json",
); );
} }

View file

@ -7,7 +7,7 @@
"next": "Další", "next": "Další",
"back": "Zpět", "back": "Zpět",
"finish": "Dokončit", "finish": "Dokončit",
"errorEmptyName": "Název nemůže být prázdný!", "errorEmptyName": "Název peněženky nemůže být prázdný!",
"welcome": "Vítejte!", "welcome": "Vítejte!",
"welcomeAboutPrasule": "Prašule je správce výdajů navržený pro lidi, kteří nechtějí vyplňovat každý malý detail.", "welcomeAboutPrasule": "Prašule je správce výdajů navržený pro lidi, kteří nechtějí vyplňovat každý malý detail.",
"welcomeInstruction": "Na této obrazovce si nastavíte svoji 'peněženku', ve které budou zaznamenány vaše výdaje uspořádané do kategorií, které si nastavíte hned potom.", "welcomeInstruction": "Na této obrazovce si nastavíte svoji 'peněženku', ve které budou zaznamenány vaše výdaje uspořádané do kategorií, které si nastavíte hned potom.",
@ -53,7 +53,7 @@
"langDownloadDialog": "Stahuji {lang}, vyčkejte prosím...", "langDownloadDialog": "Stahuji {lang}, vyčkejte prosím...",
"langDownloadProgress": "Postup: {progress} %", "langDownloadProgress": "Postup: {progress} %",
"addingFromOcr": "Přidat skrz OCR", "addingFromOcr": "Přidat skrz OCR",
"license":"©️ 2023 Matyáš Caras\nVydáno pod licencí GNU AGPL license verze 3", "license":"©️ 2023 Matyáš Caras\nVydáno pod licencí GNU AGPL license verze 3\nObsahuje tessdata_fast OCR data pro angličtinu ©️ tessdata_fast / Tesseract přispěvatelé, použito pod licencí Apache 2.0",
"description":"Popis", "description":"Popis",
"newWallet":"Přidat novou peněženku", "newWallet":"Přidat novou peněženku",
"walletExists":"Peněženka s tímto názvem již existuje!", "walletExists":"Peněženka s tímto názvem již existuje!",
@ -104,5 +104,23 @@
"selectExportWallet":"Zvolte peněženku k exportování", "selectExportWallet":"Zvolte peněženku k exportování",
"exportError":"Při exportování peněženky nastala chyba", "exportError":"Při exportování peněženky nastala chyba",
"exportCompleted":"Export dokončen", "exportCompleted":"Export dokončen",
"importCompleted":"Import dokončen" "importCompleted":"Import dokončen",
"setup":"Prvotní nastavení",
"sourceCode":"Zdrojový kód",
"sortNewest":"Nejnovější první",
"sortOldest":"Nejstarší první",
"sort":"Seřadit",
"search":"Prohledat",
"expensesPerYear":"Výdaje za měsíc v roce {year}",
"expensesPerMonth":"Výdaje za den během měsíce {monthYear}",
"date":"Datum",
"incomePlural":"Příjmy",
"incomePerYear":"Příjmy za měsíc v roce {year}",
"incomePerMonth":"Příjmy za den během měsíce {monthYear}",
"expensesPerMonthCategory":"Výdaje podle kategorie během měsíce {monthYear}",
"expensesPerYearCategory":"Výdaje podle kategorie za rok {year}",
"incomePerYearCategory":"Příjmy podle kategorie za rok {year}",
"incomePerMonthCategory":"Příjmy podle kategorie za měsíc {monthYear}",
"selectYear":"Zvolte rok",
"selectMonth":"Zvolte měsíc a rok"
} }

View file

@ -7,7 +7,7 @@
"next": "Next", "next": "Next",
"back": "Back", "back": "Back",
"finish": "Finish", "finish": "Finish",
"errorEmptyName": "Name cannot be empty", "errorEmptyName": "Wallet name cannot be empty",
"welcome": "Welcome!", "welcome": "Welcome!",
"welcomeAboutPrasule": "Prašule is an expense tracker tool designed for people, who don't want to spend too much time filling in all the little details.", "welcomeAboutPrasule": "Prašule is an expense tracker tool designed for people, who don't want to spend too much time filling in all the little details.",
"welcomeInstruction": "On this screen you will set up your 'wallet', in which you will track your expenses categorized under categories, which you can later set in the settings menu.", "welcomeInstruction": "On this screen you will set up your 'wallet', in which you will track your expenses categorized under categories, which you can later set in the settings menu.",
@ -89,7 +89,7 @@
} }
}, },
"addingFromOcr": "Add from OCR", "addingFromOcr": "Add from OCR",
"license": "©️ 2023 Matyáš Caras\nReleased under the GNU AGPL license version 3", "license": "©️ 2023 Matyáš Caras\nReleased under the GNU AGPL license version 3\nIncludes the tessdata_fast English trained data, ©️ tessdata_fast / Tesseract contributors, used under the Apache 2.0 license",
"description": "Description", "description": "Description",
"newWallet": "Add new wallet", "newWallet": "Add new wallet",
"walletExists": "A wallet with this name already exists!", "walletExists": "A wallet with this name already exists!",
@ -220,5 +220,98 @@
"selectExportWallet":"Select a wallet to export", "selectExportWallet":"Select a wallet to export",
"exportError":"An error occured trying to export wallet", "exportError":"An error occured trying to export wallet",
"exportCompleted":"Export completed", "exportCompleted":"Export completed",
"importCompleted":"Import completed" "importCompleted":"Import completed",
"setup":"Setup",
"sourceCode":"Source code",
"sortNewest":"Newest first",
"sortOldest":"Oldest first",
"sort":"Sort",
"search":"Search",
"expensesPerYear":"Expenses per month in {year}",
"@expensesPerYear":{
"placeholders": {
"year":{
"description": "The year of the monthly expense sum",
"example": "2024",
"type": "int"
}
}
},
"expensesPerMonth":"Expenses per day during {monthYear}",
"@expensesPerMonth":{
"placeholders": {
"monthYear":{
"description": "Month and year formatted through DateFormat class",
"example": "June, 2024",
"type": "String"
}
}
},
"incomePerYear":"Income per month in {year}",
"@incomePerYear":{
"placeholders": {
"year":{
"description": "The year of the monthly expense sum",
"example": "2024",
"type": "int"
}
}
},
"incomePerMonth":"Income per day during {monthYear}",
"@incomePerMonth":{
"placeholders": {
"monthYear":{
"description": "Month and year formatted through DateFormat class",
"example": "June, 2024",
"type": "String"
}
}
},
"date":"Date",
"incomePlural":"Income",
"@incomePlural":{
"description": "Plural form of 'Income'"
},
"expensesPerMonthCategory":"Expenses per category during {monthYear}",
"@expensesPerMonthCategory":{
"placeholders": {
"monthYear":{
"description": "Month and year formatted through DateFormat class",
"example": "June, 2024",
"type": "String"
}
}
},
"expensesPerYearCategory":"Expenses per category in {year}",
"@expensesPerYearCategory":{
"placeholders": {
"year":{
"description": "The year",
"example": "2024",
"type": "int"
}
}
},
"incomePerMonthCategory":"Income per category during {monthYear}",
"@incomePerMonthCategory":{
"placeholders": {
"monthYear":{
"description": "Month and year formatted through DateFormat class",
"example": "June, 2024",
"type": "String"
}
}
},
"incomePerYearCategory":"Income per category in {year}",
"@incomePerYearCategory":{
"placeholders": {
"year":{
"description": "The year",
"example": "2024",
"type": "int"
}
}
},
"selectYear":"Select a year",
"selectMonth":"Select a month and year"
} }

View file

@ -23,6 +23,8 @@ class PlatformField extends PlatformWidget<TextField, CupertinoTextField> {
this.maxLines = 1, this.maxLines = 1,
this.focusNode, this.focusNode,
this.inputBorder = const OutlineInputBorder(), this.inputBorder = const OutlineInputBorder(),
this.suffix,
this.prefix,
}); });
final TextEditingController? controller; final TextEditingController? controller;
final bool? enabled; final bool? enabled;
@ -38,6 +40,8 @@ class PlatformField extends PlatformWidget<TextField, CupertinoTextField> {
final int? maxLines; final int? maxLines;
final InputBorder inputBorder; final InputBorder inputBorder;
final FocusNode? focusNode; final FocusNode? focusNode;
final Widget? suffix;
final Widget? prefix;
@override @override
TextField createAndroidWidget(BuildContext context) => TextField( TextField createAndroidWidget(BuildContext context) => TextField(
@ -48,6 +52,8 @@ class PlatformField extends PlatformWidget<TextField, CupertinoTextField> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: labelText, labelText: labelText,
border: inputBorder, border: inputBorder,
suffix: suffix,
prefix: prefix,
), ),
autocorrect: autocorrect, autocorrect: autocorrect,
keyboardType: keyboardType, keyboardType: keyboardType,
@ -74,5 +80,7 @@ class PlatformField extends PlatformWidget<TextField, CupertinoTextField> {
focusNode: focusNode, focusNode: focusNode,
maxLines: maxLines, maxLines: maxLines,
style: textStyle, style: textStyle,
prefix: prefix,
suffix: suffix,
); );
} }

View file

@ -71,12 +71,14 @@ class ExpensesLineChart extends StatelessWidget {
LineChartData( LineChartData(
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData( touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Theme.of(context).colorScheme.secondaryContainer,
getTooltipItems: (spots) => List<LineTooltipItem>.generate( getTooltipItems: (spots) => List<LineTooltipItem>.generate(
spots.length, spots.length,
(index) => LineTooltipItem( (index) => LineTooltipItem(
// Changes what's rendered on the tooltip // Changes what's rendered on the tooltip
// when clicked in the chart // when clicked in the chart
(spots[index].barIndex == 0) // income chart (spots[index].barIndex == 0 &&
incomeData.isNotEmpty) // income chart
? (yearly ? (yearly
? AppLocalizations.of(context).incomeForMonth( ? AppLocalizations.of(context).incomeForMonth(
DateFormat.MMMM(locale).format( DateFormat.MMMM(locale).format(
@ -121,13 +123,10 @@ class ExpensesLineChart extends StatelessWidget {
)), )),
TextStyle(color: spots[index].bar.color), TextStyle(color: spots[index].bar.color),
children: [ children: [
if (!yearly)
TextSpan( TextSpan(
text: "\n${yearly ? DateFormat.MMMM(locale).format( text:
DateTime( "\n${DateFormat.yMMMMd(locale).format(DateTime(date.year, date.month, spots[index].spotIndex + 1))}",
date.year,
index + 1,
),
) : DateFormat.yMMMMd(locale).format(DateTime(date.year, date.month, spots[index].spotIndex + 1))}",
), ),
], ],
), ),
@ -136,12 +135,11 @@ class ExpensesLineChart extends StatelessWidget {
), ),
maxY: maxY, maxY: maxY,
maxX: yearly maxX: yearly
? 12 ? 11
: date.lastDay.toDouble() - : date.lastDay.toDouble() -
1, // remove 1 because we are indexing from 0 1, // remove 1 because we are indexing from 0
minY: 0, minY: 0,
minX: 0, minX: 0,
backgroundColor: Theme.of(context).colorScheme.background,
lineBarsData: [ lineBarsData: [
if (incomeData.isNotEmpty) if (incomeData.isNotEmpty)
LineChartBarData( LineChartBarData(
@ -185,14 +183,16 @@ class ExpensesLineChart extends StatelessWidget {
topTitles: const AxisTitles(), topTitles: const AxisTitles(),
leftTitles: AxisTitles( leftTitles: AxisTitles(
sideTitles: SideTitles( sideTitles: SideTitles(
reservedSize: (NumberFormat.compact() reservedSize: ((expenseDataSorted.isNotEmpty &&
NumberFormat.compact(locale: locale)
.format(expenseDataSorted.last) .format(expenseDataSorted.last)
.length >= .length >=
5 || 5) ||
NumberFormat.compact() (incomeDataSorted.isNotEmpty &&
NumberFormat.compact(locale: locale)
.format(incomeDataSorted.last) .format(incomeDataSorted.last)
.length >= .length >=
5) 5))
? 50 ? 50
: 25, : 25,
showTitles: true, showTitles: true,
@ -289,7 +289,7 @@ class ExpensesBarChart extends StatelessWidget {
getTooltipItem: (group, groupIndex, rod, rodIndex) => getTooltipItem: (group, groupIndex, rod, rodIndex) =>
yearly // create custom tooltips for graph bars yearly // create custom tooltips for graph bars
? BarTooltipItem( ? BarTooltipItem(
(rodIndex == 1) (rodIndex == 1 || incomeData.isEmpty) // expense
? AppLocalizations.of(context).expensesForMonth( ? AppLocalizations.of(context).expensesForMonth(
DateFormat.MMMM(locale).format( DateFormat.MMMM(locale).format(
DateTime(date.year, groupIndex + 1), DateTime(date.year, groupIndex + 1),
@ -301,6 +301,7 @@ class ExpensesBarChart extends StatelessWidget {
).format(rod.toY), ).format(rod.toY),
) )
: AppLocalizations.of(context).incomeForMonth( : AppLocalizations.of(context).incomeForMonth(
// income
DateFormat.MMMM(locale).format( DateFormat.MMMM(locale).format(
DateTime(date.year, groupIndex + 1), DateTime(date.year, groupIndex + 1),
), ),
@ -391,6 +392,7 @@ class CategoriesPieChart extends StatefulWidget {
required this.entries, required this.entries,
required this.categories, required this.categories,
required this.symbol, required this.symbol,
required this.locale,
super.key, super.key,
}); });
@ -403,6 +405,9 @@ class CategoriesPieChart extends StatefulWidget {
/// Currency symbol displayed on the chart /// Currency symbol displayed on the chart
final String symbol; final String symbol;
/// User locale
final String locale;
@override @override
State<CategoriesPieChart> createState() => _CategoriesPieChartState(); State<CategoriesPieChart> createState() => _CategoriesPieChartState();
} }
@ -439,7 +444,9 @@ class _CategoriesPieChartState extends State<CategoriesPieChart> {
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
Expanded( LimitedBox(
maxHeight: MediaQuery.of(context).size.height * 0.23,
maxWidth: MediaQuery.of(context).size.width * 0.9,
child: PieChart( child: PieChart(
PieChartData( PieChartData(
centerSpaceRadius: double.infinity, centerSpaceRadius: double.infinity,
@ -462,8 +469,10 @@ class _CategoriesPieChartState extends State<CategoriesPieChart> {
sections: List<PieChartSectionData>.generate( sections: List<PieChartSectionData>.generate(
widget.categories.length, widget.categories.length,
(index) => PieChartSectionData( (index) => PieChartSectionData(
title: NumberFormat.compactCurrency(symbol: widget.symbol) title: NumberFormat.compactCurrency(
.format( symbol: widget.symbol,
locale: widget.locale,
).format(
widget.entries widget.entries
.where( .where(
(element) => (element) =>
@ -480,6 +489,7 @@ class _CategoriesPieChartState extends State<CategoriesPieChart> {
color: color:
widget.categories[index].color.calculateTextColor(), widget.categories[index].color.calculateTextColor(),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
backgroundColor: widget.categories[index].color,
), ),
color: widget.categories[index].color, color: widget.categories[index].color,
value: widget.entries value: widget.entries

58
lib/util/sorting.dart Normal file
View file

@ -0,0 +1,58 @@
import 'package:grouped_list/grouped_list.dart';
import 'package:intl/intl.dart';
/// Sorts [GroupedListView]'s group by newest group
int groupSortNewest(String a, String b, String locale) {
// TODO: better sorting algorithm lol
final yearA = RegExp(r'\d+').firstMatch(a);
if (yearA == null) return 0;
final yearB = RegExp(r'\d+').firstMatch(b);
if (yearB == null) return 0;
final compareYears = int.parse(yearB.group(0)!).compareTo(
int.parse(yearA.group(0)!),
);
if (compareYears != 0) {
return compareYears;
}
final months = List<String>.generate(
12,
(index) => DateFormat.MMMM(locale).format(
DateTime(2023, index + 1),
),
);
final monthA = RegExp('[^0-9 ]+').firstMatch(a);
if (monthA == null) return 0;
final monthB = RegExp('[^0-9 ]+').firstMatch(b);
if (monthB == null) return 0;
return months.indexOf(monthB.group(0)!).compareTo(
months.indexOf(monthA.group(0)!),
);
}
/// Sorts [GroupedListView]'s group by oldest group
int groupSortOldest(String a, String b, String locale) {
// TODO: better sorting algorithm lol
final yearA = RegExp(r'\d+').firstMatch(a);
if (yearA == null) return 0;
final yearB = RegExp(r'\d+').firstMatch(b);
if (yearB == null) return 0;
final compareYears = int.parse(yearA.group(0)!).compareTo(
int.parse(yearB.group(0)!),
);
if (compareYears != 0) {
return compareYears;
}
final months = List<String>.generate(
12,
(index) => DateFormat.MMMM(locale).format(
DateTime(2023, index + 1),
),
);
final monthA = RegExp('[^0-9 ]+').firstMatch(a);
if (monthA == null) return 0;
final monthB = RegExp('[^0-9 ]+').firstMatch(b);
if (monthB == null) return 0;
return months.indexOf(monthA.group(0)!).compareTo(
months.indexOf(monthB.group(0)!),
);
}

38
lib/util/utils.dart Normal file
View file

@ -0,0 +1,38 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:prasule/pw/platformbutton.dart';
import 'package:url_launcher/url_launcher_string.dart';
/// Shows an [AboutDialog] with all the data filled,
/// so I don't have to copypaste the same function everywhere
void showAbout(BuildContext context) {
showAboutDialog(
context: context,
applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule",
applicationVersion: "1.0.0",
applicationIcon: const CircleAvatar(
backgroundImage: AssetImage("assets/icon/full_ico.png"),
),
children: [
PlatformButton(
text: "Tessdata",
onPressed: () {
unawaited(
launchUrlString(
"https://github.com/tesseract-ocr/tessdata_fast",
),
);
},
),
PlatformButton(
text: AppLocalizations.of(context).sourceCode,
onPressed: () {
unawaited(launchUrlString("https://git.mnau.xyz/hernik/prasule"));
},
),
],
);
}

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:intl/intl.dart';
import 'package:prasule/api/category.dart'; import 'package:prasule/api/category.dart';
import 'package:prasule/api/entry_data.dart'; import 'package:prasule/api/entry_data.dart';
import 'package:prasule/api/wallet.dart'; import 'package:prasule/api/wallet.dart';
@ -13,7 +14,11 @@ import 'package:prasule/util/show_message.dart';
/// Used when user wants to add new entry /// Used when user wants to add new entry
class CreateSingleEntryView extends StatefulWidget { class CreateSingleEntryView extends StatefulWidget {
/// Used when user wants to add new entry /// Used when user wants to add new entry
const CreateSingleEntryView({required this.w, super.key, this.editEntry}); const CreateSingleEntryView({
required this.w,
required this.locale, super.key,
this.editEntry,
});
/// The wallet, where the entry will be saved to /// The wallet, where the entry will be saved to
final Wallet w; final Wallet w;
@ -23,6 +28,8 @@ class CreateSingleEntryView extends StatefulWidget {
/// Is null unless we are editing an existing entry /// Is null unless we are editing an existing entry
final WalletSingleEntry? editEntry; final WalletSingleEntry? editEntry;
final String locale;
@override @override
State createState() => _CreateSingleEntryViewState(); State createState() => _CreateSingleEntryViewState();
} }
@ -184,6 +191,33 @@ class _CreateSingleEntryViewState extends State<CreateSingleEntryView> {
}, },
), ),
), ),
const SizedBox(
height: 20,
),
Text(AppLocalizations.of(context).date),
PlatformButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.primary,
),
foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.onPrimary,
),
),
text: DateFormat.yMMMMd(widget.locale).format(newEntry.date),
onPressed: () async {
final date = await showDatePicker(
initialDate: newEntry.date,
context: context,
firstDate: DateTime.now()
.subtract(const Duration(days: 20 * 365)),
lastDate: DateTime.now().add(const Duration(days: 365)),
);
if (date == null) return;
newEntry.date = date;
setState(() {});
},
),
const SizedBox( const SizedBox(
height: 15, height: 15,
), ),

View file

@ -7,13 +7,14 @@ import 'package:prasule/api/category.dart';
import 'package:prasule/api/wallet.dart'; import 'package:prasule/api/wallet.dart';
import 'package:prasule/api/wallet_manager.dart'; import 'package:prasule/api/wallet_manager.dart';
import 'package:prasule/main.dart'; import 'package:prasule/main.dart';
import 'package:prasule/pw/platformbutton.dart';
import 'package:prasule/pw/platformroute.dart'; import 'package:prasule/pw/platformroute.dart';
import 'package:prasule/util/drawer.dart'; import 'package:prasule/util/drawer.dart';
import 'package:prasule/util/graphs.dart'; import 'package:prasule/util/graphs.dart';
import 'package:prasule/util/utils.dart';
import 'package:prasule/views/settings/settings.dart'; import 'package:prasule/views/settings/settings.dart';
import 'package:prasule/views/setup.dart'; import 'package:prasule/views/setup.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:wheel_chooser/wheel_chooser.dart';
/// Shows data from a [Wallet] in graphs /// Shows data from a [Wallet] in graphs
class GraphView extends StatefulWidget { class GraphView extends StatefulWidget {
@ -29,9 +30,7 @@ class _GraphViewState extends State<GraphView> {
Wallet? selectedWallet; Wallet? selectedWallet;
List<Wallet> wallets = []; List<Wallet> wallets = [];
String? locale; String? locale;
Set<String> yearlyBtnSet = {"monthly"}; bool yearly = true;
Set<String> graphTypeSet = {"expense", "income"};
bool get yearly => yearlyBtnSet.contains("yearly");
@override @override
void didChangeDependencies() { void didChangeDependencies() {
@ -66,6 +65,8 @@ class _GraphViewState extends State<GraphView> {
return data; return data;
} }
final availableYears = <WheelChoice<int>>[];
Future<void> loadWallet() async { Future<void> loadWallet() async {
wallets = await WalletManager.listWallets(); wallets = await WalletManager.listWallets();
if (wallets.isEmpty && mounted) { if (wallets.isEmpty && mounted) {
@ -76,6 +77,17 @@ class _GraphViewState extends State<GraphView> {
return; return;
} }
selectedWallet = wallets.first; selectedWallet = wallets.first;
availableYears.clear();
for (final entry in selectedWallet!.entries) {
if (!availableYears.any((element) => element.value == entry.date.year)) {
availableYears.add(
WheelChoice<int>(
value: entry.date.year,
title: entry.date.year.toString(),
),
);
}
}
setState(() {}); setState(() {});
} }
@ -92,52 +104,100 @@ class _GraphViewState extends State<GraphView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return DefaultTabController(
length: 2,
child: Scaffold(
floatingActionButton: Tooltip( floatingActionButton: Tooltip(
message: AppLocalizations.of(context).changeDate, message: AppLocalizations.of(context).changeDate,
child: PlatformButton( child: FloatingActionButton(
style: ButtonStyle( child: const Icon(Icons.calendar_month),
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.primary,
),
foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.onPrimary,
),
),
text: yearly
? DateFormat.y(locale).format(_selectedDate)
: DateFormat.yMMMM(locale).format(_selectedDate),
onPressed: () async { onPressed: () async {
final firstDate = (selectedWallet!.entries var selectedYear = _selectedDate.year;
..sort( var selectedMonth = _selectedDate.month;
(a, b) => a.date.compareTo(b.date), await showAdaptiveDialog<void>(
))
.first
.date;
final newDate = await showDatePicker(
context: context, context: context,
initialDate: DateTime( builder: (c) => AlertDialog.adaptive(
_selectedDate.year, title: Text(
_selectedDate.month, yearly
? AppLocalizations.of(context).selectYear
: AppLocalizations.of(context).selectMonth,
),
content: LimitedBox(
maxHeight: MediaQuery.of(context).size.width * 0.7,
maxWidth: MediaQuery.of(context).size.width * 0.8,
child: Wrap(
alignment: WrapAlignment.center,
spacing: 5,
children: [
if (!yearly)
SizedBox(
width: 120,
height: 100,
child: WheelChooser<int>.choices(
onChoiceChanged: (v) {
selectedMonth = v as int;
},
startPosition: _selectedDate.month - 1,
choices: List<WheelChoice<int>>.generate(
12,
(index) => WheelChoice(
value: index + 1,
title: DateFormat.MMMM(locale ?? "en").format(
DateTime(
_selectedDate.year,
index + 1,
),
),
),
),
),
),
SizedBox(
height: 100,
width: 80,
child: WheelChooser<int>.choices(
startPosition: availableYears.indexWhere(
(element) => element.value == _selectedDate.year,
),
onChoiceChanged: (v) {
selectedYear = v as int;
},
choices: availableYears,
),
),
],
),
),
actions: [
TextButton(
onPressed: () {
_selectedDate = DateTime(selectedYear, selectedMonth);
Navigator.of(c).pop();
},
child: Text(AppLocalizations.of(context).ok),
),
],
), ),
firstDate: firstDate,
lastDate: DateTime.now(),
initialEntryMode: yearly
? DatePickerEntryMode.input
: DatePickerEntryMode.calendar,
initialDatePickerMode:
yearly ? DatePickerMode.year : DatePickerMode.day,
); );
if (newDate == null) return;
_selectedDate = newDate;
setState(() {}); setState(() {});
}, },
), ),
), ),
appBar: AppBar( appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(
child: Text(AppLocalizations.of(context).expenses),
),
Tab(
child: Text(AppLocalizations.of(context).incomePlural),
),
],
),
title: DropdownButton<int>( title: DropdownButton<int>(
value: value: (selectedWallet == null)
(selectedWallet == null) ? -1 : wallets.indexOf(selectedWallet!), ? -1
: wallets.indexOf(selectedWallet!),
items: [ items: [
...wallets.map( ...wallets.map(
(e) => DropdownMenuItem( (e) => DropdownMenuItem(
@ -193,18 +253,17 @@ class _GraphViewState extends State<GraphView> {
setState(() {}); setState(() {});
}); });
} else if (value == AppLocalizations.of(context).about) { } else if (value == AppLocalizations.of(context).about) {
showAboutDialog( showAbout(context);
context: context,
applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule",
);
} }
}, },
), ),
], ],
), ),
drawer: makeDrawer(context, 2), drawer: makeDrawer(context, 2),
body: SingleChildScrollView( body: TabBarView(
children: [
// EXPENSE TAB
SingleChildScrollView(
child: Center( child: Center(
child: (selectedWallet == null) child: (selectedWallet == null)
? const CircularProgressIndicator( ? const CircularProgressIndicator(
@ -216,104 +275,124 @@ class _GraphViewState extends State<GraphView> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SegmentedButton<String>( SizedBox(
segments: [ width: 200,
ButtonSegment<String>( child: Row(
value: "expense", mainAxisAlignment:
label: Text(AppLocalizations.of(context).expenses), MainAxisAlignment.spaceBetween,
children: [
Text(
AppLocalizations.of(context).monthly,
style: const TextStyle(
fontWeight: FontWeight.bold,
), ),
ButtonSegment<String>(
value: "income",
label: Text(AppLocalizations.of(context).income),
), ),
], Switch.adaptive(
selected: graphTypeSet, value: yearly,
multiSelectionEnabled: true, onChanged: (v) async {
onSelectionChanged: (selection) { yearly = v;
graphTypeSet = selection; final s =
setState(() {}); await SharedPreferences.getInstance();
},
),
const SizedBox(
height: 5,
),
SegmentedButton<String>(
segments: [
ButtonSegment<String>(
value: "yearly",
label: Text(AppLocalizations.of(context).yearly),
),
ButtonSegment<String>(
value: "monthly",
label: Text(AppLocalizations.of(context).monthly),
),
],
selected: yearlyBtnSet,
onSelectionChanged: (selection) async {
yearlyBtnSet = selection;
final s = await SharedPreferences.getInstance();
chartType = yearly chartType = yearly
? (s.getInt("yearlygraph") ?? 1) ? (s.getInt("yearlygraph") ?? 1)
: (s.getInt("monthlygraph") ?? 2); : (s.getInt("monthlygraph") ?? 2);
setState(() {}); setState(() {});
}, },
), ),
const SizedBox(height: 5), Text(
AppLocalizations.of(context).yearly,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: boxShadow: (MediaQuery.of(context)
Theme.of(context).colorScheme.secondaryContainer, .platformBrightness ==
Brightness.light)
? [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: const Offset(
0,
3,
),
),
]
: null,
color: (MediaQuery.of(context)
.platformBrightness ==
Brightness.dark)
? Theme.of(context)
.colorScheme
.secondaryContainer
: Theme.of(context).colorScheme.background,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: Column( child: Column(
children: [ children: [
Text(
yearly
? AppLocalizations.of(context)
.expensesPerYear(
_selectedDate.year,
)
: AppLocalizations.of(context)
.expensesPerMonth(
DateFormat.yMMMM(locale)
.format(_selectedDate),
),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 15,
),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width *
0.9,
height: height:
MediaQuery.of(context).size.height * 0.35, MediaQuery.of(context).size.height *
0.35,
child: (chartType == null) child: (chartType == null)
? const CircularProgressIndicator() ? const CircularProgressIndicator()
: (chartType == 1) : (chartType == 1)
? ExpensesBarChart( ? ExpensesBarChart(
currency: selectedWallet!.currency,
date: _selectedDate,
locale: locale ?? "en",
yearly: yearly,
expenseData: (graphTypeSet
.contains("expense"))
? generateChartData(
EntryType.expense,
)
: [],
incomeData: (graphTypeSet
.contains("income"))
? generateChartData(
EntryType.income,
)
: [],
)
: Padding(
padding: const EdgeInsets.all(8),
child: ExpensesLineChart(
currency: currency:
selectedWallet!.currency, selectedWallet!.currency,
date: _selectedDate, date: _selectedDate,
locale: locale ?? "en", locale: locale ?? "en",
yearly: yearly, yearly: yearly,
expenseData: (graphTypeSet expenseData:
.contains("expense")) generateChartData(
? generateChartData(
EntryType.expense, EntryType.expense,
),
incomeData: const [],
) )
: [], : Padding(
incomeData: (graphTypeSet padding:
.contains("income")) const EdgeInsets.all(8),
? generateChartData( child: ExpensesLineChart(
EntryType.income, currency: selectedWallet!
) .currency,
: [], date: _selectedDate,
locale: locale ?? "en",
yearly: yearly,
expenseData:
generateChartData(
EntryType.expense,
),
incomeData: const [],
), ),
), ),
), ),
@ -327,17 +406,216 @@ class _GraphViewState extends State<GraphView> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: boxShadow: (MediaQuery.of(context)
Theme.of(context).colorScheme.secondaryContainer, .platformBrightness ==
Brightness.light)
? [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: const Offset(
0,
3,
),
),
]
: null,
color: (MediaQuery.of(context)
.platformBrightness ==
Brightness.dark)
? Theme.of(context)
.colorScheme
.secondaryContainer
: Theme.of(context).colorScheme.background,
), ),
width: MediaQuery.of(context).size.width * 0.95, width: MediaQuery.of(context).size.width * 0.95,
height: MediaQuery.of(context).size.height * 0.35, height: MediaQuery.of(context).size.height * 0.4,
child: Column(
children: [
const SizedBox(
height: 10,
),
Flexible(
child: Text(
textAlign: TextAlign.center,
yearly
? AppLocalizations.of(context)
.expensesPerYearCategory(
_selectedDate.year,
)
: AppLocalizations.of(context)
.expensesPerMonthCategory(
DateFormat.yMMMM(locale)
.format(_selectedDate),
),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
Padding(
padding: const EdgeInsets.all(6),
child: CategoriesPieChart(
// TODO: better size adaptivity without overflow
locale: locale ?? "en",
symbol: selectedWallet!.currency.symbol,
entries: selectedWallet!.entries
.where(
(element) =>
((!yearly)
? element.date.month ==
_selectedDate
.month &&
element.date.year ==
_selectedDate.year
: element.date.year ==
_selectedDate.year) &&
element.type ==
EntryType.expense,
)
.toList(),
categories: selectedWallet!.categories,
),
),
],
),
),
],
),
),
),
), // Expense Tab END
SingleChildScrollView(
child: Center(
child: (selectedWallet == null)
? const CircularProgressIndicator(
strokeWidth: 5,
)
: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 200,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
AppLocalizations.of(context).monthly,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
Switch.adaptive(
value: yearly,
onChanged: (v) async {
yearly = v;
final s =
await SharedPreferences.getInstance();
chartType = yearly
? (s.getInt("yearlygraph") ?? 1)
: (s.getInt("monthlygraph") ?? 2);
setState(() {});
},
),
Text(
AppLocalizations.of(context).yearly,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: (MediaQuery.of(context)
.platformBrightness ==
Brightness.light)
? [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: const Offset(
0,
3,
),
),
]
: null,
color: (MediaQuery.of(context)
.platformBrightness ==
Brightness.dark)
? Theme.of(context)
.colorScheme
.secondaryContainer
: Theme.of(context).colorScheme.background,
),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: CategoriesPieChart( child: Column(
symbol: selectedWallet!.currency.symbol, children: [
entries: selectedWallet!.entries, Text(
categories: selectedWallet!.categories, yearly
? AppLocalizations.of(context)
.incomePerYear(
_selectedDate.year,
)
: AppLocalizations.of(context)
.incomePerMonth(
DateFormat.yMMMM(locale)
.format(_selectedDate),
),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(
height: 15,
),
SizedBox(
width: MediaQuery.of(context).size.width *
0.9,
height:
MediaQuery.of(context).size.height *
0.35,
child: (chartType == null)
? const CircularProgressIndicator()
: (chartType == 1)
? ExpensesBarChart(
currency:
selectedWallet!.currency,
date: _selectedDate,
locale: locale ?? "en",
yearly: yearly,
expenseData: const [],
incomeData: generateChartData(
EntryType.income,
),
)
: Padding(
padding:
const EdgeInsets.all(8),
child: ExpensesLineChart(
currency: selectedWallet!
.currency,
date: _selectedDate,
locale: locale ?? "en",
yearly: yearly,
expenseData: const [],
incomeData:
generateChartData(
EntryType.income,
),
), ),
), ),
), ),
@ -345,6 +623,93 @@ class _GraphViewState extends State<GraphView> {
), ),
), ),
), ),
const SizedBox(
height: 25,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
boxShadow: (MediaQuery.of(context)
.platformBrightness ==
Brightness.light)
? [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: const Offset(
0,
3,
),
),
]
: null,
color: (MediaQuery.of(context)
.platformBrightness ==
Brightness.dark)
? Theme.of(context)
.colorScheme
.secondaryContainer
: Theme.of(context).colorScheme.background,
),
width: MediaQuery.of(context).size.width * 0.95,
height: MediaQuery.of(context).size.height * 0.4,
child: Column(
children: [
const SizedBox(
height: 10,
),
Flexible(
child: Text(
yearly
? AppLocalizations.of(context)
.incomePerYearCategory(
_selectedDate.year,
)
: AppLocalizations.of(context)
.incomePerMonthCategory(
DateFormat.yMMMM(locale)
.format(_selectedDate),
),
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
Padding(
padding: const EdgeInsets.all(6),
child: CategoriesPieChart(
locale: locale ?? "en",
symbol: selectedWallet!.currency.symbol,
entries: selectedWallet!.entries
.where(
(element) =>
((!yearly)
? element.date.month ==
_selectedDate
.month &&
element.date.year ==
_selectedDate.year
: element.date.year ==
_selectedDate.year) &&
element.type ==
EntryType.income,
)
.toList(),
categories: selectedWallet!.categories,
),
),
],
),
),
],
),
),
),
), // Income Tab END
],
),
), ),
); );
} }

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'dart:async'; import 'dart:async';
import 'package:dynamic_color/dynamic_color.dart'; import 'package:dynamic_color/dynamic_color.dart';
@ -24,7 +22,9 @@ import 'package:prasule/pw/platformbutton.dart';
import 'package:prasule/pw/platformfield.dart'; import 'package:prasule/pw/platformfield.dart';
import 'package:prasule/pw/platformroute.dart'; import 'package:prasule/pw/platformroute.dart';
import 'package:prasule/util/drawer.dart'; import 'package:prasule/util/drawer.dart';
import 'package:prasule/util/sorting.dart';
import 'package:prasule/util/text_color.dart'; import 'package:prasule/util/text_color.dart';
import 'package:prasule/util/utils.dart';
import 'package:prasule/views/create_entry.dart'; import 'package:prasule/views/create_entry.dart';
import 'package:prasule/views/settings/settings.dart'; import 'package:prasule/views/settings/settings.dart';
import 'package:prasule/views/settings/tessdata_list.dart'; import 'package:prasule/views/settings/tessdata_list.dart';
@ -40,13 +40,16 @@ class HomeView extends StatefulWidget {
} }
class _HomeViewState extends State<HomeView> { class _HomeViewState extends State<HomeView> {
Wallet? selectedWallet; Wallet? selectedWallet; // current wallet
List<Wallet> wallets = []; List<Wallet> wallets = []; // all available wallets
DateTime? prevDate; DateTime? prevDate;
late String locale; late String locale; // user's locale
var _searchActive = false; var _searchActive = false; // whether search field is shown
var _filter = ""; var _filter = ""; // search filter
final searchFocus = FocusNode(); final searchFocus = FocusNode();
SortType sort = SortType.newest;
OverlayEntry? overlayEntry;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
@ -83,11 +86,15 @@ class _HomeViewState extends State<HomeView> {
if (b) return; if (b) return;
_searchActive = false; _searchActive = false;
_filter = ""; _filter = "";
overlayEntry?.remove();
setState(() {}); setState(() {});
}, },
child: Scaffold( child: Scaffold(
drawer: makeDrawer(context, 1), drawer: makeDrawer(context, 1),
floatingActionButton: SpeedDial( floatingActionButton: SpeedDial(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
),
icon: Icons.add, icon: Icons.add,
activeIcon: Icons.close, activeIcon: Icons.close,
children: [ children: [
@ -113,7 +120,10 @@ class _HomeViewState extends State<HomeView> {
onTap: () async { onTap: () async {
final sw = await Navigator.of(context).push<Wallet>( final sw = await Navigator.of(context).push<Wallet>(
MaterialPageRoute( MaterialPageRoute(
builder: (c) => CreateSingleEntryView(w: selectedWallet!), builder: (c) => CreateSingleEntryView(
w: selectedWallet!,
locale: locale,
),
), ),
); );
if (sw != null) { if (sw != null) {
@ -190,21 +200,42 @@ class _HomeViewState extends State<HomeView> {
}, },
), ),
), ),
actions: [ actions: _searchActive
if (!_searchActive) ? []
IconButton( : [
onPressed: () { PopupMenuButton(
_searchActive = true; tooltip: AppLocalizations.of(context).sort,
setState(() {}); icon: const Icon(Icons.sort_rounded),
}, itemBuilder: (context) => [
icon: const Icon(Icons.search), AppLocalizations.of(context).sortNewest,
AppLocalizations.of(context).sortOldest,
]
.map(
(e) => PopupMenuItem(
value: e,
child: Text(e),
),
)
.toList(),
onSelected: (value) {
if (value == AppLocalizations.of(context).sortNewest) {
sort = SortType.newest;
setState(() {});
} else if (value ==
AppLocalizations.of(context).sortOldest) {
sort = SortType.oldest;
setState(() {});
}
},
), ),
if (!_searchActive)
PopupMenuButton( PopupMenuButton(
itemBuilder: (context) => [ itemBuilder: (context) => [
AppLocalizations.of(context).settings, AppLocalizations.of(context).settings,
AppLocalizations.of(context).search,
AppLocalizations.of(context).about, AppLocalizations.of(context).about,
].map((e) => PopupMenuItem(value: e, child: Text(e))).toList(), ]
.map((e) => PopupMenuItem(value: e, child: Text(e)))
.toList(),
onSelected: (value) { onSelected: (value) {
if (value == AppLocalizations.of(context).settings) { if (value == AppLocalizations.of(context).settings) {
Navigator.of(context) Navigator.of(context)
@ -215,15 +246,43 @@ class _HomeViewState extends State<HomeView> {
) )
.then((value) async { .then((value) async {
wallets = await WalletManager.listWallets(); wallets = await WalletManager.listWallets();
selectedWallet = selectedWallet = await WalletManager.loadWallet(
await WalletManager.loadWallet(selectedWallet!.name); selectedWallet!.name,);
}); });
} else if (value == AppLocalizations.of(context).about) { } else if (value == AppLocalizations.of(context).about) {
showAboutDialog( showAbout(context);
context: context, } else if (value == AppLocalizations.of(context).search) {
applicationLegalese: AppLocalizations.of(context).license, _searchActive = !_searchActive;
applicationName: "Prašule", if (!_searchActive) {
_filter = "";
} else {
overlayEntry = OverlayEntry(
builder: (context) => Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
width: MediaQuery.of(context).size.width,
height:
MediaQuery.of(context).size.height - 100,
child: GestureDetector(
onTap: () {
if (!searchFocus.hasFocus) {
_searchActive = false;
_filter = "";
overlayEntry?.remove();
setState(() {});
return;
}
searchFocus.unfocus();
},
),
),
),
); );
Overlay.of(context).insert(
overlayEntry!,
);
}
setState(() {});
} }
}, },
), ),
@ -268,7 +327,7 @@ class _HomeViewState extends State<HomeView> {
locale: locale, locale: locale,
symbol: selectedWallet!.currency.symbol, symbol: selectedWallet!.currency.symbol,
).format( ).format(
selectedWallet!.calculateCurrentBalance(), selectedWallet!.currentBalance,
), ),
style: const TextStyle( style: const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -291,6 +350,11 @@ class _HomeViewState extends State<HomeView> {
TextSpan( TextSpan(
text: AppLocalizations.of(context) text: AppLocalizations.of(context)
.balanceStatusA, .balanceStatusA,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onBackground,
),
), ),
TextSpan( TextSpan(
style: TextStyle( style: TextStyle(
@ -336,6 +400,11 @@ class _HomeViewState extends State<HomeView> {
TextSpan( TextSpan(
text: AppLocalizations.of(context) text: AppLocalizations.of(context)
.balanceStatusB, .balanceStatusB,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onBackground,
),
), ),
], ],
), ),
@ -355,87 +424,27 @@ class _HomeViewState extends State<HomeView> {
), ),
), ),
elements: selectedWallet!.entries elements: selectedWallet!.entries
.where((element) => .where(
element.data.name.contains(_filter)) (element) => element.data.name
.toLowerCase()
.contains(_filter.toLowerCase()),
)
.toList(), .toList(),
itemComparator: (a, b) => itemComparator: (a, b) =>
b.date.compareTo(a.date), (sort == SortType.newest)
? b.date.compareTo(a.date)
: a.date.compareTo(b.date),
groupBy: (e) => groupBy: (e) =>
DateFormat.yMMMM(locale).format(e.date), DateFormat.yMMMM(locale).format(e.date),
groupComparator: (a, b) { groupComparator: (a, b) =>
// TODO: better sorting algorithm lol (sort == SortType.newest)
final yearA = ? groupSortNewest(a, b, locale)
RegExp(r'\d+').firstMatch(a); : groupSortOldest(a, b, locale),
if (yearA == null) return 0;
final yearB =
RegExp(r'\d+').firstMatch(b);
if (yearB == null) return 0;
final compareYears =
int.parse(yearB.group(0)!).compareTo(
int.parse(yearA.group(0)!),
);
if (compareYears != 0) {
return compareYears;
}
final months = List<String>.generate(
12,
(index) =>
DateFormat.MMMM(locale).format(
DateTime(2023, index + 1),
),
);
final monthA =
RegExp('[^0-9 ]+').firstMatch(a);
if (monthA == null) return 0;
final monthB =
RegExp('[^0-9 ]+').firstMatch(b);
if (monthB == null) return 0;
return months
.indexOf(monthB.group(0)!)
.compareTo(
months.indexOf(monthA.group(0)!),
);
},
itemBuilder: (context, element) => Slidable( itemBuilder: (context, element) => Slidable(
endActionPane: ActionPane( endActionPane: ActionPane(
extentRatio: 0.3,
motion: const ScrollMotion(), motion: const ScrollMotion(),
children: [ children: [
SlidableAction(
onPressed: (c) {
Navigator.of(context)
.push<WalletSingleEntry>(
MaterialPageRoute(
builder: (c) =>
CreateSingleEntryView(
w: selectedWallet!,
editEntry: element,
),
),
)
.then(
(editedEntry) {
if (editedEntry == null) {
return;
}
selectedWallet!.entries
.remove(element);
selectedWallet!.entries
.add(editedEntry);
WalletManager.saveWallet(
selectedWallet!,
);
setState(() {});
},
);
},
backgroundColor: Theme.of(context)
.colorScheme
.secondary,
foregroundColor: Theme.of(context)
.colorScheme
.onSecondary,
icon: Icons.edit,
),
SlidableAction( SlidableAction(
backgroundColor: Theme.of(context) backgroundColor: Theme.of(context)
.colorScheme .colorScheme
@ -445,7 +454,7 @@ class _HomeViewState extends State<HomeView> {
.onError, .onError,
icon: Icons.delete, icon: Icons.delete,
onPressed: (c) { onPressed: (c) {
showAdaptiveDialog( showAdaptiveDialog<void>(
context: context, context: context,
builder: (cx) => builder: (cx) =>
AlertDialog.adaptive( AlertDialog.adaptive(
@ -495,6 +504,34 @@ class _HomeViewState extends State<HomeView> {
], ],
), ),
child: ListTile( child: ListTile(
onTap: () {
Navigator.of(context)
.push<WalletSingleEntry>(
MaterialPageRoute(
builder: (c) =>
CreateSingleEntryView(
locale: locale,
w: selectedWallet!,
editEntry: element,
),
),
)
.then(
(editedEntry) {
if (editedEntry == null) {
return;
}
selectedWallet!.entries
.remove(element);
selectedWallet!.entries
.add(editedEntry);
WalletManager.saveWallet(
selectedWallet!,
);
setState(() {});
},
);
},
leading: Container( leading: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
@ -565,24 +602,6 @@ class _HomeViewState extends State<HomeView> {
], ],
), ),
), ),
OverlayEntry(
builder: (context) => SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: GestureDetector(
onTap: () {
if (!_searchActive) return;
if (!searchFocus.hasFocus) {
_searchActive = false;
_filter = "";
setState(() {});
return;
}
searchFocus.unfocus();
},
),
),
),
], ],
), ),
), ),
@ -595,7 +614,7 @@ class _HomeViewState extends State<HomeView> {
final availableLanguages = await TessdataApi.getDownloadedData(); final availableLanguages = await TessdataApi.getDownloadedData();
if (availableLanguages.isEmpty) { if (availableLanguages.isEmpty) {
if (!mounted) return; if (!mounted) return;
await showAdaptiveDialog( await showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context).missingOcr), title: Text(AppLocalizations.of(context).missingOcr),
@ -628,7 +647,7 @@ class _HomeViewState extends State<HomeView> {
List<bool>.filled(availableLanguages.length, false); List<bool>.filled(availableLanguages.length, false);
selectedLanguages[0] = true; selectedLanguages[0] = true;
await showAdaptiveDialog( await showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => StatefulBuilder( builder: (c) => StatefulBuilder(
builder: (ctx, setState) => AlertDialog.adaptive( builder: (ctx, setState) => AlertDialog.adaptive(
@ -638,7 +657,9 @@ class _HomeViewState extends State<HomeView> {
final filePath = await FlutterFileDialog.pickFile( final filePath = await FlutterFileDialog.pickFile(
params: OpenFileDialogParams( params: OpenFileDialogParams(
dialogType: OpenFileDialogType.image, dialogType: OpenFileDialogType.image,
sourceType: sourceType)); sourceType: sourceType,
),
);
if (filePath == null) { if (filePath == null) {
if (mounted) Navigator.of(context).pop(); if (mounted) Navigator.of(context).pop();
return; return;
@ -696,6 +717,7 @@ class _HomeViewState extends State<HomeView> {
await Navigator.of(context).push<WalletSingleEntry>( await Navigator.of(context).push<WalletSingleEntry>(
platformRoute<WalletSingleEntry>( platformRoute<WalletSingleEntry>(
(c) => CreateSingleEntryView( (c) => CreateSingleEntryView(
locale: locale,
w: selectedWallet!, w: selectedWallet!,
editEntry: WalletSingleEntry( editEntry: WalletSingleEntry(
data: EntryData( data: EntryData(
@ -759,3 +781,12 @@ class _HomeViewState extends State<HomeView> {
); );
} }
} }
/// Represents entry sorting type
enum SortType {
/// Sort newest first
newest,
/// Sort oldest first
oldest
}

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,6 +12,7 @@ import 'package:prasule/pw/platformbutton.dart';
import 'package:prasule/pw/platformroute.dart'; import 'package:prasule/pw/platformroute.dart';
import 'package:prasule/util/drawer.dart'; import 'package:prasule/util/drawer.dart';
import 'package:prasule/util/text_color.dart'; import 'package:prasule/util/text_color.dart';
import 'package:prasule/util/utils.dart';
import 'package:prasule/views/create_recur_entry.dart'; import 'package:prasule/views/create_recur_entry.dart';
import 'package:prasule/views/settings/settings.dart'; import 'package:prasule/views/settings/settings.dart';
import 'package:prasule/views/setup.dart'; import 'package:prasule/views/setup.dart';
@ -117,18 +116,13 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
await WalletManager.loadWallet(selectedWallet!.name); await WalletManager.loadWallet(selectedWallet!.name);
}); });
} else if (value == AppLocalizations.of(context).about) { } else if (value == AppLocalizations.of(context).about) {
showAboutDialog( showAbout(context);
context: context,
applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule",
);
} }
}, },
), ),
], ],
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
shape: const CircleBorder(),
child: const Icon(Icons.add), child: const Icon(Icons.add),
onPressed: () { onPressed: () {
Navigator.of(context).push( Navigator.of(context).push(
@ -173,38 +167,8 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
itemBuilder: (c, i) => Slidable( itemBuilder: (c, i) => Slidable(
endActionPane: ActionPane( endActionPane: ActionPane(
motion: const ScrollMotion(), motion: const ScrollMotion(),
extentRatio: 0.3,
children: [ children: [
SlidableAction(
onPressed: (c) {
Navigator.of(context)
.push<RecurringWalletEntry>(
MaterialPageRoute(
builder: (c) => CreateRecurringEntryView(
w: selectedWallet!,
locale: locale,
editEntry:
selectedWallet!.recurringEntries[i],
),
),
)
.then(
(editedEntry) {
if (editedEntry == null) return;
selectedWallet!.entries.remove(
selectedWallet!.recurringEntries[i],
);
selectedWallet!.entries.add(editedEntry);
WalletManager.saveWallet(selectedWallet!);
setState(() {});
},
);
},
backgroundColor:
Theme.of(context).colorScheme.secondary,
foregroundColor:
Theme.of(context).colorScheme.onSecondary,
icon: Icons.edit,
),
SlidableAction( SlidableAction(
backgroundColor: backgroundColor:
Theme.of(context).colorScheme.error, Theme.of(context).colorScheme.error,
@ -212,7 +176,7 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
Theme.of(context).colorScheme.onError, Theme.of(context).colorScheme.onError,
icon: Icons.delete, icon: Icons.delete,
onPressed: (c) { onPressed: (c) {
showDialog( showDialog<void>(
context: context, context: context,
builder: (cx) => AlertDialog.adaptive( builder: (cx) => AlertDialog.adaptive(
title: Text( title: Text(
@ -250,6 +214,30 @@ class _RecurringEntriesViewState extends State<RecurringEntriesView> {
], ],
), ),
child: ListTile( child: ListTile(
onTap: () {
Navigator.of(context)
.push<RecurringWalletEntry>(
MaterialPageRoute(
builder: (c) => CreateRecurringEntryView(
w: selectedWallet!,
locale: locale,
editEntry:
selectedWallet!.recurringEntries[i],
),
),
)
.then(
(editedEntry) {
if (editedEntry == null) return;
selectedWallet!.entries.remove(
selectedWallet!.recurringEntries[i],
);
selectedWallet!.entries.add(editedEntry);
WalletManager.saveWallet(selectedWallet!);
setState(() {});
},
);
},
leading: Container( leading: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'dart:async'; import 'dart:async';
import 'package:dynamic_color/dynamic_color.dart'; import 'package:dynamic_color/dynamic_color.dart';
@ -15,6 +13,7 @@ import 'package:prasule/pw/platformbutton.dart';
import 'package:prasule/pw/platformfield.dart'; import 'package:prasule/pw/platformfield.dart';
import 'package:prasule/pw/platformroute.dart'; import 'package:prasule/pw/platformroute.dart';
import 'package:prasule/util/text_color.dart'; import 'package:prasule/util/text_color.dart';
import 'package:prasule/util/utils.dart';
import 'package:prasule/views/settings/settings.dart'; import 'package:prasule/views/settings/settings.dart';
import 'package:prasule/views/setup.dart'; import 'package:prasule/views/setup.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -106,11 +105,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
), ),
); );
} else if (value == AppLocalizations.of(context).about) { } else if (value == AppLocalizations.of(context).about) {
showAboutDialog( showAbout(context);
context: context,
applicationLegalese: AppLocalizations.of(context).license,
applicationName: "Prašule",
);
} }
}, },
), ),
@ -125,6 +120,27 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
AppLocalizations.of(context).setupCategoriesEditHint, AppLocalizations.of(context).setupCategoriesEditHint,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
IconButton(
onPressed: () async {
selectedWallet!.categories.add(
WalletCategory(
name: AppLocalizations.of(context)
.setupWalletNamePlaceholder,
id: selectedWallet!.nextCategoryId,
icon: IconData(
Icons.question_mark.codePoint,
fontFamily: 'MaterialIcons',
),
color: Colors.blueGrey.harmonizeWith(
Theme.of(context).colorScheme.primary,
),
),
);
await WalletManager.saveWallet(selectedWallet!);
setState(() {});
},
icon: const Icon(Icons.add),
),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.64, height: MediaQuery.of(context).size.height * 0.64,
child: ListView.builder( child: ListView.builder(
@ -134,8 +150,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
: ListTile( : ListTile(
leading: GestureDetector( leading: GestureDetector(
onTap: () async { onTap: () async {
final icon = final icon = await showIconPicker(
await FlutterIconPicker.showIconPicker(
context, context,
); );
if (icon != null) { if (icon != null) {
@ -146,7 +161,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
.getBool("useMaterialYou") ?? .getBool("useMaterialYou") ??
false; false;
if (!context.mounted) return; if (!context.mounted) return;
await showAdaptiveDialog( await showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
actions: [ actions: [
@ -158,7 +173,8 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
), ),
], ],
title: Text( title: Text(
AppLocalizations.of(context).pickColor), AppLocalizations.of(context).pickColor,
),
content: Column( content: Column(
children: [ children: [
ColorPicker( ColorPicker(
@ -214,7 +230,7 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
final controller = TextEditingController( final controller = TextEditingController(
text: selectedWallet!.categories[i].name, text: selectedWallet!.categories[i].name,
); );
showAdaptiveDialog( showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
actions: [ actions: [
@ -242,8 +258,10 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
), ),
), ),
], ],
title: Text(AppLocalizations.of(context) title: Text(
.setupCategoriesEditingName), AppLocalizations.of(context)
.setupCategoriesEditingName,
),
content: SizedBox( content: SizedBox(
width: 400, width: 400,
child: child:
@ -263,27 +281,6 @@ class _EditCategoriesViewState extends State<EditCategoriesView> {
itemCount: selectedWallet!.categories.length, itemCount: selectedWallet!.categories.length,
), ),
), ),
IconButton(
onPressed: () async {
selectedWallet!.categories.add(
WalletCategory(
name: AppLocalizations.of(context)
.setupWalletNamePlaceholder,
id: selectedWallet!.nextCategoryId,
icon: IconData(
Icons.question_mark.codePoint,
fontFamily: 'MaterialIcons',
),
color: Colors.blueGrey.harmonizeWith(
Theme.of(context).colorScheme.primary,
),
),
);
await WalletManager.saveWallet(selectedWallet!);
setState(() {});
},
icon: const Icon(Icons.add),
),
], ],
), ),
); );

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:settings_ui/settings_ui.dart'; import 'package:settings_ui/settings_ui.dart';
@ -49,11 +47,13 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
? AppLocalizations.of(context).barChart ? AppLocalizations.of(context).barChart
: AppLocalizations.of(context).lineChart, : AppLocalizations.of(context).lineChart,
), ),
onPressed: (c) => showAdaptiveDialog( onPressed: (c) => showAdaptiveDialog<void>(
context: c, context: c,
builder: (ctx) => AlertDialog.adaptive( builder: (ctx) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context).selectType), title: Text(AppLocalizations.of(context).selectType),
content: Column( content: SizedBox(
height: 80,
child: Column(
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(ctx).size.width, width: MediaQuery.of(ctx).size.width,
@ -100,6 +100,7 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
), ),
), ),
), ),
),
SettingsTile.navigation( SettingsTile.navigation(
title: Text(AppLocalizations.of(context).monthly), title: Text(AppLocalizations.of(context).monthly),
value: Text( value: Text(
@ -107,11 +108,13 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
? AppLocalizations.of(context).barChart ? AppLocalizations.of(context).barChart
: AppLocalizations.of(context).lineChart, : AppLocalizations.of(context).lineChart,
), ),
onPressed: (c) => showDialog( onPressed: (c) => showAdaptiveDialog<void>(
context: c, context: c,
builder: (ctx) => AlertDialog.adaptive( builder: (ctx) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context).selectType), title: Text(AppLocalizations.of(context).selectType),
content: Column( content: SizedBox(
height: 80,
child: Column(
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(ctx).size.width, width: MediaQuery.of(ctx).size.width,
@ -158,6 +161,7 @@ class _GraphTypeSettingsViewState extends State<GraphTypeSettingsView> {
), ),
), ),
), ),
),
], ],
), ),
], ],

View file

@ -107,7 +107,9 @@ class _SettingsViewState extends State<SettingsView> {
), ),
], ],
), ),
if (!Platform.isIOS)
SettingsSection( SettingsSection(
//! TODO: Find a replacement for iOS
title: Text(AppLocalizations.of(context).settingsData), title: Text(AppLocalizations.of(context).settingsData),
tiles: [ tiles: [
SettingsTile.navigation( SettingsTile.navigation(

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
@ -61,7 +59,7 @@ class _TessdataListViewState extends State<TessdataListView> {
final lang = _tessdata[i].keys.first; final lang = _tessdata[i].keys.first;
if (_tessdata[i][lang]!) { if (_tessdata[i][lang]!) {
// deleting data // deleting data
await showAdaptiveDialog( await showAdaptiveDialog<void>(
context: context, context: context,
builder: (context) => AlertDialog.adaptive( builder: (context) => AlertDialog.adaptive(
title: title:
@ -101,8 +99,10 @@ class _TessdataListViewState extends State<TessdataListView> {
showAdaptiveDialog( showAdaptiveDialog(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
title: Text(AppLocalizations.of(context) title: Text(
.langDownloadDialog(lang)), AppLocalizations.of(context)
.langDownloadDialog(lang),
),
content: StreamBuilder( content: StreamBuilder(
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == if (snapshot.connectionState ==
@ -152,6 +152,7 @@ class _TessdataListViewState extends State<TessdataListView> {
/// so we can show it to the user /// so we can show it to the user
Future<void> loadAllTessdata() async { Future<void> loadAllTessdata() async {
final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath()); final tessDir = Directory(await FlutterTesseractOcr.getTessdataPath());
if (!tessDir.existsSync()) tessDir.createSync(recursive: true);
final d = await TessdataApi.getAvailableData(); final d = await TessdataApi.getAvailableData();
final dataStatus = <Map<String, bool>>[]; final dataStatus = <Map<String, bool>>[];
for (final data in d) { for (final data in d) {

View file

@ -1,5 +1,3 @@
// ignore_for_file: inference_failure_on_function_invocation
import 'dart:async'; import 'dart:async';
import 'package:currency_picker/currency_picker.dart'; import 'package:currency_picker/currency_picker.dart';
@ -18,6 +16,7 @@ import 'package:prasule/pw/platformfield.dart';
import 'package:prasule/pw/platformroute.dart'; import 'package:prasule/pw/platformroute.dart';
import 'package:prasule/util/show_message.dart'; import 'package:prasule/util/show_message.dart';
import 'package:prasule/util/text_color.dart'; import 'package:prasule/util/text_color.dart';
import 'package:prasule/util/utils.dart';
import 'package:prasule/views/home.dart'; import 'package:prasule/views/home.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -50,12 +49,13 @@ class _SetupViewState extends State<SetupView> {
); );
List<WalletCategory> categories = <WalletCategory>[]; List<WalletCategory> categories = <WalletCategory>[];
String name = ""; String name = "";
double balance = 0; final _balanceController = TextEditingController(text: "0.0");
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (categories.isEmpty) { if (categories.isEmpty) {
name = AppLocalizations.of(context).setupNamePlaceholder;
categories = [ categories = [
WalletCategory( WalletCategory(
name: AppLocalizations.of(context).noCategory, name: AppLocalizations.of(context).noCategory,
@ -107,6 +107,20 @@ class _SetupViewState extends State<SetupView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(
title: Text(AppLocalizations.of(context).setup),
actions: [
Tooltip(
message: AppLocalizations.of(context).about,
child: IconButton(
onPressed: () {
showAbout(context);
},
icon: const Icon(Icons.info_outline),
),
),
],
),
body: Center( body: Center(
child: SizedBox( child: SizedBox(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -142,7 +156,7 @@ class _SetupViewState extends State<SetupView> {
name: name, name: name,
currency: _selectedCurrency, currency: _selectedCurrency,
categories: categories, categories: categories,
); starterBalance: double.parse(_balanceController.text),);
await WalletManager.saveWallet(wallet); await WalletManager.saveWallet(wallet);
if (widget.newWallet && context.mounted) { if (widget.newWallet && context.mounted) {
@ -181,15 +195,17 @@ class _SetupViewState extends State<SetupView> {
Flexible( Flexible(
child: Text( child: Text(
AppLocalizations.of(context).welcomeAboutPrasule, AppLocalizations.of(context).welcomeAboutPrasule,
textAlign: TextAlign.center,
), ),
), ),
if (!widget.newWallet) if (!widget.newWallet)
const SizedBox( const SizedBox(
height: 5, height: 8,
), ),
Flexible( Flexible(
child: Text( child: Text(
AppLocalizations.of(context).welcomeInstruction, AppLocalizations.of(context).welcomeInstruction,
textAlign: TextAlign.center,
), ),
), ),
], ],
@ -215,8 +231,10 @@ class _SetupViewState extends State<SetupView> {
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
child: PlatformField( child: PlatformField(
labelText: controller: TextEditingController(
text:
AppLocalizations.of(context).setupNamePlaceholder, AppLocalizations.of(context).setupNamePlaceholder,
),
onChanged: (t) { onChanged: (t) {
name = t; name = t;
}, },
@ -249,16 +267,16 @@ class _SetupViewState extends State<SetupView> {
keyboardType: const TextInputType.numberWithOptions( keyboardType: const TextInputType.numberWithOptions(
decimal: true, decimal: true,
), ),
controller: _balanceController,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(r'\d+[\.,]{0,1}\d{0,}'), RegExp(r'\d+[\.,]{0,1}\d{0,}'),
), ),
], ],
onChanged: (t) { prefix: Padding(
final b = double.tryParse(t); padding: const EdgeInsets.only(right: 4),
if (b == null) return; child: Text(_selectedCurrency.symbol),
balance = b; ),
},
), ),
), ),
], ],
@ -285,6 +303,32 @@ class _SetupViewState extends State<SetupView> {
AppLocalizations.of(context).setupCategoriesEditHint, AppLocalizations.of(context).setupCategoriesEditHint,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
IconButton(
onPressed: () {
var id = 0;
while (categories
.where((element) => element.id == id)
.isNotEmpty) {
id++; // create unique ID
}
categories.add(
WalletCategory(
name: AppLocalizations.of(context)
.setupWalletNamePlaceholder,
id: id,
icon: IconData(
Icons.question_mark.codePoint,
fontFamily: 'MaterialIcons',
),
color: Colors.blueGrey.harmonizeWith(
Theme.of(context).colorScheme.primary,
),
),
);
setState(() {});
},
icon: const Icon(Icons.add),
),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.64, height: MediaQuery.of(context).size.height * 0.64,
child: ListView.builder( child: ListView.builder(
@ -294,8 +338,7 @@ class _SetupViewState extends State<SetupView> {
: ListTile( : ListTile(
leading: GestureDetector( leading: GestureDetector(
onTap: () async { onTap: () async {
final icon = final icon = await showIconPicker(
await FlutterIconPicker.showIconPicker(
context, context,
); );
if (icon != null) categories[i].icon = icon; if (icon != null) categories[i].icon = icon;
@ -304,7 +347,7 @@ class _SetupViewState extends State<SetupView> {
.getBool("useMaterialYou") ?? .getBool("useMaterialYou") ??
false; false;
if (!context.mounted) return; if (!context.mounted) return;
await showAdaptiveDialog( await showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
actions: [ actions: [
@ -371,7 +414,7 @@ class _SetupViewState extends State<SetupView> {
final controller = TextEditingController( final controller = TextEditingController(
text: categories[i].name, text: categories[i].name,
); );
showAdaptiveDialog( showAdaptiveDialog<void>(
context: context, context: context,
builder: (c) => AlertDialog.adaptive( builder: (c) => AlertDialog.adaptive(
actions: [ actions: [
@ -422,32 +465,6 @@ class _SetupViewState extends State<SetupView> {
itemCount: categories.length, itemCount: categories.length,
), ),
), ),
IconButton(
onPressed: () {
var id = 0;
while (categories
.where((element) => element.id == id)
.isNotEmpty) {
id++; // create unique ID
}
categories.add(
WalletCategory(
name: AppLocalizations.of(context)
.setupWalletNamePlaceholder,
id: id,
icon: IconData(
Icons.question_mark.codePoint,
fontFamily: 'MaterialIcons',
),
color: Colors.blueGrey.harmonizeWith(
Theme.of(context).colorScheme.primary,
),
),
);
setState(() {});
},
icon: const Icon(Icons.add),
),
], ],
), ),
), ),

View file

@ -5,18 +5,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: _fe_analyzer_shared name: _fe_analyzer_shared
sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49" sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "65.0.0" version: "67.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07 sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.3.0" version: "6.4.1"
archive: archive:
dependency: "direct main" dependency: "direct main"
description: description:
@ -93,10 +93,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "7.2.11" version: "7.3.0"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -109,10 +109,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: built_value name: built_value
sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 sha256: a3ec2e0f967bc47f69f95009bb93db936288d61d5343b9436e378b28a2f830c6
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.8.1" version: "8.9.0"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -253,10 +253,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
file: file:
dependency: transitive dependency: transitive
description: description:
@ -277,10 +277,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: fl_chart name: fl_chart
sha256: fe6fec7d85975a99c73b9515a69a6e291364accfa0e4a5b3ce6de814d74b9a1c sha256: b5e2b0f13d93f8c532b5a2786bfb44580de1f50b927bf95813fa1af617e9caf8
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.66.0" version: "0.66.1"
flex_color_picker: flex_color_picker:
dependency: "direct main" dependency: "direct main"
description: description:
@ -319,10 +319,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_iconpicker name: flutter_iconpicker
sha256: a51d1c8ed5447334652d6fe6d004f1d361184d124e982762373f9be6a78a18b6 sha256: ad21bb678fd315f5c4f4eab2c9489779f818a3cbb77e20a7460d685bc44ddaf4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.2.4" version: "3.3.3"
flutter_keyboard_visibility: flutter_keyboard_visibility:
dependency: transitive dependency: transitive
description: description:
@ -438,10 +438,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: font_awesome_flutter name: font_awesome_flutter
sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08" sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.6.0" version: "10.7.0"
frontend_server_client: frontend_server_client:
dependency: transitive dependency: transitive
description: description:
@ -499,10 +499,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: image name: image
sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d" sha256: "49a0d4b0c12402853d3f227fe7c315601b238d126aa4caa5dbb2dcf99421aa4a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.1.4" version: "4.1.6"
integration_test: integration_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -632,10 +632,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: mime name: mime
sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.4" version: "1.0.5"
nested: nested:
dependency: transitive dependency: transitive
description: description:
@ -1017,6 +1017,70 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.2" version: "1.3.2"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c
url: "https://pub.dev"
source: hosted
version: "6.2.4"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f"
url: "https://pub.dev"
source: hosted
version: "6.2.2"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
url: "https://pub.dev"
source: hosted
version: "3.1.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234
url: "https://pub.dev"
source: hosted
version: "3.1.0"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f
url: "https://pub.dev"
source: hosted
version: "2.3.1"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b
url: "https://pub.dev"
source: hosted
version: "2.2.3"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
url: "https://pub.dev"
source: hosted
version: "3.1.1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -1081,6 +1145,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
wheel_chooser:
dependency: "direct main"
description:
name: wheel_chooser
sha256: "3fee36f081f321c58a0b7b4afcdd92599f2ca520b3a1420084774e6b19cca1d8"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -1106,7 +1178,7 @@ packages:
source: hosted source: hosted
version: "6.5.0" version: "6.5.0"
yaml: yaml:
dependency: transitive dependency: "direct dev"
description: description:
name: yaml name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
@ -1114,5 +1186,5 @@ packages:
source: hosted source: hosted
version: "3.1.2" version: "3.1.2"
sdks: sdks:
dart: ">=3.2.0 <4.0.0" dart: ">=3.3.0-279.1.beta <4.0.0"
flutter: ">=3.16.0" flutter: ">=3.16.0"

View file

@ -1,7 +1,7 @@
name: prasule name: prasule
description: Open-source private expense tracker description: Open-source private expense tracker
version: 1.0.0-alpha+5 version: 1.0.0+6
environment: environment:
sdk: '>=3.1.0-262.2.beta <4.0.0' sdk: '>=3.1.0-262.2.beta <4.0.0'
@ -39,6 +39,8 @@ dependencies:
path_provider: ^2.0.15 path_provider: ^2.0.15
settings_ui: ^2.0.2 settings_ui: ^2.0.2
shared_preferences: ^2.2.2 shared_preferences: ^2.2.2
url_launcher: ^6.2.4
wheel_chooser: ^1.1.2
dev_dependencies: dev_dependencies:
build_runner: ^2.4.6 build_runner: ^2.4.6
@ -56,6 +58,7 @@ dev_dependencies:
sdk: flutter sdk: flutter
test: ^1.24.6 test: ^1.24.6
very_good_analysis: ^5.1.0 very_good_analysis: ^5.1.0
yaml: ^3.1.2
flutter_launcher_icons: flutter_launcher_icons:
android: true android: true
@ -87,6 +90,7 @@ flutter:
assets: assets:
- assets/tessdata_config.json - assets/tessdata_config.json
- assets/tessdata/eng.traineddata - assets/tessdata/eng.traineddata
- assets/icon/full_ico.png
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg