Init
@@ -0,0 +1,45 @@
|
|||||||
|
# Miscellaneous
|
||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
*.pyc
|
||||||
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.build/
|
||||||
|
.buildlog/
|
||||||
|
.history
|
||||||
|
.svn/
|
||||||
|
.swiftpm/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
|
# IntelliJ related
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
|
|
||||||
|
# Flutter/Dart/Pub related
|
||||||
|
**/doc/api/
|
||||||
|
**/ios/Flutter/.last_build_id
|
||||||
|
.dart_tool/
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
.pub-cache/
|
||||||
|
.pub/
|
||||||
|
/build/
|
||||||
|
|
||||||
|
# Symbolication related
|
||||||
|
app.*.symbols
|
||||||
|
|
||||||
|
# Obfuscation related
|
||||||
|
app.*.map.json
|
||||||
|
|
||||||
|
# Android Studio will place build artifacts here
|
||||||
|
/android/app/debug
|
||||||
|
/android/app/profile
|
||||||
|
/android/app/release
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: "ea121f8859e4b13e47a8f845e4586164519588bc"
|
||||||
|
channel: "stable"
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: android
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: ios
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: linux
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: macos
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: web
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
- platform: windows
|
||||||
|
create_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
base_revision: ea121f8859e4b13e47a8f845e4586164519588bc
|
||||||
|
|
||||||
|
# User provided section
|
||||||
|
|
||||||
|
# List of Local paths (relative to this file) that should be
|
||||||
|
# ignored by the migrate tool.
|
||||||
|
#
|
||||||
|
# Files that are not part of the templates will be ignored by default.
|
||||||
|
unmanaged_files:
|
||||||
|
- 'lib/main.dart'
|
||||||
|
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# finance_app_2
|
||||||
|
|
||||||
|
A new Flutter project.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This project is a starting point for a Flutter application.
|
||||||
|
|
||||||
|
A few resources to get you started if this is your first Flutter project:
|
||||||
|
|
||||||
|
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||||
|
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||||
|
|
||||||
|
For help getting started with Flutter development, view the
|
||||||
|
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||||
|
samples, guidance on mobile development, and a full API reference.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
# The lint rules applied to this project can be customized in the
|
||||||
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||||
|
# included above or to enable additional rules. A list of all available lints
|
||||||
|
# and their documentation is published at https://dart.dev/lints.
|
||||||
|
#
|
||||||
|
# Instead of disabling a lint rule for the entire project in the
|
||||||
|
# section below, it can also be suppressed for a single line of code
|
||||||
|
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||||
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||||
|
# producing the lint.
|
||||||
|
rules:
|
||||||
|
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||||
|
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||||
|
|
||||||
|
# Additional information about this file can be found at
|
||||||
|
# https://dart.dev/guides/language/analysis-options
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
gradle-wrapper.jar
|
||||||
|
/.gradle
|
||||||
|
/captures/
|
||||||
|
/gradlew
|
||||||
|
/gradlew.bat
|
||||||
|
/local.properties
|
||||||
|
GeneratedPluginRegistrant.java
|
||||||
|
.cxx/
|
||||||
|
|
||||||
|
# Remember to never publicly share your keystore.
|
||||||
|
# See https://flutter.dev/to/reference-keystore
|
||||||
|
key.properties
|
||||||
|
**/*.keystore
|
||||||
|
**/*.jks
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
plugins {
|
||||||
|
id("com.android.application")
|
||||||
|
id("kotlin-android")
|
||||||
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||||
|
id("dev.flutter.flutter-gradle-plugin")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "ru.sanders.finance_app_2"
|
||||||
|
compileSdk = flutter.compileSdkVersion
|
||||||
|
ndkVersion = "28.1.13356709"
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
|
applicationId = "ru.sanders.finance_app_2"
|
||||||
|
// You can update the following values to match your application needs.
|
||||||
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||||
|
minSdk = flutter.minSdkVersion
|
||||||
|
targetSdk = flutter.targetSdkVersion
|
||||||
|
versionCode = flutter.versionCode
|
||||||
|
versionName = flutter.versionName
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
// TODO: Add your own signing config for the release build.
|
||||||
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flutter {
|
||||||
|
source = "../.."
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application
|
||||||
|
android:label="finance_app_2"
|
||||||
|
android:name="${applicationName}"
|
||||||
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:taskAffinity=""
|
||||||
|
android:theme="@style/LaunchTheme"
|
||||||
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
|
the Android process has started. This theme is visible to the user
|
||||||
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
|
to determine the Window background behind the Flutter UI. -->
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
|
android:resource="@style/NormalTheme"
|
||||||
|
/>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<!-- Don't delete the meta-data below.
|
||||||
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
<meta-data
|
||||||
|
android:name="flutterEmbedding"
|
||||||
|
android:value="2" />
|
||||||
|
</application>
|
||||||
|
<!-- Required to query activities that can process text, see:
|
||||||
|
https://developer.android.com/training/package-visibility and
|
||||||
|
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||||
|
|
||||||
|
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||||
|
<data android:mimeType="text/plain"/>
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package ru.sanders.finance_app_2
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity : FlutterActivity()
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="?android:colorBackground" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/white" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
||||||
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 721 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
|
||||||
|
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||||
|
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||||
|
}
|
||||||
|
subprojects {
|
||||||
|
project.evaluationDependsOn(":app")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register<Delete>("clean") {
|
||||||
|
delete(rootProject.layout.buildDirectory)
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||||
|
android.useAndroidX=true
|
||||||
|
android.enableJetifier=true
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
pluginManagement {
|
||||||
|
val flutterSdkPath = run {
|
||||||
|
val properties = java.util.Properties()
|
||||||
|
file("local.properties").inputStream().use { properties.load(it) }
|
||||||
|
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||||
|
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||||
|
flutterSdkPath
|
||||||
|
}
|
||||||
|
|
||||||
|
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||||
|
id("com.android.application") version "8.7.0" apply false
|
||||||
|
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
include(":app")
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
**/dgph
|
||||||
|
*.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
*.moved-aside
|
||||||
|
*.pbxuser
|
||||||
|
*.perspectivev3
|
||||||
|
**/*sync/
|
||||||
|
.sconsign.dblite
|
||||||
|
.tags*
|
||||||
|
**/.vagrant/
|
||||||
|
**/DerivedData/
|
||||||
|
Icon?
|
||||||
|
**/Pods/
|
||||||
|
**/.symlinks/
|
||||||
|
profile
|
||||||
|
xcuserdata
|
||||||
|
**/.generated/
|
||||||
|
Flutter/App.framework
|
||||||
|
Flutter/Flutter.framework
|
||||||
|
Flutter/Flutter.podspec
|
||||||
|
Flutter/Generated.xcconfig
|
||||||
|
Flutter/ephemeral/
|
||||||
|
Flutter/app.flx
|
||||||
|
Flutter/app.zip
|
||||||
|
Flutter/flutter_assets/
|
||||||
|
Flutter/flutter_export_environment.sh
|
||||||
|
ServiceDefinitions.json
|
||||||
|
Runner/GeneratedPluginRegistrant.*
|
||||||
|
|
||||||
|
# Exceptions to above rules.
|
||||||
|
!default.mode1v3
|
||||||
|
!default.mode2v3
|
||||||
|
!default.pbxuser
|
||||||
|
!default.perspectivev3
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>io.flutter.flutter.app</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>12.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "Generated.xcconfig"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "Generated.xcconfig"
|
||||||
@@ -0,0 +1,616 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||||
|
remoteInfo = Runner;
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
name = "Embed Frameworks";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
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>"; };
|
||||||
|
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>"; };
|
||||||
|
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>"; };
|
||||||
|
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>"; };
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; 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>"; };
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146E51CF9000F007C117D = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146EF1CF9000F007C117D /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */,
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||||
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||||
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
331C807D294A63A400263BE5 /* Sources */,
|
||||||
|
331C807F294A63A400263BE5 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = RunnerTests;
|
||||||
|
productName = RunnerTests;
|
||||||
|
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = YES;
|
||||||
|
LastUpgradeCheck = 1510;
|
||||||
|
ORGANIZATIONNAME = "";
|
||||||
|
TargetAttributes = {
|
||||||
|
331C8080294A63A400263BE5 = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D = {
|
||||||
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
|
LastSwiftMigration = 1100;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */,
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
331C807F294A63A400263BE5 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||||
|
);
|
||||||
|
name = "Thin Binary";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
|
};
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Run Script";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
331C807D294A63A400263BE5 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||||
|
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C146FB1CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = Main.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C147001CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
331C8088294A63A400263BE5 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
331C8089294A63A400263BE5 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
331C808A294A63A400263BE5 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
97C147031CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147041CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
97C147061CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147071CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
331C8088294A63A400263BE5 /* Debug */,
|
||||||
|
331C8089294A63A400263BE5 /* Release */,
|
||||||
|
331C808A294A63A400263BE5 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147031CF9000F007C117D /* Debug */,
|
||||||
|
97C147041CF9000F007C117D /* Release */,
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147061CF9000F007C117D /* Debug */,
|
||||||
|
97C147071CF9000F007C117D /* Release */,
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1510"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||||
|
BuildableName = "RunnerTests.xctest"
|
||||||
|
BlueprintName = "RunnerTests"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
enableGPUValidationMode = "1"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Profile"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
|
||||||
|
@main
|
||||||
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
|
override func application(
|
||||||
|
_ application: UIApplication,
|
||||||
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
|
) -> Bool {
|
||||||
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "1024x1024",
|
||||||
|
"idiom" : "ios-marketing",
|
||||||
|
"filename" : "Icon-App-1024x1024@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 282 B |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 704 B |
|
After Width: | Height: | Size: 406 B |
|
After Width: | Height: | Size: 586 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 762 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
@@ -0,0 +1,5 @@
|
|||||||
|
# Launch Screen Assets
|
||||||
|
|
||||||
|
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||||
|
|
||||||
|
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||||
|
</imageView>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||||
|
</constraints>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="53" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<resources>
|
||||||
|
<image name="LaunchImage" width="168" height="185"/>
|
||||||
|
</resources>
|
||||||
|
</document>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--Flutter View Controller-->
|
||||||
|
<scene sceneID="tne-QT-ifu">
|
||||||
|
<objects>
|
||||||
|
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>Finance App 2</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>finance_app_2</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIMainStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#import "GeneratedPluginRegistrant.h"
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
class RunnerTests: XCTestCase {
|
||||||
|
|
||||||
|
func testExample() {
|
||||||
|
// If you add code to the Runner application, consider adding tests here.
|
||||||
|
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'screens/expenses_screen.dart';
|
||||||
|
import 'theme/app_theme.dart';
|
||||||
|
import 'database/database.dart'; // Import the database
|
||||||
|
|
||||||
|
class MyApp extends StatefulWidget {
|
||||||
|
final AppDatabase database; // Принимаем экземпляр базы данных
|
||||||
|
|
||||||
|
const MyApp({Key? key, required this.database}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MyApp> createState() => _MyAppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyAppState extends State<MyApp> {
|
||||||
|
// Состояние для управления темой (светлая/темная)
|
||||||
|
bool _isDarkMode = false;
|
||||||
|
|
||||||
|
// Метод для переключения темы
|
||||||
|
void toggleTheme() {
|
||||||
|
setState(() {
|
||||||
|
_isDarkMode = !_isDarkMode;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
title: 'Finance App', // Обновленный заголовок
|
||||||
|
debugShowCheckedModeBanner: false, // Скрыть баннер Debug
|
||||||
|
themeMode: _isDarkMode ? ThemeMode.dark : ThemeMode.light, // Управление темой
|
||||||
|
theme: AppTheme.lightTheme, // Светлая тема
|
||||||
|
darkTheme: AppTheme.darkTheme, // Темная тема
|
||||||
|
home: ExpensesScreen(
|
||||||
|
database: widget.database, // Передаем базу данных в главный экран
|
||||||
|
toggleTheme: toggleTheme, // Передаем функцию переключения темы
|
||||||
|
isDarkMode: _isDarkMode, // Передаем текущее состояние темы
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,432 @@
|
|||||||
|
// ignore_for_file: unused_import // Часто генерируется при условном импорте
|
||||||
|
|
||||||
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:async/async.dart';
|
||||||
|
import 'package:flutter/material.dart' as c; // Use alias 'c' for flutter material
|
||||||
|
// Условный импорт бэкенда базы данных
|
||||||
|
// Выбирает реализацию connect() в зависимости от платформы
|
||||||
|
import 'database_connection/connection.dart' // Базовый импорт
|
||||||
|
if (dart.library.html) 'database_connection/connection_web.dart' // Для Веб
|
||||||
|
if (dart.library.io) 'database_connection/connection_native.dart'; // Для Нативных платформ (Android, iOS, Desktop)
|
||||||
|
|
||||||
|
// Импортируем модель категории для возвращаемого типа и утилиты
|
||||||
|
import '../models/category.dart';
|
||||||
|
import '../utils/category_utils.dart'; // Helper for category details
|
||||||
|
|
||||||
|
// Эта строка указывает Drift сгенерировать файл database.g.dart
|
||||||
|
part 'database.g.dart';
|
||||||
|
|
||||||
|
// Enum for transaction type (used internally and potentially externally)
|
||||||
|
enum TransactionType { income, expense }
|
||||||
|
|
||||||
|
// Определение таблицы Categories
|
||||||
|
// ИСПРАВЛЕНО: Имя класса таблицы изменено на Categories для ясности
|
||||||
|
@DataClassName('CategoryDb')
|
||||||
|
class Categories extends Table { // Changed class name to plural 'Categories'
|
||||||
|
IntColumn get id => integer().autoIncrement()();
|
||||||
|
TextColumn get name => text().unique()();
|
||||||
|
TextColumn get icon => text()(); // Store icon name (e.g., 'shopping_cart_outlined')
|
||||||
|
IntColumn get color => integer()(); // Store color value (e.g., Colors.green.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Определение таблицы Transactions
|
||||||
|
// Имя таблицы в SQL будет 'transactions' (snake_case от имени класса)
|
||||||
|
@DataClassName('Transaction') // Keep the generated class name as Transaction
|
||||||
|
class Transactions extends Table {
|
||||||
|
IntColumn get id => integer().autoIncrement()(); // Primary key
|
||||||
|
TextColumn get categoryName => text().named('category_name')(); // Имя категории (или 'Income')
|
||||||
|
RealColumn get amount => real()(); // Сумма транзакции
|
||||||
|
DateTimeColumn get date => dateTime()(); // Дата транзакции
|
||||||
|
TextColumn get merchant => text().named('merchant')(); // Название продавца/источника
|
||||||
|
// ИСПРАВЛЕНО: Добавлено .withDefault() для значения по умолчанию
|
||||||
|
TextColumn get type => text().named('type').withDefault(const Constant('expense'))(); // Тип транзакции ('income' или 'expense')
|
||||||
|
}
|
||||||
|
|
||||||
|
// Класс базы данных
|
||||||
|
// Аннотация @DriftDatabase указывает Drift сгенерировать код для этой базы данных
|
||||||
|
@DriftDatabase(tables: [Categories, Transactions]) // Updated table name here
|
||||||
|
class AppDatabase extends _$AppDatabase {
|
||||||
|
// Используем функцию connect() из условного импорта для создания соединения
|
||||||
|
// Во время компиляции будет выбрана правильная реализация connect()
|
||||||
|
// из connection_web.dart или connection_native.dart.
|
||||||
|
AppDatabase() : super(connect());
|
||||||
|
|
||||||
|
// Версия схемы. Увеличивайте при изменении структуры таблиц.
|
||||||
|
@override
|
||||||
|
int get schemaVersion => 4; // Increased version due to adding Categories table
|
||||||
|
|
||||||
|
@override
|
||||||
|
MigrationStrategy get migration => MigrationStrategy(
|
||||||
|
onCreate: (m) async {
|
||||||
|
await m.createAll();
|
||||||
|
// Вставляем начальные данные ТОЛЬКО при создании базы данных
|
||||||
|
print("Database created. Inserting initial data...");
|
||||||
|
// ИЗМЕНЕНО: Вызов insertInitialDataIfNeeded теперь только здесь
|
||||||
|
await insertInitialDataIfNeeded();
|
||||||
|
},
|
||||||
|
onUpgrade: (m, from, to) async {
|
||||||
|
// Drift автоматически обработает добавление новых таблиц (Categories)
|
||||||
|
// при обновлении до версии 4.
|
||||||
|
// Нам нужно только обработать специфичные изменения, как добавление колонки type.
|
||||||
|
if (from < 4) { // Check if upgrading from a version before 4
|
||||||
|
// Check if the 'type' column exists before trying to add it
|
||||||
|
// This requires a more complex check, usually involving inspecting the schema.
|
||||||
|
// For simplicity, we assume if version is < 4, the column might be missing.
|
||||||
|
// A safer approach involves querying PRAGMA table_info(transactions);
|
||||||
|
// However, Drift's default migration handles adding columns well.
|
||||||
|
// Let's ensure the Categories table is created if upgrading from very old versions.
|
||||||
|
await m.createTable(categories); // Ensure categories table exists
|
||||||
|
// Add the 'type' column if it doesn't exist (Drift might handle this, but explicit is safer)
|
||||||
|
// We'll rely on Drift's default behavior for adding the column here.
|
||||||
|
// If specific default values or constraints were needed during upgrade,
|
||||||
|
// more complex logic would be required.
|
||||||
|
}
|
||||||
|
if (from == 1) {
|
||||||
|
// Example: If migrating specifically from 1, maybe add the type column
|
||||||
|
// await m.addColumn(transactions, transactions.type);
|
||||||
|
// But the check `from < 4` above is more general if relying on Drift's auto-migration.
|
||||||
|
}
|
||||||
|
// Add more migration steps for future versions here
|
||||||
|
// if (from < 5) { ... }
|
||||||
|
|
||||||
|
// ИЗМЕНЕНО: Удален вызов insertInitialDataIfNeeded отсюда
|
||||||
|
// Не нужно вставлять начальные данные при обновлении существующей БД.
|
||||||
|
},
|
||||||
|
beforeOpen: (details) async {
|
||||||
|
// ИЗМЕНЕНО: Удален вызов insertInitialDataIfNeeded отсюда
|
||||||
|
// Логика вставки начальных данных теперь полностью в onCreate.
|
||||||
|
if (details.wasCreated) {
|
||||||
|
print("Database was created. Initial data should have been inserted via onCreate.");
|
||||||
|
} else {
|
||||||
|
print("Opening existing database version ${details.versionNow}.");
|
||||||
|
}
|
||||||
|
// Можно добавить здесь другие проверки или настройки при открытии, если нужно.
|
||||||
|
return Future.value(); // beforeOpen должен возвращать Future<void>
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// --- Методы для работы с транзакциями ---
|
||||||
|
|
||||||
|
// Получить все транзакции в виде потока, упорядоченные по дате (сначала новые)
|
||||||
|
// Возвращает non-nullable Stream<List<Transaction>> (Transaction - сгенерированный Drift класс)
|
||||||
|
Stream<List<Transaction>> watchAllTransactions() {
|
||||||
|
return (select(transactions)
|
||||||
|
..orderBy([(t) => OrderingTerm(expression: t.date, mode: OrderingMode.desc)]))
|
||||||
|
.watch();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Получить транзакции, отфильтрованные по категории РАСХОДОВ, в виде потока
|
||||||
|
// Если categoryName == 'All', возвращает ВСЕ транзакции (и доходы, и расходы)
|
||||||
|
// Возвращает non-nullable Stream<List<Transaction>> (Transaction - сгенерированный Drift класс)
|
||||||
|
Stream<List<Transaction>> watchFilteredTransactions(String categoryName) {
|
||||||
|
if (categoryName == 'All') {
|
||||||
|
// watchAllTransactions теперь возвращает non-nullable Stream
|
||||||
|
return watchAllTransactions(); // Return all types if filter is 'All'
|
||||||
|
}
|
||||||
|
// Otherwise, filter by the provided category name AND ensure it's an expense
|
||||||
|
return (select(transactions)
|
||||||
|
..where((t) => t.categoryName.equals(categoryName) & t.type.equals('expense'))
|
||||||
|
..orderBy([(t) => OrderingTerm(expression: t.date, mode: OrderingMode.desc)]))
|
||||||
|
.watch();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Добавить новую транзакцию
|
||||||
|
// Принимает TransactionsCompanion - сгенерированный Drift класс (должен включать type)
|
||||||
|
Future<int> addTransaction(TransactionsCompanion entry) {
|
||||||
|
// Убедимся, что тип указан
|
||||||
|
assert(entry.type.present && (entry.type.value == 'income' || entry.type.value == 'expense'));
|
||||||
|
// Убедимся, что для дохода используется специальная категория
|
||||||
|
if (entry.type.value == 'income') {
|
||||||
|
assert(entry.categoryName.present && entry.categoryName.value == 'Income');
|
||||||
|
}
|
||||||
|
return into(transactions).insert(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновить существующую транзакцию
|
||||||
|
// Принимает TransactionsCompanion, который должен содержать ID
|
||||||
|
// Возвращает true, если обновление прошло успешно
|
||||||
|
Future<bool> updateTransaction(TransactionsCompanion entry) {
|
||||||
|
// Проверяем, что ID предоставлен для обновления
|
||||||
|
assert(entry.id.present);
|
||||||
|
// Убедимся, что тип указан
|
||||||
|
assert(entry.type.present && (entry.type.value == 'income' || entry.type.value == 'expense'));
|
||||||
|
// Убедимся, что для дохода используется специальная категория
|
||||||
|
if (entry.type.value == 'income') {
|
||||||
|
assert(entry.categoryName.present && entry.categoryName.value == 'Income');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Используем .replace() для обновления записи по ID
|
||||||
|
// replace возвращает true, если запись была обновлена (найдена по ID)
|
||||||
|
return update(transactions).replace(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Удалить транзакцию по ID
|
||||||
|
// Возвращает количество удаленных строк (0 или 1)
|
||||||
|
Future<int> deleteTransaction(int id) {
|
||||||
|
// Используем .delete() с условием where
|
||||||
|
return (delete(transactions)..where((t) => t.id.equals(id))).go();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// --- Методы для работы с категориями ---
|
||||||
|
|
||||||
|
// Получить все категории в виде потока, упорядоченные по имени
|
||||||
|
// Возвращает Stream<List<CategoryDb>> (CategoryDb - сгенерированный Drift класс)
|
||||||
|
Stream<List<CategoryDb>> watchAllCategoriesDb() {
|
||||||
|
return (select(categories)..orderBy([(c) => OrderingTerm(expression: c.name)])).watch();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Добавить новую категорию
|
||||||
|
// Принимает CategoriesCompanion (сгенерированный Drift)
|
||||||
|
// Возвращает ID вставленной категории
|
||||||
|
Future<int> addCategory(CategoriesCompanion entry) {
|
||||||
|
// Проверяем, что имя, иконка и цвет предоставлены
|
||||||
|
assert(entry.name.present && entry.name.value.isNotEmpty);
|
||||||
|
assert(entry.icon.present); // Icon can be empty string if needed
|
||||||
|
assert(entry.color.present);
|
||||||
|
// Не позволяем добавить категорию с именем 'Income' (case-insensitive)
|
||||||
|
assert(entry.name.value.toLowerCase() != 'income');
|
||||||
|
return into(categories).insert(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Обновить существующую категорию
|
||||||
|
// Принимает CategoriesCompanion, который должен содержать ID
|
||||||
|
// Возвращает true, если обновление прошло успешно
|
||||||
|
Future<bool> updateCategory(CategoriesCompanion entry) {
|
||||||
|
// Проверяем, что ID предоставлен для обновления
|
||||||
|
assert(entry.id.present);
|
||||||
|
// Проверяем, что имя не 'Income' (case-insensitive)
|
||||||
|
if (entry.name.present && entry.name.value.toLowerCase() == 'income') {
|
||||||
|
print("Error: Cannot rename category to 'Income'.");
|
||||||
|
return Future.value(false); // Запрещаем переименование в 'Income'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Используем транзакцию для проверки и обновления
|
||||||
|
return transaction(() async {
|
||||||
|
// Находим категорию по ID перед обновлением
|
||||||
|
final existingCategory = await (select(categories)..where((c) => c.id.equals(entry.id.value))).getSingleOrNull();
|
||||||
|
|
||||||
|
// Проверяем, существует ли категория и не является ли она 'Income'
|
||||||
|
if (existingCategory == null) {
|
||||||
|
print("Error: Category with ID ${entry.id.value} not found for update.");
|
||||||
|
return false; // Категория не найдена
|
||||||
|
}
|
||||||
|
if (existingCategory.name == 'Income') {
|
||||||
|
print("Error: Cannot update the 'Income' category.");
|
||||||
|
return false; // Запрещаем обновление категории 'Income'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Выполняем обновление
|
||||||
|
// Метод replace возвращает true, если запись была обновлена
|
||||||
|
final updated = await update(categories).replace(entry);
|
||||||
|
|
||||||
|
// Если имя категории было изменено, нужно обновить categoryName во всех связанных транзакциях
|
||||||
|
if (updated && entry.name.present && entry.name.value != existingCategory.name) {
|
||||||
|
print("Category name changed from '${existingCategory.name}' to '${entry.name.value}'. Updating transactions...");
|
||||||
|
final updatedTransactions = await (update(transactions)
|
||||||
|
..where((t) => t.categoryName.equals(existingCategory.name)))
|
||||||
|
.write(TransactionsCompanion(
|
||||||
|
categoryName: Value(entry.name.value),
|
||||||
|
));
|
||||||
|
print("Updated $updatedTransactions transactions with the new category name.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return updated; // Возвращаем результат replace
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Удалить категорию по ID
|
||||||
|
// Возвращает количество удаленных строк (0 или 1)
|
||||||
|
Future<int> deleteCategory(int id) {
|
||||||
|
// Используем транзакцию для проверок и удаления
|
||||||
|
return transaction(() async {
|
||||||
|
// Находим категорию по ID перед удалением
|
||||||
|
final categoryToDelete = await (select(categories)..where((c) => c.id.equals(id))).getSingleOrNull();
|
||||||
|
|
||||||
|
// Проверяем, существует ли категория
|
||||||
|
if (categoryToDelete == null) {
|
||||||
|
print("Error: Category with ID $id not found for deletion.");
|
||||||
|
return 0; // Категория не найдена
|
||||||
|
}
|
||||||
|
|
||||||
|
// Запрещаем удаление категории 'Income'
|
||||||
|
if (categoryToDelete.name == 'Income') {
|
||||||
|
print("Error: Cannot delete the 'Income' category.");
|
||||||
|
return 0; // Возвращаем 0, т.к. ничего не удалено
|
||||||
|
}
|
||||||
|
|
||||||
|
// Проверяем, есть ли транзакции с этой категорией
|
||||||
|
// Используем имя категории для связи (т.к. нет внешнего ключа)
|
||||||
|
final query = selectOnly(transactions)
|
||||||
|
..addColumns([transactions.id.count()])
|
||||||
|
..where(transactions.categoryName.equals(categoryToDelete.name)); // Используем имя для связи
|
||||||
|
|
||||||
|
final result = await query.getSingleOrNull();
|
||||||
|
final transactionCount = result?.read(transactions.id.count()) ?? 0;
|
||||||
|
|
||||||
|
if (transactionCount > 0) {
|
||||||
|
print("Error: Cannot delete category '${categoryToDelete.name}' because it has $transactionCount associated transaction(s).");
|
||||||
|
// Можно выбросить исключение или вернуть 0, чтобы показать неудачу
|
||||||
|
// throw Exception("Cannot delete category with transactions.");
|
||||||
|
return 0; // Не удаляем, возвращаем 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Если транзакций нет, удаляем категорию
|
||||||
|
print("Deleting category '${categoryToDelete.name}' (ID: $id)...");
|
||||||
|
final deletedRows = await (delete(categories)..where((c) => c.id.equals(id))).go();
|
||||||
|
print("Deleted $deletedRows category row(s).");
|
||||||
|
return deletedRows; // Возвращаем количество удаленных строк
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Получить категорию по ID (если нужно)
|
||||||
|
Future<CategoryDb?> getCategoryById(int id) {
|
||||||
|
return (select(categories)..where((c) => c.id.equals(id))).getSingleOrNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Методы для агрегации и отчетов ---
|
||||||
|
|
||||||
|
// Вычислить и наблюдать за общими суммами по категориям РАСХОДОВ
|
||||||
|
// Возвращает Stream<List<Category>> где Category - это класс модели из '../models/category.dart'
|
||||||
|
Stream<List<Category>> calculateCategoryTotals() {
|
||||||
|
// 1. Создаем поток, который объединяет транзакции и категории
|
||||||
|
final transactionsStream = watchAllTransactions();
|
||||||
|
final categoriesStream = watchAllCategoriesDb();
|
||||||
|
|
||||||
|
// Используем StreamZip для объединения последних данных из обоих потоков
|
||||||
|
return StreamZip([transactionsStream, categoriesStream]).map((data) {
|
||||||
|
final transactionList = data[0] as List<Transaction>;
|
||||||
|
final categoryList = data[1] as List<CategoryDb>;
|
||||||
|
|
||||||
|
// Создаем Map для быстрого доступа к деталям категории по имени
|
||||||
|
final categoryDetailsMap = {
|
||||||
|
for (var cat in categoryList) cat.name: cat
|
||||||
|
};
|
||||||
|
|
||||||
|
// 2. Фильтруем только расходы и группируем по categoryName, суммируя amount
|
||||||
|
final categoryTotals = <String, double>{};
|
||||||
|
for (var transaction in transactionList) {
|
||||||
|
// Суммируем только расходы (исключая 'Income')
|
||||||
|
if (transaction.type == 'expense') {
|
||||||
|
categoryTotals.update(
|
||||||
|
transaction.categoryName,
|
||||||
|
(value) => value + transaction.amount,
|
||||||
|
ifAbsent: () => transaction.amount,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. Преобразуем сгруппированные данные в список объектов Category (модель UI)
|
||||||
|
return categoryTotals.entries.map((entry) {
|
||||||
|
final categoryName = entry.key;
|
||||||
|
final totalAmount = entry.value;
|
||||||
|
// Получаем детали категории из Map (или используем дефолтные, если категория была удалена)
|
||||||
|
final categoryDb = categoryDetailsMap[categoryName];
|
||||||
|
final iconData = CategoryUtils.getIconFromString(categoryDb?.icon); // Используем утилиту
|
||||||
|
final colorData = categoryDb != null ? c.Color(categoryDb.color) : c.Colors.grey.shade500; // Цвет из БД или дефолтный
|
||||||
|
|
||||||
|
return Category( // Это Category из models/category.dart
|
||||||
|
categoryName,
|
||||||
|
totalAmount,
|
||||||
|
colorData,
|
||||||
|
iconData,
|
||||||
|
);
|
||||||
|
}).toList()
|
||||||
|
// Сортируем категории по сумме (от большей к меньшей)
|
||||||
|
..sort((a, b) => b.amount.compareTo(a.amount));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Вычислить и наблюдать за общей суммой ДОХОДОВ
|
||||||
|
Stream<double> watchTotalIncome() {
|
||||||
|
// Создаем выражение для суммы amount
|
||||||
|
final amountSum = transactions.amount.sum();
|
||||||
|
// Строим запрос: выбрать сумму amount из transactions, где type = 'income'
|
||||||
|
final query = selectOnly(transactions)
|
||||||
|
..addColumns([amountSum])
|
||||||
|
..where(transactions.type.equals('income'));
|
||||||
|
|
||||||
|
// Выполняем запрос и наблюдаем за изменениями
|
||||||
|
// map преобразует результат (единственную строку с суммой) в double
|
||||||
|
// ?? 0.0 обрабатывает случай, когда доходов нет (сумма будет null)
|
||||||
|
return query.watchSingleOrNull().map((result) => result?.read(amountSum) ?? 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Вычислить и наблюдать за общей суммой РАСХОДОВ (альтернатива суммированию категорий)
|
||||||
|
Stream<double> watchTotalExpenses() {
|
||||||
|
final amountSum = transactions.amount.sum();
|
||||||
|
final query = selectOnly(transactions)
|
||||||
|
..addColumns([amountSum])
|
||||||
|
..where(transactions.type.equals('expense'));
|
||||||
|
return query.watchSingleOrNull().map((result) => result?.read(amountSum) ?? 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Добавление начальных данных (вызывается только из onCreate)
|
||||||
|
// ИЗМЕНЕНО: Убран необязательный параметр isCreating, т.к. вызывается только при создании
|
||||||
|
Future<void> insertInitialDataIfNeeded() async {
|
||||||
|
// Проверяем, есть ли уже категории (на всякий случай, хотя в onCreate их быть не должно)
|
||||||
|
final categoriesCountResult = await (selectOnly(categories)..addColumns([categories.id.count()])).getSingleOrNull();
|
||||||
|
final categoriesCount = categoriesCountResult?.read(categories.id.count()) ?? 0;
|
||||||
|
|
||||||
|
if (categoriesCount == 0) {
|
||||||
|
print("Inserting initial categories...");
|
||||||
|
// Получаем доступные цвета из CategoryUtils
|
||||||
|
final availableColors = CategoryUtils.availableColors;
|
||||||
|
|
||||||
|
await batch((batch) {
|
||||||
|
batch.insertAll(categories, [
|
||||||
|
// Используем CategoriesCompanion (сгенерированный для таблицы Categories)
|
||||||
|
// Используем реальные имена иконок Material Icons и конкретные значения цветов из списка
|
||||||
|
CategoriesCompanion.insert(name: 'Groceries', icon: 'shopping_cart_outlined', color: availableColors[0].value), // Red
|
||||||
|
CategoriesCompanion.insert(name: 'Subscriptions', icon: 'subscriptions_outlined', color: availableColors[4].value), // Indigo
|
||||||
|
CategoriesCompanion.insert(name: 'Restaurant', icon: 'restaurant_menu_outlined', color: availableColors[14].value), // Orange
|
||||||
|
CategoriesCompanion.insert(name: 'Shopping', icon: 'shopping_bag_outlined', color: availableColors[5].value), // Blue
|
||||||
|
CategoriesCompanion.insert(name: 'Transport', icon: 'directions_bus_filled_outlined', color: availableColors[2].value), // Purple
|
||||||
|
CategoriesCompanion.insert(name: 'Travel', icon: 'flight_takeoff_outlined', color: availableColors[7].value), // Cyan
|
||||||
|
CategoriesCompanion.insert(name: 'Utilities', icon: 'home_outlined', color: availableColors[8].value), // Teal
|
||||||
|
// 'Income' category - use a specific icon and color (можно тоже взять из списка или оставить уникальный)
|
||||||
|
// Оставим уникальный цвет для Income для выделения
|
||||||
|
CategoriesCompanion.insert(name: 'Income', icon: 'attach_money', color: c.Colors.lightGreenAccent.shade700.value),
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
print("Initial categories inserted.");
|
||||||
|
} else {
|
||||||
|
// Эта ветка не должна выполняться при вызове из onCreate, но оставим для отладки
|
||||||
|
print("Categories table already contains data ($categoriesCount categories). Skipping initial category insertion.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Проверяем, есть ли уже транзакции (аналогично, не должно быть в onCreate)
|
||||||
|
final countResult = await (selectOnly(transactions)..addColumns([transactions.id.count()])).getSingleOrNull();
|
||||||
|
final transactionCount = countResult?.read(transactions.id.count()) ?? 0;
|
||||||
|
|
||||||
|
// Вставляем данные только если таблица транзакций пуста
|
||||||
|
if (transactionCount == 0) {
|
||||||
|
print("Inserting initial transactions...");
|
||||||
|
// Используем batch для эффективной вставки нескольких записей
|
||||||
|
await batch((batch) {
|
||||||
|
batch.insertAll(transactions, [
|
||||||
|
// Используем TransactionsCompanion для создания записей для вставки
|
||||||
|
// Поле type будет 'expense' по умолчанию из-за .withDefault() в определении колонки
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Groceries', amount: 45.99, date: DateTime.now().subtract(const Duration(days: 1, hours: 2)), merchant: 'Whole Foods Market'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Subscriptions', amount: 39.99, date: DateTime.now().subtract(const Duration(days: 2, hours: 5)), merchant: 'Netflix Premium'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Restaurant', amount: 78.50, date: DateTime.now().subtract(const Duration(days: 2, hours: 19)), merchant: 'Italian Corner'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Shopping', amount: 132.75, date: DateTime.now().subtract(const Duration(days: 3, hours: 11)), merchant: 'Apple Store'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Groceries', amount: 23.45, date: DateTime.now().subtract(const Duration(days: 4, hours: 9)), merchant: 'Local Market'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Transport', amount: 15.00, date: DateTime.now().subtract(const Duration(days: 5, hours: 8)), merchant: 'City Bus'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Restaurant', amount: 56.80, date: DateTime.now().subtract(const Duration(days: 5, hours: 20)), merchant: 'Sushi Express'),
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Utilities', amount: 85.20, date: DateTime.now().subtract(const Duration(days: 6, hours: 10)), merchant: 'Electricity Bill'), // Example: Added Utilities transaction
|
||||||
|
// Пример дохода - здесь нужно явно указать type: 'income'
|
||||||
|
TransactionsCompanion.insert(categoryName: 'Income', amount: 1200.00, date: DateTime.now().subtract(const Duration(days: 7, hours: 9)), merchant: 'Salary', type: Value('income')),
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
print("Initial transactions inserted successfully.");
|
||||||
|
} else {
|
||||||
|
// Эта ветка не должна выполняться при вызове из onCreate
|
||||||
|
print("Transactions table already contains data ($transactionCount transactions). Skipping initial transaction insertion.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// lib/database/database_connection/connection.dart
|
||||||
|
import 'package:drift/drift.dart';
|
||||||
|
|
||||||
|
// Этот файл служит базой для условного импорта.
|
||||||
|
// Реализации находятся в connection_web.dart и connection_native.dart.
|
||||||
|
|
||||||
|
// Определим функцию-заглушку, чтобы основной файл database.dart
|
||||||
|
// мог ее импортировать без ошибок анализатора.
|
||||||
|
// Во время выполнения будет вызвана реализация из соответствующего
|
||||||
|
// файла (web или native) благодаря условному импорту.
|
||||||
|
QueryExecutor connect() => throw UnsupportedError(
|
||||||
|
'Stub connect function should not be called. Ensure conditional imports are set up correctly.');
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// lib/database/database_connection/connection_native.dart
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:drift/native.dart';
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
|
// sqlite3_flutter_libs и sqlite3 импортируются для возможной тонкой настройки,
|
||||||
|
// но часто NativeDatabase справляется автоматически.
|
||||||
|
// import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
||||||
|
// import 'package:sqlite3/sqlite3.dart';
|
||||||
|
|
||||||
|
QueryExecutor connect() {
|
||||||
|
print("Connecting to database using NativeDatabase (Lazy)");
|
||||||
|
// Используем LazyDatabase для отложенной инициализации на нативных платформах
|
||||||
|
return LazyDatabase(() async {
|
||||||
|
// Получаем папку для хранения документов приложения
|
||||||
|
final dbFolder = await getApplicationDocumentsDirectory();
|
||||||
|
// Создаем путь к файлу 'db.sqlite' в этой папке
|
||||||
|
final file = File(p.join(dbFolder.path, 'db.sqlite'));
|
||||||
|
print("Database file path (Native): ${file.path}"); // Логируем путь для отладки
|
||||||
|
|
||||||
|
// Настройка библиотеки sqlite3 (обычно не требуется для Android/iOS/macOS с sqlite3_flutter_libs)
|
||||||
|
// if (Platform.isWindows || Platform.isLinux) {
|
||||||
|
// // Может потребоваться дополнительная настройка для Desktop
|
||||||
|
// // await applyWorkaroundToOpenSqlite3Library();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Используем NativeDatabase для открытия соединения
|
||||||
|
// logStatements: true полезен для отладки SQL-запросов
|
||||||
|
return NativeDatabase(file, logStatements: false);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// lib/database/database_connection/connection_web.dart
|
||||||
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:drift/web.dart';
|
||||||
|
// import 'package:drift/wasm.dart'; // <-- Удалить этот импорт, он больше не нужен здесь
|
||||||
|
|
||||||
|
QueryExecutor connect() {
|
||||||
|
print("Connecting to database using WebDatabase (default configuration)");
|
||||||
|
|
||||||
|
// Используем стандартный конструктор WebDatabase.
|
||||||
|
// Drift попытается автоматически найти и загрузить sqlite3.wasm по пути /sqlite3.wasm
|
||||||
|
return WebDatabase(
|
||||||
|
'db', // Имя базы данных в IndexedDB
|
||||||
|
logStatements: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/foundation.dart'; // Для kIsWeb
|
||||||
|
// import 'package:drift/wasm.dart'; // <-- Удалить этот импорт
|
||||||
|
import 'app.dart'; // Import the new app root widget
|
||||||
|
import 'database/database.dart'; // Import the database
|
||||||
|
|
||||||
|
Future<void> main() async {
|
||||||
|
// Необходимо для асинхронных операций перед runApp, например, инициализации БД
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
// --- Удалить весь этот блок ---
|
||||||
|
// // Инициализация WASM-модуля SQLite для веб-платформы
|
||||||
|
// if (kIsWeb) {
|
||||||
|
// print("Running on Web, attempting to initialize sqlite3.wasm...");
|
||||||
|
// // Указываем Drift, где найти файл sqlite3.wasm.
|
||||||
|
// // WasmDatabase.resolveFile попытается найти его автоматически (обычно в корне /sqlite3.wasm).
|
||||||
|
// final result = await WasmDatabase.resolveFile('sqlite3.wasm'); // <-- Ошибка здесь
|
||||||
|
//
|
||||||
|
// if (result.isSuccessful) {
|
||||||
|
// print("sqlite3.wasm loaded successfully.");
|
||||||
|
// } else {
|
||||||
|
// // Если файл не найден или произошла ошибка загрузки
|
||||||
|
// print("Error loading sqlite3.wasm: ${result.errorMessage}");
|
||||||
|
// // Здесь можно предпринять действия, если загрузка не удалась,
|
||||||
|
// // например, показать сообщение об ошибке пользователю или использовать
|
||||||
|
// // альтернативное хранилище. Пока просто выводим ошибку в консоль.
|
||||||
|
// // Приложение может не работать корректно без базы данных.
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// print("Running on Native platform, skipping WASM initialization.");
|
||||||
|
// }
|
||||||
|
// --- Конец удаляемого блока ---
|
||||||
|
|
||||||
|
|
||||||
|
// Создаем единственный экземпляр базы данных для всего приложения
|
||||||
|
// WebDatabase (вызываемый через connect() на вебе) должен сам справиться с WASM
|
||||||
|
final database = AppDatabase();
|
||||||
|
|
||||||
|
// Опционально: Вставляем начальные данные, если база данных пуста
|
||||||
|
// Это полезно для первого запуска или демонстрации
|
||||||
|
// Делаем это после создания экземпляра БД
|
||||||
|
await database.insertInitialDataIfNeeded();
|
||||||
|
|
||||||
|
// Запускаем приложение, передавая экземпляр базы данных
|
||||||
|
runApp(MyApp(database: database));
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Category {
|
||||||
|
final String name;
|
||||||
|
final double amount;
|
||||||
|
final Color colorCode;
|
||||||
|
final IconData iconCode;
|
||||||
|
|
||||||
|
Category(this.name, this.amount, this.colorCode, this.iconCode);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'category.dart';
|
||||||
|
|
||||||
|
class TransactionRecord {
|
||||||
|
final int id;
|
||||||
|
final String type; // 'income' or 'expense'
|
||||||
|
final double amount;
|
||||||
|
final Category? category; // Reference to category (null for income)
|
||||||
|
final DateTime date;
|
||||||
|
final String merchant;
|
||||||
|
|
||||||
|
TransactionRecord({
|
||||||
|
required this.id,
|
||||||
|
required this.type,
|
||||||
|
required this.amount,
|
||||||
|
this.category,
|
||||||
|
required this.date,
|
||||||
|
required this.merchant,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Removed the hardcoded id getter
|
||||||
|
// get id => 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ProfileScreen extends StatelessWidget {
|
||||||
|
const ProfileScreen({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Profile'),
|
||||||
|
centerTitle: true,
|
||||||
|
leading: IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Hero(
|
||||||
|
tag: 'profileAvatar', // Tag must match the one in ExpensesScreen
|
||||||
|
child: Material( // Wrap with Material for Hero animation
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: CircleAvatar(
|
||||||
|
radius: 50,
|
||||||
|
backgroundColor: isDark ? Colors.green.shade800 : Colors.green.shade100,
|
||||||
|
child: const Icon(
|
||||||
|
Icons.person,
|
||||||
|
size: 50,
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
Text(
|
||||||
|
'John Doe',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isDark ? Colors.white : Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
'john.doe@example.com',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color: isDark ? Colors.grey.shade400 : Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 32),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: isDark ? Colors.green.shade700 : Colors.green,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 12),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: const Text('Edit Profile'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../database/database.dart' as db;
|
||||||
|
import 'settings_screen.dart'; // Импортируем переименованный экран
|
||||||
|
|
||||||
|
class SettingsMenuScreen extends StatelessWidget {
|
||||||
|
final db.AppDatabase database;
|
||||||
|
|
||||||
|
const SettingsMenuScreen({Key? key, required this.database}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Настройки'),
|
||||||
|
centerTitle: true,
|
||||||
|
backgroundColor: theme.appBarTheme.backgroundColor,
|
||||||
|
elevation: theme.appBarTheme.elevation,
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
|
children: [
|
||||||
|
// Опция "Редактирование категорий"
|
||||||
|
ListTile(
|
||||||
|
leading: CircleAvatar(
|
||||||
|
radius: 22,
|
||||||
|
backgroundColor: theme.colorScheme.primary.withOpacity(0.15),
|
||||||
|
child: Icon(Icons.category_outlined, color: theme.colorScheme.primary, size: 24),
|
||||||
|
),
|
||||||
|
title: Text('Редактирование категорий', style: theme.textTheme.titleMedium),
|
||||||
|
trailing: Icon(Icons.arrow_forward_ios, size: 18, color: theme.colorScheme.onSurface.withOpacity(0.6)),
|
||||||
|
onTap: () {
|
||||||
|
// Переход на экран редактирования категорий
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => CategorySettingsScreen(database: database),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// Добавьте другие опции настроек здесь в будущем
|
||||||
|
// ListTile(...),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:drift/drift.dart' show Value;
|
||||||
|
import '../database/database.dart' as db;
|
||||||
|
import '../utils/category_utils.dart';
|
||||||
|
import '../widgets/edit_category_dialog.dart'; // Импортируем диалог
|
||||||
|
|
||||||
|
// Переименован класс SettingsScreen в CategorySettingsScreen
|
||||||
|
class CategorySettingsScreen extends StatefulWidget {
|
||||||
|
final db.AppDatabase database;
|
||||||
|
|
||||||
|
const CategorySettingsScreen({Key? key, required this.database}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CategorySettingsScreen> createState() => _CategorySettingsScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Переименован класс _SettingsScreenState в _CategorySettingsScreenState
|
||||||
|
class _CategorySettingsScreenState extends State<CategorySettingsScreen> {
|
||||||
|
late Stream<List<db.CategoryDb>> _categoriesStream;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_categoriesStream = widget.database.watchAllCategoriesDb();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для показа диалога добавления/редактирования
|
||||||
|
void _showEditCategoryDialog({db.CategoryDb? categoryToEdit}) async {
|
||||||
|
final result = await showDialog<bool>( // Ожидаем bool (true если сохранено)
|
||||||
|
context: context,
|
||||||
|
builder: (context) => EditCategoryDialog(
|
||||||
|
database: widget.database,
|
||||||
|
categoryToEdit: categoryToEdit, // Передаем категорию для редактирования или null для добавления
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result == true && mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(categoryToEdit == null ? 'Категория добавлена' : 'Категория обновлена'),
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Функция для удаления категории (с подтверждением)
|
||||||
|
void _deleteCategory(db.CategoryDb category) async {
|
||||||
|
// Не позволяем удалять 'Income'
|
||||||
|
if (category.name == 'Income') {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Категорию "Income" нельзя удалить.'),
|
||||||
|
backgroundColor: Colors.orange,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final confirm = await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title: const Text('Удалить категорию?'),
|
||||||
|
content: Text('Вы уверены, что хотите удалить категорию "${category.name}"? Это действие нельзя отменить.\n\nТранзакции с этой категорией могут отображаться некорректно или вызвать ошибки при попытке их отображения, если они не будут переназначены.'),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(false), // Отмена
|
||||||
|
child: const Text('Отмена'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(true), // Подтвердить
|
||||||
|
style: TextButton.styleFrom(foregroundColor: Colors.red),
|
||||||
|
child: const Text('Удалить'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (confirm == true) {
|
||||||
|
try {
|
||||||
|
// Попытка удаления категории из базы данных
|
||||||
|
final deletedRows = await widget.database.deleteCategory(category.id);
|
||||||
|
|
||||||
|
if (deletedRows > 0 && mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Категория "${category.name}" удалена.'),
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else if (deletedRows == 0 && mounted) {
|
||||||
|
// Это может произойти, если deleteCategory вернул 0 (например, из-за наличия транзакций)
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Не удалось удалить категорию "${category.name}". Возможно, она используется в транзакциях.'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
if (mounted) {
|
||||||
|
print("Error deleting category: $e"); // Логируем ошибку
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Ошибка при удалении категории: ${e.toString()}'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Редактирование категорий'), // Обновленный заголовок
|
||||||
|
centerTitle: true,
|
||||||
|
backgroundColor: theme.appBarTheme.backgroundColor, // Ensure AppBar color matches theme
|
||||||
|
elevation: theme.appBarTheme.elevation, // Ensure elevation matches theme
|
||||||
|
),
|
||||||
|
body: StreamBuilder<List<db.CategoryDb>>(
|
||||||
|
stream: _categoriesStream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting && !snapshot.hasData) {
|
||||||
|
return const Center(child: CircularProgressIndicator());
|
||||||
|
}
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Center(child: Text('Ошибка загрузки категорий: ${snapshot.error}'));
|
||||||
|
}
|
||||||
|
final categories = snapshot.data ?? [];
|
||||||
|
// Фильтруем категорию 'Income', чтобы ее нельзя было редактировать/удалять отсюда
|
||||||
|
final editableCategories = categories.where((c) => c.name != 'Income').toList();
|
||||||
|
|
||||||
|
if (editableCategories.isEmpty && snapshot.connectionState != ConnectionState.waiting) {
|
||||||
|
return Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
child: Text(
|
||||||
|
'Нет категорий для редактирования.\nНажмите "+", чтобы добавить новую категорию расходов.',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: theme.textTheme.bodyLarge?.copyWith(color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ListView.separated(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0), // Add padding around the list
|
||||||
|
itemCount: editableCategories.length,
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
height: 1,
|
||||||
|
thickness: 1,
|
||||||
|
indent: 72, // Indent to align with text after avatar
|
||||||
|
endIndent: 16,
|
||||||
|
color: theme.dividerColor.withOpacity(0.3),
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final category = editableCategories[index];
|
||||||
|
final iconData = CategoryUtils.getIconFromString(category.icon);
|
||||||
|
final colorData = Color(category.color);
|
||||||
|
|
||||||
|
return ListTile(
|
||||||
|
leading: CircleAvatar(
|
||||||
|
radius: 22, // Slightly larger avatar
|
||||||
|
backgroundColor: colorData.withOpacity(isDark ? 0.3 : 0.15),
|
||||||
|
child: Icon(iconData, color: colorData, size: 24),
|
||||||
|
),
|
||||||
|
title: Text(category.name, style: theme.textTheme.titleMedium),
|
||||||
|
trailing: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.edit_outlined, color: theme.colorScheme.primary.withOpacity(0.8)),
|
||||||
|
tooltip: 'Редактировать',
|
||||||
|
splashRadius: 24,
|
||||||
|
onPressed: () => _showEditCategoryDialog(categoryToEdit: category),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.delete_outline, color: Colors.red.shade400.withOpacity(0.8)),
|
||||||
|
tooltip: 'Удалить',
|
||||||
|
splashRadius: 24,
|
||||||
|
onPressed: () => _deleteCategory(category),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () => _showEditCategoryDialog(categoryToEdit: category), // Тоже открывает редактирование
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () => _showEditCategoryDialog(), // Вызов без аргумента для добавления
|
||||||
|
tooltip: 'Добавить категорию',
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AppTheme {
|
||||||
|
static ThemeData get lightTheme {
|
||||||
|
return ThemeData(
|
||||||
|
brightness: Brightness.light,
|
||||||
|
primaryColor: Colors.green,
|
||||||
|
scaffoldBackgroundColor: Colors.grey.shade50,
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
brightness: Brightness.light,
|
||||||
|
seedColor: Colors.green,
|
||||||
|
primary: Colors.green,
|
||||||
|
secondary: Colors.green.shade300,
|
||||||
|
surface: Colors.white,
|
||||||
|
background: Colors.grey.shade50,
|
||||||
|
),
|
||||||
|
cardTheme: CardTheme(
|
||||||
|
elevation: 1,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
iconTheme: IconThemeData(color: Colors.green.shade700),
|
||||||
|
titleTextStyle: const TextStyle(
|
||||||
|
color: Colors.black87,
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontFamily: 'Montserrat', // Ensure font family is applied here too
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
||||||
|
backgroundColor: Colors.green,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
selectedItemColor: Colors.green,
|
||||||
|
unselectedItemColor: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
fontFamily: 'Montserrat',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ThemeData get darkTheme {
|
||||||
|
return ThemeData(
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
primaryColor: Colors.green.shade400,
|
||||||
|
scaffoldBackgroundColor: const Color(0xFF121212),
|
||||||
|
colorScheme: ColorScheme.fromSeed(
|
||||||
|
brightness: Brightness.dark,
|
||||||
|
seedColor: Colors.green,
|
||||||
|
primary: Colors.green.shade400,
|
||||||
|
secondary: Colors.green.shade200,
|
||||||
|
surface: const Color(0xFF222222), // Used for Card background in dark theme
|
||||||
|
background: const Color(0xFF121212),
|
||||||
|
onSurface: Colors.white, // Default text color on surface
|
||||||
|
),
|
||||||
|
cardTheme: CardTheme(
|
||||||
|
elevation: 4,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
|
),
|
||||||
|
color: const Color(0xFF1E1E1E), // Darker card color
|
||||||
|
),
|
||||||
|
appBarTheme: const AppBarTheme(
|
||||||
|
backgroundColor: Color(0xFF1A1A1A), // Slightly different dark background
|
||||||
|
elevation: 0,
|
||||||
|
iconTheme: IconThemeData(color: Colors.greenAccent),
|
||||||
|
titleTextStyle: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 22,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontFamily: 'Montserrat', // Ensure font family is applied here too
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||||
|
backgroundColor: Colors.green.shade400,
|
||||||
|
foregroundColor: Colors.black87, // Better contrast on light green
|
||||||
|
),
|
||||||
|
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||||
|
backgroundColor: const Color(0xFF1A1A1A),
|
||||||
|
selectedItemColor: Colors.green.shade300,
|
||||||
|
unselectedItemColor: Colors.grey.shade500,
|
||||||
|
),
|
||||||
|
textTheme: const TextTheme(
|
||||||
|
bodyLarge: TextStyle(color: Colors.white), // Default text style
|
||||||
|
bodyMedium: TextStyle(color: Colors.white70), // Secondary text style
|
||||||
|
// Define other text styles if needed
|
||||||
|
).apply( // Ensure font family is applied globally for text
|
||||||
|
fontFamily: 'Montserrat',
|
||||||
|
),
|
||||||
|
fontFamily: 'Montserrat',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../models/category.dart'; // Import the Category model for return types
|
||||||
|
|
||||||
|
// Helper class to manage category details (icon, color) based on name
|
||||||
|
class CategoryUtils {
|
||||||
|
// Private map storing details for each predefined category name.
|
||||||
|
// Using a record `({IconData icon, Color color})` for concise structure.
|
||||||
|
// This map is mainly for initial data and potentially fallback display logic.
|
||||||
|
// The actual icon/color for user-created categories will come from the database.
|
||||||
|
// DEPRECATED: Rely on _stringToIconData and database color instead.
|
||||||
|
// static final Map<String, ({IconData iconCode, Color colorCode})> _categoryDetails = { ... };
|
||||||
|
|
||||||
|
// Default details to return if a category name is not found (e.g., deleted category).
|
||||||
|
// DEPRECATED: Use getIconFromString and default color instead.
|
||||||
|
// static final _defaultDetails = (iconCode: Icons.category_outlined, colorCode: Colors.grey.shade500);
|
||||||
|
|
||||||
|
/// DEPRECATED: Returns the IconData and Color associated with a given category name (primarily for fallback).
|
||||||
|
/// It's better to rely on data fetched directly from the database (CategoryDb).
|
||||||
|
static ({Color colorCode, IconData iconCode}) getCategoryDetails(String categoryName) {
|
||||||
|
// Fallback logic using the string-to-icon map and a default color
|
||||||
|
final icon = getIconFromString(categoryName); // Use the reliable method
|
||||||
|
// Find color from initial data if possible, otherwise default grey
|
||||||
|
// This part is still weak, ideally color comes from DB.
|
||||||
|
Color color = Colors.grey.shade500; // Default color
|
||||||
|
// Quick check against some known initial names for color fallback
|
||||||
|
if (categoryName == 'Groceries') color = Colors.green.shade400;
|
||||||
|
if (categoryName == 'Subscriptions') color = Colors.orange.shade400;
|
||||||
|
if (categoryName == 'Restaurant') color = Colors.red.shade400;
|
||||||
|
if (categoryName == 'Shopping') color = Colors.blue.shade400;
|
||||||
|
if (categoryName == 'Transport') color = Colors.purple.shade400;
|
||||||
|
if (categoryName == 'Travel') color = Colors.cyan.shade400;
|
||||||
|
if (categoryName == 'Utilities') color = Colors.teal.shade400; // Updated from home_outlined
|
||||||
|
if (categoryName == 'Income') color = Colors.lightGreenAccent.shade700;
|
||||||
|
|
||||||
|
return (colorCode: color, iconCode: icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// DEPRECATED: Returns a `Category` object based on its name and amount (primarily for UI models like Pie Chart).
|
||||||
|
/// Fetches icon/color details using `getCategoryDetails` as a fallback mechanism.
|
||||||
|
/// Should be replaced by logic that uses CategoryDb data directly.
|
||||||
|
static Category getCategoryByName(String name, double amount) {
|
||||||
|
final details = getCategoryDetails(name);
|
||||||
|
return Category(name, amount, details.colorCode, details.iconCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// DEPRECATED: Returns a list of all predefined category names (excluding placeholders).
|
||||||
|
/// Might be less useful now that categories are fully dynamic.
|
||||||
|
static List<String> getAllCategoryNames() {
|
||||||
|
// Return keys from _stringToIconData, excluding special ones
|
||||||
|
return _stringToIconData.keys.where((key) =>
|
||||||
|
key != 'help_outline' &&
|
||||||
|
key != 'label_outline' &&
|
||||||
|
key != 'attach_money' && // Exclude Income
|
||||||
|
key != 'category_outlined' // Exclude Other/Default
|
||||||
|
).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Converts a string icon name (like 'shopping_cart_outlined') to IconData.
|
||||||
|
/// This map is crucial for displaying icons based on the string stored in the DB.
|
||||||
|
static final Map<String, IconData> _stringToIconData = {
|
||||||
|
// Existing Icons
|
||||||
|
'shopping_cart_outlined': Icons.shopping_cart_outlined, // Groceries
|
||||||
|
'subscriptions_outlined': Icons.subscriptions_outlined, // Subscriptions
|
||||||
|
'restaurant_menu_outlined': Icons.restaurant_menu_outlined, // Restaurant
|
||||||
|
'shopping_bag_outlined': Icons.shopping_bag_outlined, // Shopping
|
||||||
|
'directions_bus_filled_outlined': Icons.directions_bus_filled_outlined, // Transport
|
||||||
|
'flight_takeoff_outlined': Icons.flight_takeoff_outlined, // Travel
|
||||||
|
'lightbulb_outline': Icons.lightbulb_outline, // Utilities (alternative)
|
||||||
|
'local_hospital_outlined': Icons.local_hospital_outlined, // Health
|
||||||
|
'movie_filter_outlined': Icons.movie_filter_outlined, // Entertainment
|
||||||
|
'attach_money': Icons.attach_money, // Income (Special)
|
||||||
|
'category_outlined': Icons.category_outlined, // Other/Default (Fallback)
|
||||||
|
'label_outline': Icons.label_outline, // Placeholder (Internal)
|
||||||
|
'help_outline': Icons.help_outline, // Placeholder/Error (Internal)
|
||||||
|
'home_outlined': Icons.home_outlined, // Home/Rent/Mortgage/Utilities
|
||||||
|
'pets_outlined': Icons.pets_outlined, // Pets
|
||||||
|
'school_outlined': Icons.school_outlined, // Education/School
|
||||||
|
'fitness_center_outlined': Icons.fitness_center_outlined, // Gym/Fitness
|
||||||
|
'checkroom_outlined': Icons.checkroom_outlined, // Clothing
|
||||||
|
'devices_other_outlined': Icons.devices_other_outlined, // Electronics
|
||||||
|
'card_giftcard_outlined': Icons.card_giftcard_outlined, // Gifts
|
||||||
|
'volunteer_activism_outlined': Icons.volunteer_activism_outlined, // Charity/Donations
|
||||||
|
'receipt_long_outlined': Icons.receipt_long_outlined, // Bills/Receipts
|
||||||
|
'savings_outlined': Icons.savings_outlined, // Savings/Investments
|
||||||
|
'credit_card_outlined': Icons.credit_card_outlined, // Credit Card Payment
|
||||||
|
'build_outlined': Icons.build_outlined, // Repairs/Maintenance
|
||||||
|
'child_friendly_outlined': Icons.child_friendly_outlined, // Child Care
|
||||||
|
'work_outline': Icons.work_outline, // Work related
|
||||||
|
'book_outlined': Icons.book_outlined, // Books/Magazines
|
||||||
|
'music_note_outlined': Icons.music_note_outlined, // Music
|
||||||
|
'sports_esports_outlined': Icons.sports_esports_outlined, // Games/Hobbies
|
||||||
|
'local_bar_outlined': Icons.local_bar_outlined, // Drinks/Bar
|
||||||
|
'cake_outlined': Icons.cake_outlined, // Celebrations/Party
|
||||||
|
'park_outlined': Icons.park_outlined, // Parks/Outdoors
|
||||||
|
'science_outlined': Icons.science_outlined, // Science/Tech
|
||||||
|
'palette_outlined': Icons.palette_outlined, // Art/Design
|
||||||
|
'account_balance_outlined': Icons.account_balance_outlined, // Bank/Finance Fees
|
||||||
|
'analytics_outlined': Icons.analytics_outlined, // Analysis/Reports (Maybe internal?)
|
||||||
|
'apartment_outlined': Icons.apartment_outlined, // Rent/Mortgage (Alternative)
|
||||||
|
'beach_access_outlined': Icons.beach_access_outlined, // Vacation/Beach
|
||||||
|
'brush_outlined': Icons.brush_outlined, // Personal Care/Cosmetics
|
||||||
|
'business_center_outlined': Icons.business_center_outlined, // Business Expenses
|
||||||
|
'call_outlined': Icons.call_outlined, // Phone Bill
|
||||||
|
'camera_alt_outlined': Icons.camera_alt_outlined, // Photography/Equipment
|
||||||
|
'car_rental_outlined': Icons.car_rental_outlined, // Car Rental
|
||||||
|
'car_repair_outlined': Icons.car_repair_outlined, // Car Repair
|
||||||
|
'celebration_outlined': Icons.celebration_outlined, // Party/Events (Alternative)
|
||||||
|
'computer_outlined': Icons.computer_outlined, // Computer/Software
|
||||||
|
'construction_outlined': Icons.construction_outlined, // Home Improvement
|
||||||
|
'cottage_outlined': Icons.cottage_outlined, // Vacation Home/Cottage
|
||||||
|
'delivery_dining_outlined': Icons.delivery_dining_outlined, // Food Delivery
|
||||||
|
'diamond_outlined': Icons.diamond_outlined, // Jewelry/Luxury
|
||||||
|
'dry_cleaning_outlined': Icons.dry_cleaning_outlined, // Laundry/Dry Cleaning
|
||||||
|
'electrical_services_outlined': Icons.electrical_services_outlined, // Electrician
|
||||||
|
'emoji_events_outlined': Icons.emoji_events_outlined, // Awards/Competitions
|
||||||
|
'fastfood_outlined': Icons.fastfood_outlined, // Fast Food
|
||||||
|
'fax_outlined': Icons.fax_outlined, // Office Supplies (Maybe outdated?)
|
||||||
|
'festival_outlined': Icons.festival_outlined, // Festivals/Events
|
||||||
|
'fireplace_outlined': Icons.fireplace_outlined, // Heating/Fuel
|
||||||
|
'flatware_outlined': Icons.flatware_outlined, // Kitchenware
|
||||||
|
'gas_meter_outlined': Icons.gas_meter_outlined, // Gas Bill
|
||||||
|
'gavel_outlined': Icons.gavel_outlined, // Legal Fees
|
||||||
|
'grass_outlined': Icons.grass_outlined, // Gardening/Lawn Care
|
||||||
|
'hardware_outlined': Icons.hardware_outlined, // Hardware Store
|
||||||
|
'hearing_outlined': Icons.hearing_outlined, // Audio/Headphones
|
||||||
|
'hiking_outlined': Icons.hiking_outlined, // Hiking/Outdoor Gear
|
||||||
|
'icecream_outlined': Icons.icecream_outlined, // Ice Cream/Desserts
|
||||||
|
'interests_outlined': Icons.interests_outlined, // Hobbies General
|
||||||
|
'key_outlined': Icons.key_outlined, // Keys/Locks
|
||||||
|
'liquor_outlined': Icons.liquor_outlined, // Alcohol
|
||||||
|
'local_activity_outlined': Icons.local_activity_outlined, // Tickets/Events
|
||||||
|
'local_atm_outlined': Icons.local_atm_outlined, // ATM Withdrawal (Maybe internal?)
|
||||||
|
'local_convenience_store_outlined': Icons.local_convenience_store_outlined, // Convenience Store
|
||||||
|
'local_florist_outlined': Icons.local_florist_outlined, // Flowers
|
||||||
|
'local_gas_station_outlined': Icons.local_gas_station_outlined, // Gas/Fuel
|
||||||
|
'local_laundry_service_outlined': Icons.local_laundry_service_outlined, // Laundry Service
|
||||||
|
'local_mall_outlined': Icons.local_mall_outlined, // Mall Shopping
|
||||||
|
'local_offer_outlined': Icons.local_offer_outlined, // Discounts/Sales/Coupons
|
||||||
|
'local_parking_outlined': Icons.local_parking_outlined, // Parking Fees
|
||||||
|
'local_pharmacy_outlined': Icons.local_pharmacy_outlined, // Pharmacy
|
||||||
|
'local_pizza_outlined': Icons.local_pizza_outlined, // Pizza
|
||||||
|
'local_shipping_outlined': Icons.local_shipping_outlined, // Shipping Costs
|
||||||
|
'local_taxi_outlined': Icons.local_taxi_outlined, // Taxi/Rideshare
|
||||||
|
'lunch_dining_outlined': Icons.lunch_dining_outlined, // Lunch
|
||||||
|
'medication_outlined': Icons.medication_outlined, // Medication
|
||||||
|
'museum_outlined': Icons.museum_outlined, // Museum/Exhibits
|
||||||
|
'newspaper_outlined': Icons.newspaper_outlined, // Newspapers/Magazines
|
||||||
|
'paid_outlined': Icons.paid_outlined, // Payments/Transfers (Maybe internal?)
|
||||||
|
'pedal_bike_outlined': Icons.pedal_bike_outlined, // Cycling
|
||||||
|
'plumbing_outlined': Icons.plumbing_outlined, // Plumber
|
||||||
|
'ramen_dining_outlined': Icons.ramen_dining_outlined, // Noodles/Asian Food
|
||||||
|
'recycling_outlined': Icons.recycling_outlined, // Recycling Fees
|
||||||
|
'redeem_outlined': Icons.redeem_outlined, // Gifts Received/Redeemed (Maybe internal?)
|
||||||
|
'request_quote_outlined': Icons.request_quote_outlined, // Invoices/Quotes (Maybe internal?)
|
||||||
|
'roller_skating_outlined': Icons.roller_skating_outlined, // Skating
|
||||||
|
'roofing_outlined': Icons.roofing_outlined, // Roofing Repair
|
||||||
|
'room_service_outlined': Icons.room_service_outlined, // Hotel Service
|
||||||
|
'shield_outlined': Icons.shield_outlined, // Insurance
|
||||||
|
'skateboarding_outlined': Icons.skateboarding_outlined, // Skateboarding
|
||||||
|
'smoking_rooms_outlined': Icons.smoking_rooms_outlined, // Tobacco
|
||||||
|
'spa_outlined': Icons.spa_outlined, // Spa/Wellness
|
||||||
|
'sports_bar_outlined': Icons.sports_bar_outlined, // Sports Bar
|
||||||
|
'sports_basketball_outlined': Icons.sports_basketball_outlined, // Basketball
|
||||||
|
'sports_football_outlined': Icons.sports_football_outlined, // Football
|
||||||
|
'sports_golf_outlined': Icons.sports_golf_outlined, // Golf
|
||||||
|
'sports_gymnastics_outlined': Icons.sports_gymnastics_outlined, // Gymnastics
|
||||||
|
'sports_handball_outlined': Icons.sports_handball_outlined, // Handball
|
||||||
|
'sports_hockey_outlined': Icons.sports_hockey_outlined, // Hockey
|
||||||
|
'sports_kabaddi_outlined': Icons.sports_kabaddi_outlined, // Kabaddi
|
||||||
|
'sports_mma_outlined': Icons.sports_mma_outlined, // MMA
|
||||||
|
'sports_motorsports_outlined': Icons.sports_motorsports_outlined, // Motorsports
|
||||||
|
'sports_soccer_outlined': Icons.sports_soccer_outlined, // Soccer
|
||||||
|
'sports_tennis_outlined': Icons.sports_tennis_outlined, // Tennis
|
||||||
|
'sports_volleyball_outlined': Icons.sports_volleyball_outlined, // Volleyball
|
||||||
|
'stadium_outlined': Icons.stadium_outlined, // Stadium/Events
|
||||||
|
'store_mall_directory_outlined': Icons.store_mall_directory_outlined, // Department Store
|
||||||
|
'stroller_outlined': Icons.stroller_outlined, // Baby Supplies
|
||||||
|
'subway_outlined': Icons.subway_outlined, // Subway/Metro
|
||||||
|
'surfing_outlined': Icons.surfing_outlined, // Surfing
|
||||||
|
'sync_alt_outlined': Icons.sync_alt_outlined, // Transfers (Maybe internal?)
|
||||||
|
'theater_comedy_outlined': Icons.theater_comedy_outlined, // Comedy Club
|
||||||
|
'theaters_outlined': Icons.theaters_outlined, // Cinema/Theater
|
||||||
|
'toys_outlined': Icons.toys_outlined, // Toys
|
||||||
|
'train_outlined': Icons.train_outlined, // Train Travel
|
||||||
|
'tram_outlined': Icons.tram_outlined, // Tram
|
||||||
|
'two_wheeler_outlined': Icons.two_wheeler_outlined, // Motorcycle/Scooter
|
||||||
|
'vape_free_outlined': Icons.vape_free_outlined, // Vaping (quit)
|
||||||
|
'vaping_rooms_outlined': Icons.vaping_rooms_outlined, // Vaping
|
||||||
|
'videogame_asset_outlined': Icons.videogame_asset_outlined, // Video Games
|
||||||
|
'water_drop_outlined': Icons.water_drop_outlined, // Water Bill
|
||||||
|
'wifi_outlined': Icons.wifi_outlined, // Internet Bill
|
||||||
|
'wine_bar_outlined': Icons.wine_bar_outlined, // Wine Bar
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Returns the IconData corresponding to the given icon name string.
|
||||||
|
/// If the `iconName` is not found or is null/empty, returns a default fallback icon (`Icons.help_outline`).
|
||||||
|
static IconData getIconFromString(String? iconName) {
|
||||||
|
if (iconName == null || iconName.isEmpty) {
|
||||||
|
return Icons.help_outline; // Default for null or empty
|
||||||
|
}
|
||||||
|
return _stringToIconData[iconName] ?? Icons.help_outline; // Return default if not found in map
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a map of available icons for selection in UI (e.g., dropdowns, dialogs).
|
||||||
|
/// Excludes placeholder/internal icons like 'help_outline', 'label_outline',
|
||||||
|
/// 'category_outlined', and the special 'attach_money' (Income).
|
||||||
|
static Map<String, IconData> getAvailableIcons() {
|
||||||
|
final availableIcons = Map<String, IconData>.from(_stringToIconData);
|
||||||
|
// Remove icons not intended for user selection as expense categories
|
||||||
|
availableIcons.remove('help_outline'); // Internal fallback/error
|
||||||
|
availableIcons.remove('label_outline'); // Internal placeholder
|
||||||
|
availableIcons.remove('category_outlined'); // Internal generic fallback
|
||||||
|
availableIcons.remove('attach_money'); // Reserved for Income type
|
||||||
|
// Consider removing others if they represent internal states:
|
||||||
|
// availableIcons.remove('sync_alt_outlined'); // Transfers?
|
||||||
|
// availableIcons.remove('paid_outlined'); // Payments?
|
||||||
|
// availableIcons.remove('local_atm_outlined'); // ATM?
|
||||||
|
// availableIcons.remove('redeem_outlined'); // Gifts Received?
|
||||||
|
// availableIcons.remove('request_quote_outlined'); // Invoices?
|
||||||
|
// availableIcons.remove('analytics_outlined'); // Reports?
|
||||||
|
return availableIcons;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// List of available colors for category selection in UI.
|
||||||
|
static const List<Color> availableColors = [
|
||||||
|
// Primary Colors (Good starting points)
|
||||||
|
Colors.red, Colors.pink, Colors.purple, Colors.deepPurple,
|
||||||
|
Colors.indigo, Colors.blue, Colors.lightBlue, Colors.cyan,
|
||||||
|
Colors.teal, Colors.green, Colors.lightGreen, Colors.lime,
|
||||||
|
Colors.yellow, Colors.amber, Colors.orange, Colors.deepOrange,
|
||||||
|
Colors.brown, Colors.grey, Colors.blueGrey,
|
||||||
|
|
||||||
|
// Accent Colors (Brighter, use with care)
|
||||||
|
Colors.redAccent, Colors.pinkAccent, Colors.purpleAccent, Colors.deepPurpleAccent,
|
||||||
|
Colors.indigoAccent, Colors.blueAccent, Colors.lightBlueAccent, Colors.cyanAccent,
|
||||||
|
Colors.tealAccent, Colors.greenAccent, Colors.limeAccent,
|
||||||
|
Colors.yellowAccent, Colors.amberAccent, Colors.orangeAccent, Colors.deepOrangeAccent,
|
||||||
|
|
||||||
|
// Shade variations (More subtle options)
|
||||||
|
/*Colors.red.shade300, Colors.pink.shade200, Colors.purple.shade300,
|
||||||
|
Colors.indigo.shade300, Colors.blue.shade300, Colors.lightBlue.shade300,
|
||||||
|
Colors.cyan.shade300, Colors.teal.shade300, Colors.green.shade300,
|
||||||
|
Colors.lightGreen.shade300, Colors.lime.shade300, Colors.yellow.shade600, // Darker yellow
|
||||||
|
Colors.amber.shade300, Colors.orange.shade300, Colors.deepOrange.shade300,
|
||||||
|
Colors.brown.shade300, Colors.grey.shade400, Colors.blueGrey.shade300,*/
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,268 @@
|
|||||||
|
import 'package:drift/drift.dart' show Value;
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../database/database.dart' as db; // Import database with prefix 'db'
|
||||||
|
import '../utils/category_utils.dart'; // Import CategoryUtils
|
||||||
|
|
||||||
|
class AddCategoryDialog extends StatefulWidget {
|
||||||
|
final db.AppDatabase database;
|
||||||
|
|
||||||
|
const AddCategoryDialog({Key? key, required this.database}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AddCategoryDialog> createState() => _AddCategoryDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddCategoryDialogState extends State<AddCategoryDialog> {
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
final _nameController = TextEditingController();
|
||||||
|
// State for selected icon
|
||||||
|
String _selectedIconName = 'label_outline'; // Default icon name (string)
|
||||||
|
IconData _selectedIconData = Icons.label_outline; // Default icon data
|
||||||
|
// State for selected color
|
||||||
|
Color _selectedColor = CategoryUtils.availableColors[9]; // Default to green
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
// Initialize icon data based on the default name
|
||||||
|
_selectedIconData = CategoryUtils.getIconFromString(_selectedIconName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_nameController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Function to show the icon picker dialog ---
|
||||||
|
Future<void> _showIconPicker() async {
|
||||||
|
final Map<String, IconData> availableIcons = CategoryUtils.getAvailableIcons();
|
||||||
|
final List<String> iconNames = availableIcons.keys.toList();
|
||||||
|
final List<IconData> iconDatas = availableIcons.values.toList();
|
||||||
|
print("Number of available icons: ${availableIcons.length}"); // Debug print
|
||||||
|
|
||||||
|
final String? chosenIconName = await showDialog<String>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Выберите иконку'),
|
||||||
|
contentPadding: const EdgeInsets.all(10.0), // Adjust padding
|
||||||
|
content: SizedBox( // Constrain the size of the dialog content
|
||||||
|
width: double.maxFinite, // Use maximum width available
|
||||||
|
height: 300, // <--- ЗАДАЕМ ВЫСОТУ ДЛЯ ОБЛАСТИ ПРОКРУТКИ
|
||||||
|
child: GridView.builder(
|
||||||
|
// shrinkWrap: true, // <--- УБИРАЕМ SHRINKWRAP
|
||||||
|
itemCount: iconNames.length,
|
||||||
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 5, // Adjust number of columns
|
||||||
|
crossAxisSpacing: 10.0,
|
||||||
|
mainAxisSpacing: 10.0,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final bool isSelected = _selectedIconName == iconNames[index];
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context, iconNames[index]); // Return the selected icon name (String)
|
||||||
|
},
|
||||||
|
borderRadius: BorderRadius.circular(8.0), // Ripple effect matches border
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected
|
||||||
|
? Theme.of(context).colorScheme.primary // Highlight selected
|
||||||
|
: Colors.grey.withOpacity(0.3), // Subtle border for all
|
||||||
|
width: isSelected ? 2.0 : 1.0, // Thicker border if selected
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
|
color: isSelected ? Theme.of(context).colorScheme.primary.withOpacity(0.1) : null,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
iconDatas[index],
|
||||||
|
size: 30.0, // Adjust icon size
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white70
|
||||||
|
: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, null), // Close without selection
|
||||||
|
child: const Text('Отмена'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// Update state if an icon was chosen
|
||||||
|
if (chosenIconName != null) {
|
||||||
|
setState(() {
|
||||||
|
_selectedIconName = chosenIconName;
|
||||||
|
_selectedIconData = CategoryUtils.getIconFromString(chosenIconName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// --- End of Icon Picker Function ---
|
||||||
|
|
||||||
|
|
||||||
|
Future<void> _saveCategory() async {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
final name = _nameController.text;
|
||||||
|
// Use the selected icon name
|
||||||
|
final icon = _selectedIconName;
|
||||||
|
// Use the selected color value
|
||||||
|
final color = _selectedColor.value;
|
||||||
|
|
||||||
|
final newCategoryCompanion = db.CategoriesCompanion(
|
||||||
|
name: Value(name),
|
||||||
|
icon: Value(icon), // Use selected icon name
|
||||||
|
color: Value(color), // Use selected color value
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// TODO: Add check for duplicate category name before inserting (more robustly)
|
||||||
|
final newCategoryId = await widget.database.addCategory(newCategoryCompanion);
|
||||||
|
final newCategory = await widget.database.getCategoryById(newCategoryId);
|
||||||
|
if (mounted) {
|
||||||
|
Navigator.pop(context, newCategory); // Return the newly created CategoryDb object
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Error adding category: $e');
|
||||||
|
// Handle potential duplicate name error from database (depends on DB constraints)
|
||||||
|
String errorMessage = 'Произошла ошибка при добавлении категории.';
|
||||||
|
if (e.toString().toLowerCase().contains('unique constraint failed')) {
|
||||||
|
errorMessage = 'Категория с таким именем уже существует.';
|
||||||
|
}
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text(errorMessage),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
// Determine icon color based on the selected background color's brightness
|
||||||
|
final iconColor = ThemeData.estimateBrightnessForColor(_selectedColor) == Brightness.dark
|
||||||
|
? Colors.white70
|
||||||
|
: Colors.black87;
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Создать категорию'),
|
||||||
|
content: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, // Align children to the start
|
||||||
|
children: [
|
||||||
|
// --- Icon and Name Row ---
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
// --- Icon Picker ---
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 16.0, bottom: 10.0), // Add padding
|
||||||
|
child: InkWell(
|
||||||
|
onTap: _showIconPicker, // Show picker on tap
|
||||||
|
customBorder: const CircleBorder(), // Make ripple circular
|
||||||
|
child: CircleAvatar(
|
||||||
|
radius: 24,
|
||||||
|
backgroundColor: _selectedColor, // Use selected color for background
|
||||||
|
child: Icon(
|
||||||
|
_selectedIconData, // Display selected icon
|
||||||
|
color: iconColor, // Adjust icon color based on background
|
||||||
|
size: 26,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// --- Name Field ---
|
||||||
|
Expanded(
|
||||||
|
child: TextFormField(
|
||||||
|
controller: _nameController,
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
labelText: 'Название категории',
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Пожалуйста, введите название';
|
||||||
|
}
|
||||||
|
// Basic length check
|
||||||
|
if (value.length > 50) {
|
||||||
|
return 'Название слишком длинное';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
textCapitalization: TextCapitalization.sentences,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20), // Space before color picker
|
||||||
|
|
||||||
|
// --- Color Picker ---
|
||||||
|
const Text('Выберите цвет:', style: TextStyle(fontSize: 16)),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Wrap( // Use Wrap for horizontal layout with wrapping
|
||||||
|
spacing: 8.0, // Horizontal space between circles
|
||||||
|
runSpacing: 8.0, // Vertical space between rows
|
||||||
|
children: CategoryUtils.availableColors.map((color) {
|
||||||
|
final bool isSelected = _selectedColor == color;
|
||||||
|
return InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
_selectedColor = color; // Update selected color on tap
|
||||||
|
});
|
||||||
|
},
|
||||||
|
customBorder: const CircleBorder(),
|
||||||
|
child: Container(
|
||||||
|
width: 32, // Size of the color circle
|
||||||
|
height: 32,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected
|
||||||
|
? theme.colorScheme.onSurface // Highlight selected
|
||||||
|
: theme.dividerColor, // Border for others
|
||||||
|
width: isSelected ? 3.0 : 1.0,
|
||||||
|
),
|
||||||
|
boxShadow: isSelected ? [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.3),
|
||||||
|
blurRadius: 3,
|
||||||
|
offset: const Offset(0, 1),
|
||||||
|
)
|
||||||
|
] : null,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16), // Add some space at the bottom
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, null), // Return null if cancelled
|
||||||
|
child: const Text('Отмена'),
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: _saveCategory,
|
||||||
|
child: const Text('Сохранить'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,299 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:drift/drift.dart' show Value;
|
||||||
|
import '../database/database.dart' as db;
|
||||||
|
import '../utils/category_utils.dart';
|
||||||
|
|
||||||
|
class EditCategoryDialog extends StatefulWidget {
|
||||||
|
final db.AppDatabase database;
|
||||||
|
final db.CategoryDb? categoryToEdit; // null если добавляем новую
|
||||||
|
|
||||||
|
const EditCategoryDialog({
|
||||||
|
Key? key,
|
||||||
|
required this.database,
|
||||||
|
this.categoryToEdit,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<EditCategoryDialog> createState() => _EditCategoryDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EditCategoryDialogState extends State<EditCategoryDialog> {
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
late TextEditingController _nameController;
|
||||||
|
String? _selectedIconName;
|
||||||
|
Color? _selectedColor;
|
||||||
|
|
||||||
|
bool get _isEditing => widget.categoryToEdit != null;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_nameController = TextEditingController(text: widget.categoryToEdit?.name ?? '');
|
||||||
|
// Ensure the initial icon exists in the available list, otherwise pick the first
|
||||||
|
_selectedIconName = widget.categoryToEdit?.icon;
|
||||||
|
if (_selectedIconName == null || !CategoryUtils.getAvailableIcons().containsKey(_selectedIconName)) {
|
||||||
|
_selectedIconName = CategoryUtils.getAvailableIcons().keys.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Инициализируем цвет.
|
||||||
|
// Если редактируем существующую категорию, используем ее цвет из БД.
|
||||||
|
// Если добавляем новую, используем первый цвет из доступных.
|
||||||
|
if (_isEditing) {
|
||||||
|
_selectedColor = Color(widget.categoryToEdit!.color);
|
||||||
|
} else {
|
||||||
|
_selectedColor = CategoryUtils.availableColors.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Убедимся, что _selectedColor не null после инициализации
|
||||||
|
// (это должно быть гарантировано логикой выше, но для безопасности)
|
||||||
|
_selectedColor ??= CategoryUtils.availableColors.first;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_nameController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _saveCategory() async {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
final name = _nameController.text.trim();
|
||||||
|
final icon = _selectedIconName;
|
||||||
|
final color = _selectedColor;
|
||||||
|
|
||||||
|
if (icon == null || color == null) {
|
||||||
|
// This should not happen due to initialization logic, but check anyway
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Пожалуйста, выберите иконку и цвет'),
|
||||||
|
backgroundColor: Colors.orange,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Проверка на уникальность имени (кроме случая редактирования той же категории)
|
||||||
|
// Используем case-insensitive сравнение
|
||||||
|
final existingCategories = await widget.database.watchAllCategoriesDb().first;
|
||||||
|
final isNameTaken = existingCategories.any((c) =>
|
||||||
|
c.name.toLowerCase() == name.toLowerCase() &&
|
||||||
|
(!_isEditing || c.id != widget.categoryToEdit!.id)); // Проверяем ID только при редактировании
|
||||||
|
|
||||||
|
if (isNameTaken) {
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Категория с именем "$name" уже существует.'),
|
||||||
|
backgroundColor: Colors.orange,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Запрещаем имя 'Income' (case-insensitive)
|
||||||
|
if (name.toLowerCase() == 'income') {
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Имя "Income" зарезервировано.'),
|
||||||
|
backgroundColor: Colors.orange,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
final companion = db.CategoriesCompanion(
|
||||||
|
id: _isEditing ? Value(widget.categoryToEdit!.id) : const Value.absent(),
|
||||||
|
name: Value(name),
|
||||||
|
icon: Value(icon),
|
||||||
|
color: Value(color.value),
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (_isEditing) {
|
||||||
|
await widget.database.updateCategory(companion);
|
||||||
|
} else {
|
||||||
|
await widget.database.addCategory(companion);
|
||||||
|
}
|
||||||
|
if (mounted) Navigator.of(context).pop(true); // Возвращаем true при успехе
|
||||||
|
} catch (e) {
|
||||||
|
print('Error saving category: $e');
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Ошибка сохранения категории: ${e.toString()}'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
final availableIcons = CategoryUtils.getAvailableIcons(); // Get filtered icons
|
||||||
|
|
||||||
|
// Объединяем цвет текущей категории (если редактируем) с доступными цветами
|
||||||
|
// для отображения в палитре. Это нужно, чтобы текущий цвет был виден,
|
||||||
|
// даже если его нет в стандартном списке.
|
||||||
|
final List<Color> displayedColors = List.from(CategoryUtils.availableColors);
|
||||||
|
if (_isEditing && _selectedColor != null && !CategoryUtils.availableColors.contains(_selectedColor)) {
|
||||||
|
// Добавляем цвет текущей категории в начало списка для отображения
|
||||||
|
displayedColors.insert(0, _selectedColor!);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text(_isEditing ? 'Редактировать категорию' : 'Добавить категорию'),
|
||||||
|
contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 0.0), // Adjust padding
|
||||||
|
content: SizedBox( // Constrain width for better appearance on large screens
|
||||||
|
width: MediaQuery.of(context).size.width * 0.8, // Example width constraint
|
||||||
|
child: SingleChildScrollView( // Позволяет прокручивать, если не помещается
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start, // Align labels to start
|
||||||
|
children: [
|
||||||
|
// --- Поле Имя ---
|
||||||
|
TextFormField(
|
||||||
|
controller: _nameController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Название категории',
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.trim().isEmpty) {
|
||||||
|
return 'Введите название';
|
||||||
|
}
|
||||||
|
if (value.trim().toLowerCase() == 'income') {
|
||||||
|
return 'Имя "Income" зарезервировано';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
textCapitalization: TextCapitalization.words,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// --- Выбор Иконки ---
|
||||||
|
DropdownButtonFormField<String>(
|
||||||
|
value: _selectedIconName,
|
||||||
|
isExpanded: true, // Allow dropdown to expand
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Иконка',
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
|
||||||
|
),
|
||||||
|
items: availableIcons.entries.map((entry) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: entry.key,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(entry.value, color: _selectedColor ?? theme.colorScheme.primary, size: 20),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
// Отображаем имя иконки, убирая '_outlined' и делая первую букву заглавной
|
||||||
|
Text(entry.key.replaceAll('_outlined', '').replaceAll('_', ' ').capitalizeFirst()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
setState(() {
|
||||||
|
_selectedIconName = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validator: (value) => value == null ? 'Выберите иконку' : null,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// --- Выбор Цвета ---
|
||||||
|
Text('Цвет категории:', style: theme.textTheme.titleSmall),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Wrap( // Используем Wrap для отображения цветов в несколько рядов
|
||||||
|
spacing: 10.0, // Горизонтальный отступ
|
||||||
|
runSpacing: 10.0, // Вертикальный отступ
|
||||||
|
children: displayedColors.map((color) { // Используем объединенный список цветов
|
||||||
|
final isSelected = _selectedColor == color;
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
_selectedColor = color;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 38,
|
||||||
|
height: 38,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected
|
||||||
|
? (isDark ? Colors.white70 : Colors.black87)
|
||||||
|
: theme.dividerColor.withOpacity(0.5), // Subtle border for unselected
|
||||||
|
width: isSelected ? 2.5 : 1.0,
|
||||||
|
),
|
||||||
|
boxShadow: isSelected ? [
|
||||||
|
BoxShadow(
|
||||||
|
color: color.withOpacity(0.5),
|
||||||
|
blurRadius: 4,
|
||||||
|
offset: const Offset(0, 2),
|
||||||
|
)
|
||||||
|
] : [],
|
||||||
|
),
|
||||||
|
child: isSelected
|
||||||
|
? Icon(Icons.check, color: ThemeData.estimateBrightnessForColor(color) == Brightness.dark ? Colors.white : Colors.black, size: 20)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24), // Add space before actions
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actionsPadding: const EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 16.0), // Adjust actions padding
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(false), // Возвращаем false при отмене
|
||||||
|
child: const Text('Отмена'),
|
||||||
|
),
|
||||||
|
ElevatedButton.icon(
|
||||||
|
icon: const Icon(Icons.save_alt_rounded),
|
||||||
|
onPressed: _saveCategory,
|
||||||
|
label: const Text('Сохранить'),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper extension for capitalizing first letter
|
||||||
|
extension StringExtension on String {
|
||||||
|
String capitalizeFirst() {
|
||||||
|
if (isEmpty) return this;
|
||||||
|
return "${this[0].toUpperCase()}${substring(1)}";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,382 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:drift/drift.dart' show Value;
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import '../database/database.dart' as db;
|
||||||
|
import '../utils/category_utils.dart'; // For icon and color utilities
|
||||||
|
|
||||||
|
class EditTransactionDialog extends StatefulWidget {
|
||||||
|
final db.AppDatabase database;
|
||||||
|
final db.Transaction transaction; // The transaction to edit
|
||||||
|
final Stream<List<db.CategoryDb>> categoriesStream; // Stream of available categories
|
||||||
|
|
||||||
|
const EditTransactionDialog({
|
||||||
|
Key? key,
|
||||||
|
required this.database,
|
||||||
|
required this.transaction,
|
||||||
|
required this.categoriesStream,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<EditTransactionDialog> createState() => _EditTransactionDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EditTransactionDialogState extends State<EditTransactionDialog> {
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
late TextEditingController _amountController;
|
||||||
|
late TextEditingController _merchantController;
|
||||||
|
late String? _selectedCategoryName; // Can be null for Income
|
||||||
|
late DateTime _selectedDate;
|
||||||
|
late db.TransactionType _selectedType;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
// Initialize controllers and state with existing transaction data
|
||||||
|
_amountController = TextEditingController(text: widget.transaction.amount.toString());
|
||||||
|
_merchantController = TextEditingController(text: widget.transaction.merchant);
|
||||||
|
_selectedDate = widget.transaction.date;
|
||||||
|
_selectedType = widget.transaction.type == 'income' ? db.TransactionType.income : db.TransactionType.expense;
|
||||||
|
|
||||||
|
// Set initial category name based on transaction type
|
||||||
|
if (_selectedType == db.TransactionType.expense) {
|
||||||
|
_selectedCategoryName = widget.transaction.categoryName;
|
||||||
|
} else {
|
||||||
|
_selectedCategoryName = null; // Income doesn't have a selectable category
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_amountController.dispose();
|
||||||
|
_merchantController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to show the date and time pickers
|
||||||
|
Future<void> _selectDateTime(BuildContext context) async {
|
||||||
|
// 1. Pick Date
|
||||||
|
final DateTime? pickedDate = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: _selectedDate,
|
||||||
|
firstDate: DateTime(2000),
|
||||||
|
lastDate: DateTime.now().add(const Duration(days: 365)),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (pickedDate != null) {
|
||||||
|
// If date was picked, proceed to pick time
|
||||||
|
// 2. Pick Time
|
||||||
|
final TimeOfDay? pickedTime = await showTimePicker(
|
||||||
|
context: context,
|
||||||
|
initialTime: TimeOfDay.fromDateTime(_selectedDate),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (pickedTime != null) {
|
||||||
|
// If time was also picked, combine date and time and update state
|
||||||
|
setState(() {
|
||||||
|
_selectedDate = DateTime(
|
||||||
|
pickedDate.year,
|
||||||
|
pickedDate.month,
|
||||||
|
pickedDate.day,
|
||||||
|
pickedTime.hour,
|
||||||
|
pickedTime.minute,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// If only date was picked, update state with the picked date and existing time
|
||||||
|
setState(() {
|
||||||
|
_selectedDate = DateTime(
|
||||||
|
pickedDate.year,
|
||||||
|
pickedDate.month,
|
||||||
|
pickedDate.day,
|
||||||
|
_selectedDate.hour, // Keep existing hour
|
||||||
|
_selectedDate.minute, // Keep existing minute
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to handle form submission (Update)
|
||||||
|
void _updateTransaction() async {
|
||||||
|
if (_formKey.currentState!.validate()) {
|
||||||
|
final amount = double.tryParse(_amountController.text);
|
||||||
|
if (amount == null || amount <= 0) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Пожалуйста, введите корректную положительную сумму.'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String categoryToSave;
|
||||||
|
String typeString = _selectedType == db.TransactionType.income ? 'income' : 'expense';
|
||||||
|
|
||||||
|
if (_selectedType == db.TransactionType.income) {
|
||||||
|
categoryToSave = 'Income'; // Fixed category for income
|
||||||
|
} else {
|
||||||
|
if (_selectedCategoryName == null) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Пожалуйста, выберите категорию для расхода.'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
categoryToSave = _selectedCategoryName!;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the updated transaction companion
|
||||||
|
final updatedTransaction = db.TransactionsCompanion(
|
||||||
|
id: Value(widget.transaction.id), // Include the ID for update
|
||||||
|
categoryName: Value(categoryToSave),
|
||||||
|
amount: Value(amount),
|
||||||
|
date: Value(_selectedDate),
|
||||||
|
merchant: Value(_merchantController.text),
|
||||||
|
type: Value(typeString),
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Update transaction in the database
|
||||||
|
final success = await widget.database.updateTransaction(updatedTransaction);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
// Close the dialog and return the updated transaction
|
||||||
|
if (mounted) Navigator.of(context).pop(widget.transaction.copyWith( // Return a copy with updated values
|
||||||
|
categoryName: categoryToSave,
|
||||||
|
amount: amount,
|
||||||
|
date: _selectedDate,
|
||||||
|
merchant: _merchantController.text,
|
||||||
|
type: typeString,
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Не удалось обновить транзакцию.'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print('Error updating transaction: $e');
|
||||||
|
if (mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Ошибка при обновлении транзакции: $e'),
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final isDark = theme.brightness == Brightness.dark;
|
||||||
|
final bool isIncome = _selectedType == db.TransactionType.income;
|
||||||
|
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Редактировать транзакцию'),
|
||||||
|
content: SingleChildScrollView( // Use SingleChildScrollView for content
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
// --- Transaction Type Selector ---
|
||||||
|
Center(
|
||||||
|
child: ToggleButtons(
|
||||||
|
isSelected: [!isIncome, isIncome],
|
||||||
|
onPressed: (int index) {
|
||||||
|
setState(() {
|
||||||
|
_selectedType = index == 0 ? db.TransactionType.expense : db.TransactionType.income;
|
||||||
|
// Reset category selection if switching to income
|
||||||
|
if (_selectedType == db.TransactionType.income) {
|
||||||
|
_selectedCategoryName = null;
|
||||||
|
} else {
|
||||||
|
// If switching to expense, try to select the first expense category
|
||||||
|
// This relies on the StreamBuilder below to update the dropdown
|
||||||
|
// and potentially set a default if _selectedCategoryName is null.
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
// ИЗМЕНЕНО: Уменьшена минимальная ширина кнопок
|
||||||
|
constraints: BoxConstraints(minWidth: (MediaQuery.of(context).size.width - 160) / 2, minHeight: 40), // Adjusted width for dialog
|
||||||
|
selectedColor: Colors.white,
|
||||||
|
fillColor: isIncome ? Colors.green.shade400 : Colors.red.shade400,
|
||||||
|
color: isDark ? Colors.white70 : Colors.black54,
|
||||||
|
selectedBorderColor: isIncome ? Colors.green.shade600 : Colors.red.shade600,
|
||||||
|
borderColor: isDark ? Colors.grey.shade600 : Colors.grey.shade400,
|
||||||
|
children: const <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [ Icon(Icons.arrow_upward_rounded, size: 18), SizedBox(width: 8), Text('Расход'), ],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [ Icon(Icons.arrow_downward_rounded, size: 18), SizedBox(width: 8), Text('Доход'), ],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// --- Amount Field ---
|
||||||
|
TextFormField(
|
||||||
|
controller: _amountController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Сумма',
|
||||||
|
prefixIcon: Icon(Icons.attach_money, color: isIncome ? Colors.green : theme.colorScheme.primary),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
),
|
||||||
|
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Пожалуйста, введите сумму';
|
||||||
|
}
|
||||||
|
if (double.tryParse(value) == null || double.parse(value) <= 0) {
|
||||||
|
return 'Пожалуйста, введите корректное положительное число';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
|
// --- Category Dropdown (Only for Expenses, uses StreamBuilder) ---
|
||||||
|
if (!isIncome)
|
||||||
|
StreamBuilder<List<db.CategoryDb>>(
|
||||||
|
stream: widget.categoriesStream,
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting && !snapshot.hasData) {
|
||||||
|
return const Center(child: CircularProgressIndicator(strokeWidth: 2));
|
||||||
|
}
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Text('Ошибка загрузки категорий: ${snapshot.error}');
|
||||||
|
}
|
||||||
|
|
||||||
|
final categoriesFromDb = snapshot.data ?? [];
|
||||||
|
// Filter out 'Income' category for the dropdown
|
||||||
|
final expenseCategories = categoriesFromDb.where((c) => c.name != 'Income').toList();
|
||||||
|
|
||||||
|
// Ensure _selectedCategoryName is valid or reset it
|
||||||
|
if (_selectedCategoryName != null && !expenseCategories.any((c) => c.name == _selectedCategoryName)) {
|
||||||
|
_selectedCategoryName = null; // Reset if selected category is no longer valid
|
||||||
|
}
|
||||||
|
// Set default selection if nothing is selected and list is not empty
|
||||||
|
// This handles the case when switching from Income to Expense
|
||||||
|
if (_selectedCategoryName == null && expenseCategories.isNotEmpty) {
|
||||||
|
// Use WidgetsBinding to schedule state update after build
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
if (mounted) { // Check if widget is still mounted
|
||||||
|
setState(() {
|
||||||
|
_selectedCategoryName = expenseCategories[0].name;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return DropdownButtonFormField<String>(
|
||||||
|
value: _selectedCategoryName,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Категория',
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 16.0),
|
||||||
|
),
|
||||||
|
items: expenseCategories.map((db.CategoryDb category) {
|
||||||
|
final iconData = CategoryUtils.getIconFromString(category.icon);
|
||||||
|
final colorData = Color(category.color);
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: category.name,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(iconData, color: colorData, size: 20),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Text(category.name),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (String? newValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCategoryName = newValue;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
validator: (value) {
|
||||||
|
if (_selectedType == db.TransactionType.expense && value == null) {
|
||||||
|
return 'Пожалуйста, выберите категорию';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (!isIncome) const SizedBox(height: 16),
|
||||||
|
|
||||||
|
// --- Date and Time Picker ---
|
||||||
|
InkWell(
|
||||||
|
onTap: () => _selectDateTime(context),
|
||||||
|
child: InputDecorator(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Дата и время',
|
||||||
|
prefixIcon: const Icon(Icons.calendar_today_outlined),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
DateFormat.yMMMd().add_jm().format(_selectedDate),
|
||||||
|
style: theme.textTheme.bodyLarge,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
|
// --- Merchant / Source Field ---
|
||||||
|
TextFormField(
|
||||||
|
controller: _merchantController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: isIncome ? 'Источник' : 'Продавец / Магазин',
|
||||||
|
prefixIcon: Icon(isIncome ? Icons.source_outlined : Icons.storefront_outlined),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
filled: true,
|
||||||
|
fillColor: isDark ? Colors.grey.shade800.withOpacity(0.5) : Colors.grey.shade100,
|
||||||
|
),
|
||||||
|
textCapitalization: TextCapitalization.words,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(), // Close dialog
|
||||||
|
child: const Text('Отмена'),
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: _updateTransaction, // Call update function
|
||||||
|
child: const Text('Сохранить'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ExpandableSection extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
final bool isExpanded;
|
||||||
|
final VoidCallback onTap;
|
||||||
|
final Widget child;
|
||||||
|
final Animation<double> heightFactor;
|
||||||
|
|
||||||
|
const ExpandableSection({
|
||||||
|
Key? key,
|
||||||
|
required this.title,
|
||||||
|
required this.icon,
|
||||||
|
required this.isExpanded,
|
||||||
|
required this.onTap,
|
||||||
|
required this.heightFactor,
|
||||||
|
required this.child,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: const EdgeInsets.fromLTRB(16, 8, 16, 0),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isDark ? Colors.grey.shade800 : Colors.green.shade100,
|
||||||
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: const Radius.circular(16),
|
||||||
|
bottom: Radius.circular(isExpanded ? 0 : 16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
color: isDark ? Colors.green.shade300 : Colors.green.shade800,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isDark ? Colors.green.shade300 : Colors.green.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
AnimatedRotation(
|
||||||
|
turns: isExpanded ? 0.5 : 0,
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
child: Icon(
|
||||||
|
Icons.keyboard_arrow_down,
|
||||||
|
color: isDark ? Colors.green.shade300 : Colors.green.shade800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AnimatedBuilder(
|
||||||
|
animation: heightFactor,
|
||||||
|
builder: (context, innerChild) {
|
||||||
|
return ClipRect(
|
||||||
|
child: Align(
|
||||||
|
heightFactor: heightFactor.value,
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.fromLTRB(16, 0, 16, 0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isDark ? const Color(0xFF1E1E1E) : Colors.white,
|
||||||
|
borderRadius: const BorderRadius.vertical(
|
||||||
|
bottom: Radius.circular(16),
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: isDark
|
||||||
|
? Colors.black.withOpacity(0.3)
|
||||||
|
: Colors.green.withOpacity(0.1),
|
||||||
|
blurRadius: 8,
|
||||||
|
offset: const Offset(0, 4),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: innerChild,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class FilterChipWidget extends StatelessWidget {
|
||||||
|
final String label;
|
||||||
|
final bool isSelected;
|
||||||
|
final VoidCallback onTap;
|
||||||
|
|
||||||
|
const FilterChipWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.label,
|
||||||
|
required this.isSelected,
|
||||||
|
required this.onTap,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(right: 8),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), // Smaller padding
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: isSelected
|
||||||
|
? (isDark ? Colors.green.shade700 : Colors.green.shade100)
|
||||||
|
: (isDark ? Colors.grey.shade800 : Colors.grey.shade200),
|
||||||
|
borderRadius: BorderRadius.circular(14), // Smaller radius
|
||||||
|
border: isSelected
|
||||||
|
? Border.all(
|
||||||
|
color: isDark ? Colors.green.shade300 : Colors.green,
|
||||||
|
width: 1,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12, // Smaller text
|
||||||
|
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
||||||
|
color: isSelected
|
||||||
|
? (isDark ? Colors.white : Colors.green.shade700)
|
||||||
|
: (isDark ? Colors.white70 : Colors.grey.shade700),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,318 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
|
import 'package:intl/intl.dart'; // For number formatting
|
||||||
|
|
||||||
|
import '../models/category.dart'; // Keep using the Category model for UI structure
|
||||||
|
|
||||||
|
// Changed to StatefulWidget to manage its own selection state
|
||||||
|
class SpendingPieChart extends StatefulWidget {
|
||||||
|
final List<Category> categories; // Expect List<Category> from database calculation
|
||||||
|
final double totalExpenses;
|
||||||
|
final Animation<double> animation; // For fade/scale animation
|
||||||
|
|
||||||
|
const SpendingPieChart({
|
||||||
|
Key? key,
|
||||||
|
required this.categories,
|
||||||
|
required this.totalExpenses,
|
||||||
|
required this.animation,
|
||||||
|
// Removed selectedPieIndex and onSelectPieCategory
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SpendingPieChart> createState() => _SpendingPieChartState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SpendingPieChartState extends State<SpendingPieChart> {
|
||||||
|
// State for the selected index is now managed internally
|
||||||
|
int _selectedPieIndex = -1;
|
||||||
|
|
||||||
|
// Handles selection logic internally
|
||||||
|
void _handlePieTap(int index) {
|
||||||
|
setState(() {
|
||||||
|
// If the same index is selected, deselect (-1), otherwise select the new index
|
||||||
|
_selectedPieIndex = (_selectedPieIndex == index) ? -1 : index;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final currencyFormatter = NumberFormat.currency(locale: 'en_US', symbol: '\$'); // Or your preferred locale/symbol
|
||||||
|
|
||||||
|
// Handle the case where there are no categories to display
|
||||||
|
if (widget.categories.isEmpty) {
|
||||||
|
return AnimatedBuilder( // Still use animation for consistency
|
||||||
|
animation: widget.animation,
|
||||||
|
builder: (context, child) => Opacity(
|
||||||
|
opacity: widget.animation.value,
|
||||||
|
child: Container(
|
||||||
|
height: 230, // Maintain similar height to the chart version
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Text(
|
||||||
|
'No spending data for this period.',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: theme.textTheme.bodyMedium?.copyWith(color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use AnimatedBuilder to apply the fade/scale animation
|
||||||
|
return AnimatedBuilder(
|
||||||
|
animation: widget.animation,
|
||||||
|
builder: (context, child) {
|
||||||
|
return Transform.scale(
|
||||||
|
scale: widget.animation.value, // Apply scale animation
|
||||||
|
child: Opacity(
|
||||||
|
opacity: widget.animation.value, // Apply fade animation
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0), // Reduced vertical padding
|
||||||
|
height: 230, // Fixed height for the chart and legend area
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
// --- Pie Chart ---
|
||||||
|
Expanded(
|
||||||
|
flex: 5, // Give more space to the chart itself
|
||||||
|
child: Stack( // Use Stack to overlay text on the chart center
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
PieChart(
|
||||||
|
PieChartData(
|
||||||
|
// Handle touch events on the pie chart
|
||||||
|
pieTouchData: PieTouchData(
|
||||||
|
touchCallback: (FlTouchEvent event, PieTouchResponse? pieTouchResponse) {
|
||||||
|
// We are only interested in TapUp events to trigger selection changes
|
||||||
|
if (event is FlTapUpEvent) {
|
||||||
|
final section = pieTouchResponse?.touchedSection;
|
||||||
|
if (section != null) {
|
||||||
|
// Tap occurred ON a section
|
||||||
|
final touchedIndex = section.touchedSectionIndex;
|
||||||
|
// Use internal handler to update state
|
||||||
|
_handlePieTap(touchedIndex);
|
||||||
|
} else {
|
||||||
|
// Tap occurred OUTSIDE any section
|
||||||
|
// Deselect if something was selected
|
||||||
|
if (_selectedPieIndex != -1) {
|
||||||
|
_handlePieTap(-1); // Pass -1 to deselect
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
borderData: FlBorderData(show: false), // No border around the chart
|
||||||
|
sectionsSpace: 2, // Space between slices
|
||||||
|
centerSpaceRadius: 50, // Radius of the center hole
|
||||||
|
sections: _generatePieSections(context), // Generate slices data
|
||||||
|
startDegreeOffset: -90, // Start chart from the top (12 o'clock)
|
||||||
|
),
|
||||||
|
// Optional animation when data changes
|
||||||
|
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||||
|
swapAnimationCurve: Curves.easeInOut,
|
||||||
|
),
|
||||||
|
// --- Center Text (Displayed when a slice is selected) ---
|
||||||
|
if (_selectedPieIndex != -1)
|
||||||
|
_buildCenterText(context, currencyFormatter)
|
||||||
|
else // Optional: Display total or default text when nothing is selected
|
||||||
|
_buildDefaultCenterText(context, currencyFormatter),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8), // Spacing between chart and legend
|
||||||
|
|
||||||
|
// --- Legend ---
|
||||||
|
Expanded(
|
||||||
|
flex: 4, // Allocate space for the legend
|
||||||
|
// Use ListView for scrollable legend if many categories
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: widget.categories.length,
|
||||||
|
padding: const EdgeInsets.only(right: 8), // Padding for legend items
|
||||||
|
itemBuilder: (context, index) => _buildPieLegendItem(context, index),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Builds the text displayed in the center when a slice is selected
|
||||||
|
Widget _buildCenterText(BuildContext context, NumberFormat formatter) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
// Check if selectedPieIndex is valid before accessing categories
|
||||||
|
if (_selectedPieIndex < 0 || _selectedPieIndex >= widget.categories.length) {
|
||||||
|
// Return an empty container or default text if index is invalid
|
||||||
|
return _buildDefaultCenterText(context, formatter);
|
||||||
|
}
|
||||||
|
final selectedCategory = widget.categories[_selectedPieIndex];
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
selectedCategory.name,
|
||||||
|
style: theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: theme.textTheme.bodyLarge?.color?.withOpacity(0.8),
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
formatter.format(selectedCategory.amount), // Format the amount as currency
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: selectedCategory.colorCode, // Use category color for amount
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Builds the default text displayed in the center when no slice is selected
|
||||||
|
Widget _buildDefaultCenterText(BuildContext context, NumberFormat formatter) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Total', // Label for the total amount
|
||||||
|
style: theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: theme.textTheme.bodyLarge?.color?.withOpacity(0.7),
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
formatter.format(widget.totalExpenses), // Display total expenses
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: theme.textTheme.bodyLarge?.color // Use default text color
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Builds a single item for the legend
|
||||||
|
Widget _buildPieLegendItem(BuildContext context, int index) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final isSelected = index == _selectedPieIndex; // Check if this item is selected using internal state
|
||||||
|
// Check if index is valid before accessing categories
|
||||||
|
if (index < 0 || index >= widget.categories.length) {
|
||||||
|
return const SizedBox.shrink(); // Return empty if index is invalid
|
||||||
|
}
|
||||||
|
final category = widget.categories[index];
|
||||||
|
// Calculate percentage, handle totalExpenses being zero
|
||||||
|
final percentage = widget.totalExpenses > 0 ? (category.amount / widget.totalExpenses * 100) : 0.0;
|
||||||
|
|
||||||
|
// Use InkWell for tap feedback and GestureDetector for tap logic
|
||||||
|
return InkWell(
|
||||||
|
onTap: () => _handlePieTap(index), // Use internal handler on tap
|
||||||
|
borderRadius: BorderRadius.circular(8), // Match border radius
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 200), // Animation for selection change
|
||||||
|
margin: const EdgeInsets.symmetric(vertical: 3.0), // Spacing between legend items
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0), // Padding inside item
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// Highlight background if selected
|
||||||
|
color: isSelected
|
||||||
|
? category.colorCode.withOpacity(isDark ? 0.3 : 0.15)
|
||||||
|
: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
// Add border if selected
|
||||||
|
border: Border.all(
|
||||||
|
color: isSelected ? category.colorCode.withOpacity(0.8) : Colors.transparent,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
// Color indicator dot
|
||||||
|
Container(
|
||||||
|
width: 10,
|
||||||
|
height: 10,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: category.colorCode.withOpacity(isDark ? 0.9 : 1.0), // Use category color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8), // Spacing
|
||||||
|
// Category name
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
category.name,
|
||||||
|
style: theme.textTheme.bodyMedium?.copyWith(
|
||||||
|
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, // Bold if selected
|
||||||
|
color: theme.textTheme.bodyLarge?.color, // Use default body text color
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis, // Prevent long names from wrapping
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8), // Spacing
|
||||||
|
// Percentage text
|
||||||
|
Text(
|
||||||
|
'${percentage.toStringAsFixed(1)}%', // Format percentage
|
||||||
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
|
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, // Bold if selected
|
||||||
|
color: theme.textTheme.bodyMedium?.color?.withOpacity(0.7), // Slightly faded color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generates the data for each slice (PieChartSectionData) of the pie chart
|
||||||
|
List<PieChartSectionData> _generatePieSections(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
|
return List.generate(widget.categories.length, (i) {
|
||||||
|
// Check if index is valid before accessing categories
|
||||||
|
if (i < 0 || i >= widget.categories.length) {
|
||||||
|
// This should ideally not happen if List.generate is used correctly,
|
||||||
|
// but adding a safeguard.
|
||||||
|
return PieChartSectionData(); // Return an empty section
|
||||||
|
}
|
||||||
|
final isTouched = i == _selectedPieIndex; // Check if this slice is selected using internal state
|
||||||
|
// Make selected slice slightly larger
|
||||||
|
final double radius = isTouched ? 65 : 55;
|
||||||
|
// Make title font slightly larger when selected
|
||||||
|
final double titleFontSize = isTouched ? 14 : 12;
|
||||||
|
final category = widget.categories[i];
|
||||||
|
// Calculate percentage for the title
|
||||||
|
final percentage = widget.totalExpenses > 0 ? (category.amount / widget.totalExpenses * 100) : 0;
|
||||||
|
|
||||||
|
return PieChartSectionData(
|
||||||
|
color: category.colorCode.withOpacity(isDark ? 0.85 : 1.0), // Use category color
|
||||||
|
value: category.amount, // Value determines the slice size
|
||||||
|
title: '${percentage.toStringAsFixed(0)}%', // Display percentage as title
|
||||||
|
radius: radius, // Apply radius (larger if touched)
|
||||||
|
titleStyle: TextStyle(
|
||||||
|
fontSize: titleFontSize, // Apply font size (larger if touched)
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white.withOpacity(0.9), // White text for contrast on colored slices
|
||||||
|
shadows: const [Shadow(color: Colors.black38, blurRadius: 2)], // Subtle shadow for readability
|
||||||
|
),
|
||||||
|
// Add border to selected slice for emphasis
|
||||||
|
borderSide: isTouched
|
||||||
|
? BorderSide(color: isDark ? Colors.white60 : Colors.black54, width: 2)
|
||||||
|
: BorderSide(color: category.colorCode.withOpacity(0.5), width: 1),
|
||||||
|
// Optional: Add badge (icon) to the selected slice
|
||||||
|
// badgeWidget: isTouched ? Icon(category.icon, color: Colors.white, size: 16) : null,
|
||||||
|
// badgePositionPercentageOffset: .98,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SummaryItem extends StatelessWidget {
|
||||||
|
final IconData icon;
|
||||||
|
final String title;
|
||||||
|
final String amount;
|
||||||
|
final Color color;
|
||||||
|
|
||||||
|
const SummaryItem({
|
||||||
|
Key? key,
|
||||||
|
required this.icon,
|
||||||
|
required this.title,
|
||||||
|
required this.amount,
|
||||||
|
required this.color,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
icon,
|
||||||
|
size: 16,
|
||||||
|
color: isDark ? color.withOpacity(0.8) : color,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: isDark ? Colors.grey.shade400 : Colors.grey.shade700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
amount,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isDark ? Colors.white : Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart'; // For date formatting
|
||||||
|
|
||||||
|
import '../models/transaction_record.dart'; // Use the model class
|
||||||
|
|
||||||
|
class TransactionListItem extends StatelessWidget {
|
||||||
|
final TransactionRecord transaction; // Use the model class
|
||||||
|
final VoidCallback? onEdit; // Callback for edit action
|
||||||
|
final VoidCallback? onDelete; // Callback for delete action
|
||||||
|
|
||||||
|
const TransactionListItem({
|
||||||
|
Key? key,
|
||||||
|
required this.transaction,
|
||||||
|
this.onEdit, // Make callbacks optional
|
||||||
|
this.onDelete,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
// Function to show the options menu
|
||||||
|
void _showOptionsMenu(BuildContext context) {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return SafeArea( // Use SafeArea to avoid system UI
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min, // Take minimum space
|
||||||
|
children: <Widget>[
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.edit_outlined),
|
||||||
|
title: const Text('Редактировать'),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context); // Close the bottom sheet
|
||||||
|
onEdit?.call(); // Call the edit callback if it exists
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.delete_outline, color: Colors.red),
|
||||||
|
title: const Text('Удалить', style: TextStyle(color: Colors.red)),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context); // Close the bottom sheet
|
||||||
|
onDelete?.call(); // Call the delete callback if it exists
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// Optional: Add a Cancel button
|
||||||
|
ListTile(
|
||||||
|
leading: const Icon(Icons.cancel_outlined),
|
||||||
|
title: const Text('Отмена'),
|
||||||
|
onTap: () => Navigator.pop(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final isExpense = transaction.type == 'expense';
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
|
||||||
|
// Wrap the ListTile in an InkWell to handle long press
|
||||||
|
return InkWell(
|
||||||
|
onLongPress: () => _showOptionsMenu(context), // Show menu on long press
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0), // Adjusted padding
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
// Category Icon (only for expenses)
|
||||||
|
if (isExpense && transaction.category != null)
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: transaction.category!.colorCode.withOpacity(0.1), // Use category color
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
transaction.category!.iconCode, // Use category icon
|
||||||
|
color: transaction.category!.colorCode,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else if (!isExpense) // Icon for Income
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.green.shade100, // Specific color for income icon background
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.attach_money_outlined, // Specific icon for income
|
||||||
|
color: Colors.green.shade700,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16), // Space between icon and text
|
||||||
|
|
||||||
|
// Transaction Details (Category/Merchant, Date)
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
isExpense ? transaction.merchant : transaction.merchant, // Display merchant for both for now
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.w500, // Medium weight
|
||||||
|
),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis, // Prevent overflow
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
// Display category name for expense, or 'Income' for income
|
||||||
|
isExpense ? transaction.category?.name ?? 'Unknown Category' : 'Income',
|
||||||
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
|
color: theme.textTheme.bodySmall?.color?.withOpacity(0.7), // Subtle color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// Amount and Date
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${isExpense ? '-' : '+'} \$${NumberFormat.currency(symbol: '', decimalDigits: 2).format(transaction.amount)}', // Format amount with sign
|
||||||
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: isExpense ? Colors.red.shade600 : Colors.green.shade600, // Color based on type
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
DateFormat('MMM d, yyyy').format(transaction.date), // Format date
|
||||||
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
|
color: theme.textTheme.bodySmall?.color?.withOpacity(0.7), // Subtle color
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
flutter/ephemeral
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Project-level configuration.
|
||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# The name of the executable created for the application. Change this to change
|
||||||
|
# the on-disk name of your application.
|
||||||
|
set(BINARY_NAME "finance_app_2")
|
||||||
|
# The unique GTK application identifier for this application. See:
|
||||||
|
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
|
||||||
|
set(APPLICATION_ID "ru.sanders.finance_app_2")
|
||||||
|
|
||||||
|
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
|
||||||
|
# versions of CMake.
|
||||||
|
cmake_policy(SET CMP0063 NEW)
|
||||||
|
|
||||||
|
# Load bundled libraries from the lib/ directory relative to the binary.
|
||||||
|
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
|
||||||
|
|
||||||
|
# Root filesystem for cross-building.
|
||||||
|
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
|
||||||
|
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Define build configuration options.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug" CACHE
|
||||||
|
STRING "Flutter build mode" FORCE)
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||||
|
"Debug" "Profile" "Release")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Compilation settings that should be applied to most targets.
|
||||||
|
#
|
||||||
|
# Be cautious about adding new options here, as plugins use this function by
|
||||||
|
# default. In most cases, you should add new options to specific targets instead
|
||||||
|
# of modifying this function.
|
||||||
|
function(APPLY_STANDARD_SETTINGS TARGET)
|
||||||
|
target_compile_features(${TARGET} PUBLIC cxx_std_14)
|
||||||
|
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
|
||||||
|
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
|
||||||
|
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Flutter library and tool build rules.
|
||||||
|
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
|
||||||
|
add_subdirectory(${FLUTTER_MANAGED_DIR})
|
||||||
|
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
|
||||||
|
# Application build; see runner/CMakeLists.txt.
|
||||||
|
add_subdirectory("runner")
|
||||||
|
|
||||||
|
# Run the Flutter tool portions of the build. This must not be removed.
|
||||||
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
||||||
|
|
||||||
|
# Only the install-generated bundle's copy of the executable will launch
|
||||||
|
# correctly, since the resources must in the right relative locations. To avoid
|
||||||
|
# people trying to run the unbundled copy, put it in a subdirectory instead of
|
||||||
|
# the default top-level location.
|
||||||
|
set_target_properties(${BINARY_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Generated plugin build rules, which manage building the plugins and adding
|
||||||
|
# them to the application.
|
||||||
|
include(flutter/generated_plugins.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
# === Installation ===
|
||||||
|
# By default, "installing" just makes a relocatable bundle in the build
|
||||||
|
# directory.
|
||||||
|
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
|
||||||
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Start with a clean build bundle directory every time.
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
|
||||||
|
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
|
||||||
|
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
|
|
||||||
|
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
|
||||||
|
install(FILES "${bundled_library}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endforeach(bundled_library)
|
||||||
|
|
||||||
|
# Copy the native assets provided by the build.dart from all packages.
|
||||||
|
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
|
||||||
|
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
|
||||||
|
# Fully re-copy the assets directory on each build to avoid having stale files
|
||||||
|
# from a previous install.
|
||||||
|
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
|
||||||
|
install(CODE "
|
||||||
|
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
|
||||||
|
" COMPONENT Runtime)
|
||||||
|
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
|
||||||
|
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
|
||||||
|
|
||||||
|
# Install the AOT library on non-Debug builds only.
|
||||||
|
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
|
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
|
||||||
|
COMPONENT Runtime)
|
||||||
|
endif()
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
# This file controls Flutter-level build steps. It should not be edited.
|
||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
|
||||||
|
|
||||||
|
# Configuration provided via flutter tool.
|
||||||
|
include(${EPHEMERAL_DIR}/generated_config.cmake)
|
||||||
|
|
||||||
|
# TODO: Move the rest of this into files in ephemeral. See
|
||||||
|
# https://github.com/flutter/flutter/issues/57146.
|
||||||
|
|
||||||
|
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
|
||||||
|
# which isn't available in 3.10.
|
||||||
|
function(list_prepend LIST_NAME PREFIX)
|
||||||
|
set(NEW_LIST "")
|
||||||
|
foreach(element ${${LIST_NAME}})
|
||||||
|
list(APPEND NEW_LIST "${PREFIX}${element}")
|
||||||
|
endforeach(element)
|
||||||
|
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# === Flutter Library ===
|
||||||
|
# System-level dependencies.
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
|
||||||
|
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
|
||||||
|
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
|
||||||
|
|
||||||
|
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
|
||||||
|
|
||||||
|
# Published to parent scope for install step.
|
||||||
|
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
|
||||||
|
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
|
||||||
|
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
|
||||||
|
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_LIBRARY_HEADERS
|
||||||
|
"fl_basic_message_channel.h"
|
||||||
|
"fl_binary_codec.h"
|
||||||
|
"fl_binary_messenger.h"
|
||||||
|
"fl_dart_project.h"
|
||||||
|
"fl_engine.h"
|
||||||
|
"fl_json_message_codec.h"
|
||||||
|
"fl_json_method_codec.h"
|
||||||
|
"fl_message_codec.h"
|
||||||
|
"fl_method_call.h"
|
||||||
|
"fl_method_channel.h"
|
||||||
|
"fl_method_codec.h"
|
||||||
|
"fl_method_response.h"
|
||||||
|
"fl_plugin_registrar.h"
|
||||||
|
"fl_plugin_registry.h"
|
||||||
|
"fl_standard_message_codec.h"
|
||||||
|
"fl_standard_method_codec.h"
|
||||||
|
"fl_string_codec.h"
|
||||||
|
"fl_value.h"
|
||||||
|
"fl_view.h"
|
||||||
|
"flutter_linux.h"
|
||||||
|
)
|
||||||
|
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
|
||||||
|
add_library(flutter INTERFACE)
|
||||||
|
target_include_directories(flutter INTERFACE
|
||||||
|
"${EPHEMERAL_DIR}"
|
||||||
|
)
|
||||||
|
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
|
||||||
|
target_link_libraries(flutter INTERFACE
|
||||||
|
PkgConfig::GTK
|
||||||
|
PkgConfig::GLIB
|
||||||
|
PkgConfig::GIO
|
||||||
|
)
|
||||||
|
add_dependencies(flutter flutter_assemble)
|
||||||
|
|
||||||
|
# === Flutter tool backend ===
|
||||||
|
# _phony_ is a non-existent file to force this command to run every time,
|
||||||
|
# since currently there's no way to get a full input/output list from the
|
||||||
|
# flutter tool.
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/_phony_
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env
|
||||||
|
${FLUTTER_TOOL_ENVIRONMENT}
|
||||||
|
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
|
||||||
|
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
add_custom_target(flutter_assemble DEPENDS
|
||||||
|
"${FLUTTER_LIBRARY}"
|
||||||
|
${FLUTTER_LIBRARY_HEADERS}
|
||||||
|
)
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
|
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
||||||
|
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
#ifndef GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
#define GENERATED_PLUGIN_REGISTRANT_
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
|
||||||
|
// Registers Flutter plugins.
|
||||||
|
void fl_register_plugins(FlPluginRegistry* registry);
|
||||||
|
|
||||||
|
#endif // GENERATED_PLUGIN_REGISTRANT_
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Generated file, do not edit.
|
||||||
|
#
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
sqlite3_flutter_libs
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||||
|
|
||||||
|
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||||
|
endforeach(plugin)
|
||||||
|
|
||||||
|
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||||
|
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||||
|
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||||
|
endforeach(ffi_plugin)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(runner LANGUAGES CXX)
|
||||||
|
|
||||||
|
# Define the application target. To change its name, change BINARY_NAME in the
|
||||||
|
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
||||||
|
# work.
|
||||||
|
#
|
||||||
|
# Any new source files that you add to the application should be added here.
|
||||||
|
add_executable(${BINARY_NAME}
|
||||||
|
"main.cc"
|
||||||
|
"my_application.cc"
|
||||||
|
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Apply the standard set of build settings. This can be removed for applications
|
||||||
|
# that need different build settings.
|
||||||
|
apply_standard_settings(${BINARY_NAME})
|
||||||
|
|
||||||
|
# Add preprocessor definitions for the application ID.
|
||||||
|
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
|
||||||
|
|
||||||
|
# Add dependency libraries. Add any application-specific dependencies here.
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
|
||||||
|
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
|
||||||
|
|
||||||
|
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
g_autoptr(MyApplication) app = my_application_new();
|
||||||
|
return g_application_run(G_APPLICATION(app), argc, argv);
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
#include "my_application.h"
|
||||||
|
|
||||||
|
#include <flutter_linux/flutter_linux.h>
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
#include <gdk/gdkx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "flutter/generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
struct _MyApplication {
|
||||||
|
GtkApplication parent_instance;
|
||||||
|
char** dart_entrypoint_arguments;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
|
||||||
|
|
||||||
|
// Implements GApplication::activate.
|
||||||
|
static void my_application_activate(GApplication* application) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
GtkWindow* window =
|
||||||
|
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
|
||||||
|
|
||||||
|
// Use a header bar when running in GNOME as this is the common style used
|
||||||
|
// by applications and is the setup most users will be using (e.g. Ubuntu
|
||||||
|
// desktop).
|
||||||
|
// If running on X and not using GNOME then just use a traditional title bar
|
||||||
|
// in case the window manager does more exotic layout, e.g. tiling.
|
||||||
|
// If running on Wayland assume the header bar will work (may need changing
|
||||||
|
// if future cases occur).
|
||||||
|
gboolean use_header_bar = TRUE;
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
|
GdkScreen* screen = gtk_window_get_screen(window);
|
||||||
|
if (GDK_IS_X11_SCREEN(screen)) {
|
||||||
|
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
|
||||||
|
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
|
||||||
|
use_header_bar = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (use_header_bar) {
|
||||||
|
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
|
||||||
|
gtk_widget_show(GTK_WIDGET(header_bar));
|
||||||
|
gtk_header_bar_set_title(header_bar, "finance_app_2");
|
||||||
|
gtk_header_bar_set_show_close_button(header_bar, TRUE);
|
||||||
|
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
|
||||||
|
} else {
|
||||||
|
gtk_window_set_title(window, "finance_app_2");
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_window_set_default_size(window, 1280, 720);
|
||||||
|
gtk_widget_show(GTK_WIDGET(window));
|
||||||
|
|
||||||
|
g_autoptr(FlDartProject) project = fl_dart_project_new();
|
||||||
|
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
|
||||||
|
|
||||||
|
FlView* view = fl_view_new(project);
|
||||||
|
gtk_widget_show(GTK_WIDGET(view));
|
||||||
|
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
|
||||||
|
|
||||||
|
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
|
||||||
|
|
||||||
|
gtk_widget_grab_focus(GTK_WIDGET(view));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::local_command_line.
|
||||||
|
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
|
||||||
|
MyApplication* self = MY_APPLICATION(application);
|
||||||
|
// Strip out the first argument as it is the binary name.
|
||||||
|
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
|
||||||
|
|
||||||
|
g_autoptr(GError) error = nullptr;
|
||||||
|
if (!g_application_register(application, nullptr, &error)) {
|
||||||
|
g_warning("Failed to register: %s", error->message);
|
||||||
|
*exit_status = 1;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_application_activate(application);
|
||||||
|
*exit_status = 0;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::startup.
|
||||||
|
static void my_application_startup(GApplication* application) {
|
||||||
|
//MyApplication* self = MY_APPLICATION(object);
|
||||||
|
|
||||||
|
// Perform any actions required at application startup.
|
||||||
|
|
||||||
|
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GApplication::shutdown.
|
||||||
|
static void my_application_shutdown(GApplication* application) {
|
||||||
|
//MyApplication* self = MY_APPLICATION(object);
|
||||||
|
|
||||||
|
// Perform any actions required at application shutdown.
|
||||||
|
|
||||||
|
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implements GObject::dispose.
|
||||||
|
static void my_application_dispose(GObject* object) {
|
||||||
|
MyApplication* self = MY_APPLICATION(object);
|
||||||
|
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
|
||||||
|
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_class_init(MyApplicationClass* klass) {
|
||||||
|
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
|
||||||
|
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
|
||||||
|
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
|
||||||
|
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
|
||||||
|
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void my_application_init(MyApplication* self) {}
|
||||||
|
|
||||||
|
MyApplication* my_application_new() {
|
||||||
|
// Set the program name to the application ID, which helps various systems
|
||||||
|
// like GTK and desktop environments map this running application to its
|
||||||
|
// corresponding .desktop file. This ensures better integration by allowing
|
||||||
|
// the application to be recognized beyond its binary name.
|
||||||
|
g_set_prgname(APPLICATION_ID);
|
||||||
|
|
||||||
|
return MY_APPLICATION(g_object_new(my_application_get_type(),
|
||||||
|
"application-id", APPLICATION_ID,
|
||||||
|
"flags", G_APPLICATION_NON_UNIQUE,
|
||||||
|
nullptr));
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef FLUTTER_MY_APPLICATION_H_
|
||||||
|
#define FLUTTER_MY_APPLICATION_H_
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
|
||||||
|
GtkApplication)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* my_application_new:
|
||||||
|
*
|
||||||
|
* Creates a new Flutter-based application.
|
||||||
|
*
|
||||||
|
* Returns: a new #MyApplication.
|
||||||
|
*/
|
||||||
|
MyApplication* my_application_new();
|
||||||
|
|
||||||
|
#endif // FLUTTER_MY_APPLICATION_H_
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Flutter-related
|
||||||
|
**/Flutter/ephemeral/
|
||||||
|
**/Pods/
|
||||||
|
|
||||||
|
# Xcode-related
|
||||||
|
**/dgph
|
||||||
|
**/xcuserdata/
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
//
|
||||||
|
// Generated file. Do not edit.
|
||||||
|
//
|
||||||
|
|
||||||
|
import FlutterMacOS
|
||||||
|
import Foundation
|
||||||
|
|
||||||
|
import flutter_web_auth
|
||||||
|
import path_provider_foundation
|
||||||
|
import shared_preferences_foundation
|
||||||
|
import sqlite3_flutter_libs
|
||||||
|
|
||||||
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
FlutterWebAuthPlugin.register(with: registry.registrar(forPlugin: "FlutterWebAuthPlugin"))
|
||||||
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
|
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
||||||
|
}
|
||||||
@@ -0,0 +1,705 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXAggregateTarget section */
|
||||||
|
33CC111A2044C6BA0003C045 /* Flutter Assemble */ = {
|
||||||
|
isa = PBXAggregateTarget;
|
||||||
|
buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */;
|
||||||
|
buildPhases = (
|
||||||
|
33CC111E2044C6BF0003C045 /* ShellScript */,
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = "Flutter Assemble";
|
||||||
|
productName = FLX;
|
||||||
|
};
|
||||||
|
/* End PBXAggregateTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; };
|
||||||
|
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
|
||||||
|
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
|
||||||
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||||
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||||
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 33CC10EC2044A3C60003C045;
|
||||||
|
remoteInfo = Runner;
|
||||||
|
};
|
||||||
|
33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 33CC111A2044C6BA0003C045;
|
||||||
|
remoteInfo = FLX;
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
33CC110E2044A8840003C045 /* Bundle Framework */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
name = "Bundle Framework";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
|
||||||
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
|
||||||
|
33CC10ED2044A3C60003C045 /* finance_app_2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "finance_app_2.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||||
|
33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; };
|
||||||
|
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; };
|
||||||
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||||
|
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||||
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
331C80D2294CF70F00263BE5 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10EA2044A3C60003C045 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
331C80D6294CF71000263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C80D7294CF71000263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33BA886A226E78AF003329D5 /* Configs */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
333000ED22D3DE5D00554162 /* Warnings.xcconfig */,
|
||||||
|
);
|
||||||
|
path = Configs;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC10E42044A3C60003C045 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33FAB671232836740065AC1E /* Runner */,
|
||||||
|
33CEB47122A05771004F2AC0 /* Flutter */,
|
||||||
|
331C80D6294CF71000263BE5 /* RunnerTests */,
|
||||||
|
33CC10EE2044A3C60003C045 /* Products */,
|
||||||
|
D73912EC22F37F3D000D13A0 /* Frameworks */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC10EE2044A3C60003C045 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10ED2044A3C60003C045 /* finance_app_2.app */,
|
||||||
|
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CC11242044D66E0003C045 /* Resources */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F22044A3C60003C045 /* Assets.xcassets */,
|
||||||
|
33CC10F42044A3C60003C045 /* MainMenu.xib */,
|
||||||
|
33CC10F72044A3C60003C045 /* Info.plist */,
|
||||||
|
);
|
||||||
|
name = Resources;
|
||||||
|
path = ..;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33CEB47122A05771004F2AC0 /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
|
||||||
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
||||||
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
||||||
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
path = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
33FAB671232836740065AC1E /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
|
||||||
|
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
|
||||||
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
|
||||||
|
33E51914231749380026EE4D /* Release.entitlements */,
|
||||||
|
33CC11242044D66E0003C045 /* Resources */,
|
||||||
|
33BA886A226E78AF003329D5 /* Configs */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
);
|
||||||
|
name = Frameworks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
331C80D4294CF70F00263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
331C80D1294CF70F00263BE5 /* Sources */,
|
||||||
|
331C80D2294CF70F00263BE5 /* Frameworks */,
|
||||||
|
331C80D3294CF70F00263BE5 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
331C80DA294CF71000263BE5 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = RunnerTests;
|
||||||
|
productName = RunnerTests;
|
||||||
|
productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
33CC10EC2044A3C60003C045 /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
33CC10E92044A3C60003C045 /* Sources */,
|
||||||
|
33CC10EA2044A3C60003C045 /* Frameworks */,
|
||||||
|
33CC10EB2044A3C60003C045 /* Resources */,
|
||||||
|
33CC110E2044A8840003C045 /* Bundle Framework */,
|
||||||
|
3399D490228B24CF009A79C7 /* ShellScript */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
33CC11202044C79F0003C045 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 33CC10ED2044A3C60003C045 /* finance_app_2.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
33CC10E52044A3C60003C045 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = YES;
|
||||||
|
LastSwiftUpdateCheck = 0920;
|
||||||
|
LastUpgradeCheck = 1510;
|
||||||
|
ORGANIZATIONNAME = "";
|
||||||
|
TargetAttributes = {
|
||||||
|
331C80D4294CF70F00263BE5 = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
TestTargetID = 33CC10EC2044A3C60003C045;
|
||||||
|
};
|
||||||
|
33CC10EC2044A3C60003C045 = {
|
||||||
|
CreatedOnToolsVersion = 9.2;
|
||||||
|
LastSwiftMigration = 1100;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
SystemCapabilities = {
|
||||||
|
com.apple.Sandbox = {
|
||||||
|
enabled = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
33CC111A2044C6BA0003C045 = {
|
||||||
|
CreatedOnToolsVersion = 9.2;
|
||||||
|
ProvisioningStyle = Manual;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 33CC10E42044A3C60003C045;
|
||||||
|
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
33CC10EC2044A3C60003C045 /* Runner */,
|
||||||
|
331C80D4294CF70F00263BE5 /* RunnerTests */,
|
||||||
|
33CC111A2044C6BA0003C045 /* Flutter Assemble */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
331C80D3294CF70F00263BE5 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10EB2044A3C60003C045 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
|
||||||
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3399D490228B24CF009A79C7 /* ShellScript */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
|
||||||
|
};
|
||||||
|
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
Flutter/ephemeral/FlutterInputs.xcfilelist,
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
Flutter/ephemeral/tripwire,
|
||||||
|
);
|
||||||
|
outputFileListPaths = (
|
||||||
|
Flutter/ephemeral/FlutterOutputs.xcfilelist,
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
331C80D1294CF70F00263BE5 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
33CC10E92044A3C60003C045 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */,
|
||||||
|
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */,
|
||||||
|
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
331C80DA294CF71000263BE5 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 33CC10EC2044A3C60003C045 /* Runner */;
|
||||||
|
targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
33CC11202044C79F0003C045 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */;
|
||||||
|
targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
33CC10F42044A3C60003C045 /* MainMenu.xib */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
33CC10F52044A3C60003C045 /* Base */,
|
||||||
|
);
|
||||||
|
name = MainMenu.xib;
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
331C80DB294CF71000263BE5 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/finance_app_2.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/finance_app_2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
331C80DC294CF71000263BE5 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/finance_app_2.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/finance_app_2";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
331C80DD294CF71000263BE5 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = ru.sanders.financeApp2.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/finance_app_2.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/finance_app_2";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CE9231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEAD_CODE_STRIPPING = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CEA231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
338D0CEB231458BD00FA5F75 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
33CC10F92044A3C60003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEAD_CODE_STRIPPING = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC10FA2044A3C60003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CODE_SIGN_IDENTITY = "-";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEAD_CODE_STRIPPING = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
33CC10FC2044A3C60003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC10FD2044A3C60003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/../Frameworks",
|
||||||
|
);
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
33CC111C2044C6BA0003C045 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Manual;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
33CC111D2044C6BA0003C045 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
331C80DB294CF71000263BE5 /* Debug */,
|
||||||
|
331C80DC294CF71000263BE5 /* Release */,
|
||||||
|
331C80DD294CF71000263BE5 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC10F92044A3C60003C045 /* Debug */,
|
||||||
|
33CC10FA2044A3C60003C045 /* Release */,
|
||||||
|
338D0CE9231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC10FC2044A3C60003C045 /* Debug */,
|
||||||
|
33CC10FD2044A3C60003C045 /* Release */,
|
||||||
|
338D0CEA231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
33CC111C2044C6BA0003C045 /* Debug */,
|
||||||
|
33CC111D2044C6BA0003C045 /* Release */,
|
||||||
|
338D0CEB231458BD00FA5F75 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
|
||||||
|
}
|
||||||