├── .gitignore
├── .metadata
├── .vscode
└── launch.json
├── README.md
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── devs
│ │ │ │ └── help
│ │ │ │ └── devs
│ │ │ │ └── donation_tracker
│ │ │ │ └── MainActivity.java
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── devs
│ │ │ │ └── help
│ │ │ │ └── devs
│ │ │ │ └── donation_tracker
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
└── images
│ ├── devshelpdevs-logo.svg
│ └── logo.png
├── buildweb.bat
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── Runner-Bridging-Header.h
│ └── main.m
├── lib
├── _managers
│ ├── authentication_manager.dart
│ ├── donation_manager.dart
│ └── donation_manager_logged_in.dart
├── _services
│ └── nhost_service.dart
├── constants.dart
├── graphQlRequests.dart
├── main.dart
├── models
│ ├── donation.dart
│ └── usage.dart
├── presentation
│ ├── button.dart
│ ├── dialogs.dart
│ ├── donations.dart
│ ├── edit_donation_dlg.dart
│ ├── edit_usage_dlg.dart
│ ├── select_image_dlg.dart
│ └── usage.dart
└── utils.dart
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Podfile
├── Podfile.lock
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── app_icon_1024.png
│ │ ├── app_icon_128.png
│ │ ├── app_icon_16.png
│ │ ├── app_icon_256.png
│ │ ├── app_icon_32.png
│ │ ├── app_icon_512.png
│ │ └── app_icon_64.png
│ ├── Base.lproj
│ └── MainMenu.xib
│ ├── Configs
│ ├── AppInfo.xcconfig
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── test
├── graphQL_test.dart
├── storage_test.dart
└── widget_test.dart
├── web
├── _redirects
├── favicon.ico
├── favicon.png
├── icons
│ ├── Icon-192.png
│ └── Icon-512.png
├── index.html
├── loader.css
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── ephemeral
│ ├── cpp_client_wrapper
│ │ ├── README
│ │ ├── binary_messenger_impl.h
│ │ ├── byte_buffer_streams.h
│ │ ├── byte_stream_wrappers.h
│ │ ├── core_implementations.cc
│ │ ├── engine_method_result.cc
│ │ ├── flutter_engine.cc
│ │ ├── flutter_view_controller.cc
│ │ ├── include
│ │ │ └── flutter
│ │ │ │ ├── basic_message_channel.h
│ │ │ │ ├── binary_messenger.h
│ │ │ │ ├── byte_streams.h
│ │ │ │ ├── dart_project.h
│ │ │ │ ├── encodable_value.h
│ │ │ │ ├── engine_method_result.h
│ │ │ │ ├── event_channel.h
│ │ │ │ ├── event_sink.h
│ │ │ │ ├── event_stream_handler.h
│ │ │ │ ├── event_stream_handler_functions.h
│ │ │ │ ├── flutter_engine.h
│ │ │ │ ├── flutter_view.h
│ │ │ │ ├── flutter_view_controller.h
│ │ │ │ ├── json_message_codec.h
│ │ │ │ ├── json_method_codec.h
│ │ │ │ ├── json_type.h
│ │ │ │ ├── message_codec.h
│ │ │ │ ├── method_call.h
│ │ │ │ ├── method_channel.h
│ │ │ │ ├── method_codec.h
│ │ │ │ ├── method_result.h
│ │ │ │ ├── method_result_functions.h
│ │ │ │ ├── plugin_registrar.h
│ │ │ │ ├── plugin_registrar_windows.h
│ │ │ │ ├── plugin_registry.h
│ │ │ │ ├── standard_codec_serializer.h
│ │ │ │ ├── standard_message_codec.h
│ │ │ │ ├── standard_method_codec.h
│ │ │ │ └── texture_registrar.h
│ │ ├── json_message_codec.cc
│ │ ├── json_method_codec.cc
│ │ ├── plugin_registrar.cc
│ │ ├── standard_codec.cc
│ │ ├── standard_codec_serializer.h
│ │ └── texture_registrar_impl.h
│ ├── flutter_export.h
│ ├── flutter_messenger.h
│ ├── flutter_plugin_registrar.h
│ ├── flutter_texture_registrar.h
│ ├── flutter_windows.dll
│ ├── flutter_windows.dll.lib
│ ├── flutter_windows.h
│ └── icudtl.dat
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── run_loop.cpp
├── run_loop.h
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # File used by https://detective.dev/, containing the VM service socket URL of
2 | # the currently running app
3 | detective_connect.txt
4 |
5 | # Miscellaneous
6 | *.class
7 | *.log
8 | *.pyc
9 | *.swp
10 | .DS_Store
11 | .atom/
12 | .buildlog/
13 | .history
14 | .svn/
15 |
16 | # IntelliJ related
17 | *.iml
18 | *.ipr
19 | *.iws
20 | .idea/
21 |
22 | # The .vscode folder contains launch configuration and tasks you configure in
23 | # VS Code which you may wish to be included in version control, so this line
24 | # is commented out by default.
25 | #.vscode/
26 |
27 | # Flutter/Dart/Pub related
28 | **/doc/api/
29 | **/ios/Flutter/.last_build_id
30 | .dart_tool/
31 | .flutter-plugins
32 | .flutter-plugins-dependencies
33 | .packages
34 | .pub-cache/
35 | .pub/
36 | /build/
37 |
38 | # Web related
39 | lib/generated_plugin_registrant.dart
40 |
41 | # Symbolication related
42 | app.*.symbols
43 |
44 | # Obfuscation related
45 | app.*.map.json
46 |
47 | # Android Studio will place build artifacts here
48 | /android/app/debug
49 | /android/app/profile
50 | /android/app/release
51 | *.pdb
52 | windows/flutter/generated_plugin_registrant.h
53 | windows/flutter/generated_plugin_registrant.cc
54 | *.exp
55 | windows/flutter/ephemeral/generated_config.cmake
56 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 4d7946a68d26794349189cf21b3f68cc6fe61dcb
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "donation_tracker_public",
9 | "request": "launch",
10 | "type": "dart",
11 | "args": [
12 | "--dart-define",
13 | "SERVER=3fad0791.nhost.app",
14 | ]
15 | },
16 | {
17 | "name": "donation_tracker_staging_write_access",
18 | "request": "launch",
19 | "type": "dart",
20 | "args": [
21 | "--dart-define",
22 | "SERVER=63b34375.nhost.app",
23 | "--vmservice-out-file=detective_connect.txt"
24 | ]
25 | },
26 | {
27 | "name": "run tests on staging",
28 | "type": "dart",
29 | "request": "launch",
30 | "codeLens": {
31 | // Types of CodeLens to inject
32 | "for": [
33 | "run-test",
34 | "run-test-file",
35 | "debug-test",
36 | "debug-test-file"
37 | ],
38 | // Restrict to certain folders
39 | "path": "test",
40 | // Text for CodeLens link (${debugType} will be replaced with "run" or "debug")
41 | "title": "${debugType} (onStaging)"
42 | },
43 | "args": [
44 | "--dart-define",
45 | "SERVER=63b34375.nhost.app",
46 | ]
47 | }
48 | ]
49 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is the repository for the DevsHelpDevs Donation Tracker Flutter Web app https://helpdevs-tracker.netlify.app
2 | # donation_tracker
3 |
4 | Because I get regularly requests for help for repairs or updates and I don't want to wait to have the DevsHelpDevs platform finished, Jimmy and I developed this flutter web app to allow me to track and show all donations usages and waiting people.
5 | Besides that it helps me to keep better track of and outgoing money, it will also act as a proof of concept for the whole platform.
6 |
7 | As it turned out that I will need to use this app more than originally thought and to be able to make it possible that other developers can easily contribute, the app can be configured when building or running a passing and a environment variable to define the used database server end up in secrets.
8 |
9 | ## Possible configurations
10 |
11 | To allow adding editing features in a safe way I set up a separate staging backend on Nhost which can be used by everyone for developing.
12 |
13 | To select the staging backend you have to pass in the server it should use:
14 |
15 | ```
16 | --dart-define SERVER=63b34375.nhost.app
17 | ```
18 |
19 | To be able to make mutation to data you have to log-in. you do that be double clicking on the DHD logo. If you selected the staging configuration you don't have to provide a password.
20 |
21 | For VS code I included 2 different run configurations to switch between read only production database and write access staging server.
22 | If you don't provide any environment variable the app defaults to read only production server.
23 | If you are using android studio you will have to find out how to class in built environment variables yourself
24 |
25 | The `NHostService` class has a property `hasWriteAccess` that can be used by the app to switch between readonly and editing mode.
26 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26 |
27 | android {
28 | compileSdkVersion 30
29 |
30 | defaultConfig {
31 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
32 | applicationId "com.devs.help.devs.donation_tracker"
33 | minSdkVersion 16
34 | targetSdkVersion 30
35 | versionCode flutterVersionCode.toInteger()
36 | versionName flutterVersionName
37 | }
38 |
39 | buildTypes {
40 | release {
41 | // TODO: Add your own signing config for the release build.
42 | // Signing with the debug keys for now, so `flutter run --release` works.
43 | signingConfig signingConfigs.debug
44 | }
45 | }
46 | }
47 |
48 | flutter {
49 | source '../..'
50 | }
51 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
13 |
17 |
21 |
26 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/devs/help/devs/donation_tracker/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.devs.help.devs.donation_tracker;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/devs/help/devs/donation_tracker/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.devs.help.devs.donation_tracker
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:4.1.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/assets/images/logo.png
--------------------------------------------------------------------------------
/buildweb.bat:
--------------------------------------------------------------------------------
1 | flutter build web --release --dart-define SERVER=3fad0791.nhost.app --web-renderer html
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32 | end
33 |
34 | post_install do |installer|
35 | installer.pods_project.targets.each do |target|
36 | flutter_additional_ios_build_settings(target)
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - connectivity (0.0.1):
3 | - Flutter
4 | - Reachability
5 | - Flutter (1.0.0)
6 | - path_provider (0.0.1):
7 | - Flutter
8 | - Reachability (3.2)
9 |
10 | DEPENDENCIES:
11 | - connectivity (from `.symlinks/plugins/connectivity/ios`)
12 | - Flutter (from `Flutter`)
13 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
14 |
15 | SPEC REPOS:
16 | trunk:
17 | - Reachability
18 |
19 | EXTERNAL SOURCES:
20 | connectivity:
21 | :path: ".symlinks/plugins/connectivity/ios"
22 | Flutter:
23 | :path: Flutter
24 | path_provider:
25 | :path: ".symlinks/plugins/path_provider/ios"
26 |
27 | SPEC CHECKSUMS:
28 | connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
29 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
30 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
31 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
32 |
33 | PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
34 |
35 | COCOAPODS: 1.10.1
36 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 | #import "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | donation_tracker
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/lib/_managers/authentication_manager.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:donation_tracker/_managers/donation_manager.dart';
4 | import 'package:donation_tracker/_managers/donation_manager_logged_in.dart';
5 | import 'package:donation_tracker/_services/nhost_service.dart';
6 | import 'package:flutter_command/flutter_command.dart';
7 | import 'package:functional_listener/functional_listener.dart';
8 | import 'package:get_it/get_it.dart';
9 |
10 | class LoginCredentials {
11 | final String name;
12 | final String pwd;
13 |
14 | LoginCredentials(this.name, this.pwd);
15 | }
16 |
17 | class AuthenticationManager {
18 | bool get isLoggedIn => GetIt.I().hasWriteAccess;
19 |
20 | late final Command loginCommand;
21 | late final Command logoutCommand;
22 |
23 | AuthenticationManager() {
24 | loginCommand = Command.createAsyncNoResult(
25 | (x) async => await loginUser(x.name, x.pwd),
26 | );
27 | logoutCommand = Command.createAsyncNoParamNoResult(
28 | () async => await logout(),
29 | );
30 |
31 | loginCommand.thrownExceptions.listen((ex, _) => print(ex.toString()));
32 | }
33 |
34 | Future loginUser(String userName, String pwd) async {
35 | if (isLoggedIn) return;
36 | if (await GetIt.I().loginUser(userName, pwd)) {
37 | GetIt.I.pushNewScope(
38 | scopeName: 'logged In',
39 | init: (getIt) {
40 | getIt.registerSingleton(NhostService(true));
41 | getIt.registerSingleton(DonationManagerLoggedIn());
42 | });
43 | }
44 | }
45 |
46 | Future logout() async {
47 | await GetIt.I.popScope();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/_managers/donation_manager.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:donation_tracker/_services/nhost_service.dart';
4 | import 'package:donation_tracker/models/donation.dart';
5 | import 'package:donation_tracker/models/usage.dart';
6 | import 'package:flutter/foundation.dart';
7 | import 'package:flutter_command/flutter_command.dart';
8 | import 'package:get_it/get_it.dart';
9 |
10 | class DonationManager implements ShadowChangeHandlers {
11 | final ValueListenable loading = ValueNotifier(false);
12 | final error = ValueNotifier(null);
13 | final totalDonated = ValueNotifier(0);
14 | final totalUsed = ValueNotifier(0);
15 | final totalWaiting = ValueNotifier(0);
16 |
17 | final donationUpdates = ValueNotifier([]);
18 | final usageUpdates = ValueNotifier>([]);
19 | final waitingUpdates = ValueNotifier>([]);
20 |
21 | Command? upsertDonation;
22 | Command? deleteDonation;
23 | Command? upsertUsage;
24 | Command? deleteUsage;
25 |
26 | late StreamSubscription donationSubscription;
27 | late StreamSubscription usageSubscription;
28 | late StreamSubscription errorSubscription;
29 |
30 | DonationManager() {
31 | startDatabaseListeners();
32 | }
33 | @override
34 | void onGetShadowed(Object shadowing) {
35 | stopListeners();
36 | }
37 |
38 | @override
39 | void onLeaveShadow(Object shadowing) {
40 | startDatabaseListeners();
41 | }
42 |
43 | void startDatabaseListeners() {
44 | final nhostService = GetIt.I();
45 |
46 | donationSubscription = nhostService.donationTableUpdates.listen((list) {
47 | totalDonated.value = list.fold(
48 | 0, (previousValue, element) => previousValue + element.amount);
49 |
50 | donationUpdates.value = list;
51 | });
52 |
53 | usageSubscription = nhostService.usageTableUpdates.listen((list) {
54 | /// We are using the same table for already used donations and for causes waiting
55 | final used = list.where((x) => !x.isWaitingCause);
56 | final waiting = list.where((x) => x.isWaitingCause);
57 |
58 | totalUsed.value = used.fold(
59 | 0, (previousValue, element) => previousValue + element.amount);
60 | totalWaiting.value = waiting.fold(
61 | 0, (previousValue, element) => previousValue + element.amount);
62 |
63 | usageUpdates.value = used.toList();
64 | waitingUpdates.value = waiting.toList();
65 | });
66 |
67 | errorSubscription = nhostService.errorUpdates.listen((event) {
68 | /// This might be a bit brutal in case there is an error but I don't expect many to happen :-)
69 | error.value = event.toString();
70 | });
71 | }
72 |
73 | Future stopListeners() async {
74 | await donationSubscription.cancel();
75 | await usageSubscription.cancel();
76 | await errorSubscription.cancel();
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/lib/_managers/donation_manager_logged_in.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:donation_tracker/_managers/donation_manager.dart';
4 | import 'package:donation_tracker/_services/nhost_service.dart';
5 | import 'package:flutter/foundation.dart';
6 | import 'package:flutter_command/flutter_command.dart';
7 | import 'package:functional_listener/functional_listener.dart';
8 | import 'package:get_it/get_it.dart';
9 |
10 | class DonationManagerLoggedIn extends DonationManager implements Disposable {
11 | @override
12 | late final ValueListenable loading;
13 |
14 | DonationManagerLoggedIn() {
15 | upsertDonation = Command.createAsync((donation) async {
16 | if (donation.id != null) {
17 | await GetIt.I().updateDonation(donation);
18 | } else {
19 | await GetIt.I().addDonation(donation);
20 | }
21 | return true;
22 | }, false);
23 |
24 | deleteDonation = Command.createAsync((donation) async {
25 | await GetIt.I().deleteDonation(donation);
26 | await Future.delayed(const Duration(seconds: 2));
27 | return true;
28 | }, false);
29 |
30 | upsertUsage = Command.createAsync((usage) async {
31 | if (usage.id != null) {
32 | await GetIt.I().updateUsage(usage);
33 | } else {
34 | await GetIt.I().addUsage(usage);
35 | }
36 | return true;
37 | }, false);
38 |
39 | deleteUsage = Command.createAsync((usage) async {
40 | await GetIt.I().deleteUsage(usage);
41 | await Future.delayed(const Duration(seconds: 2));
42 | return true;
43 | }, false);
44 |
45 | loading = upsertDonation!.isExecuting.mergeWith([
46 | deleteDonation!.isExecuting,
47 | upsertUsage!.isExecuting,
48 | deleteUsage!.isExecuting
49 | ]);
50 | deleteUsage!.thrownExceptions.listen((error, _) {
51 | print(error.toString());
52 | });
53 | }
54 | @override
55 | FutureOr onDispose() {
56 | stopListeners();
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/constants.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | Color kColorFromHex(String color) {
4 | final hexColorTrim = color
5 | .toUpperCase()
6 | .replaceAll('#', '')
7 | .replaceAll('0X', '')
8 | .padLeft(8, 'F');
9 | return Color(int.parse(hexColorTrim, radix: 16));
10 | }
11 |
12 | final tableDonations = 'temp_money_donations';
13 | final tableUsages = 'temp_money_used_for';
14 | final backgroundColor = kColorFromHex('#14142B');
15 | final primaryColor = kColorFromHex('#115FA7');
16 |
17 | const tableHeaderStyle = TextStyle(fontWeight: FontWeight.bold, fontSize: 16);
18 |
19 | const server =
20 | const String.fromEnvironment('SERVER', defaultValue: '3fad0791.nhost.app');
21 |
22 | const isProduction = server == '3fad0791.nhost.app';
23 |
24 | const hasuraSecret = const String.fromEnvironment('HASURA_SECRET');
25 | const userID = const String.fromEnvironment('USER_ID');
26 | const authPassword = const String.fromEnvironment('AUTH_PASSWORD');
27 |
28 | const graphQlEndPoint = 'https://hasura-$server/v1/graphql';
29 |
30 | const nhostBaseUrl = 'https://backend-$server';
31 |
32 | String buildImageLink(String fileNamePath) =>
33 | '$nhostBaseUrl/storage/o/public/$fileNamePath';
34 |
--------------------------------------------------------------------------------
/lib/models/donation.dart:
--------------------------------------------------------------------------------
1 | class Donation {
2 | const Donation({
3 | this.id,
4 | this.name,
5 | this.hiddenName,
6 | required this.amount,
7 | required this.date,
8 | });
9 |
10 | factory Donation.fromMap(Map data) {
11 | return Donation(
12 | id: data['id'],
13 | name: data['donator'],
14 | hiddenName: data['donator_hidden'],
15 | amount: data['value'],
16 | date: data['donation_date']);
17 | }
18 |
19 | final int? id;
20 | final String? name;
21 | final String? hiddenName;
22 | final int amount;
23 | final String date;
24 |
25 | Donation copyWith({
26 | int? id,
27 | String? name,
28 | String? hiddenName,
29 | int? amount,
30 | String? date,
31 | }) =>
32 | Donation(
33 | id: id ?? this.id,
34 | name: name ?? this.name,
35 | hiddenName: hiddenName ?? this.hiddenName,
36 | amount: amount ?? this.amount,
37 | date: date ?? this.date,
38 | );
39 |
40 | @override
41 | String toString() {
42 | return 'Donator{id: $id, name: $name, amount: $amount, createdAt: $date}';
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/lib/models/usage.dart:
--------------------------------------------------------------------------------
1 | import 'package:donation_tracker/constants.dart';
2 | import 'package:donation_tracker/utils.dart';
3 |
4 | ///We use the same table for already used money as well as for people waiting for help
5 | /// if [date] is null it means that this is a waiting entry
6 | class Usage {
7 | const Usage({
8 | this.id,
9 | required this.whatFor,
10 | required this.amount,
11 | this.date,
12 | this.name,
13 | this.hiddenName,
14 | this.image,
15 | this.imageReceiver,
16 | });
17 |
18 | factory Usage.fromMap(Map data) {
19 | return Usage(
20 | id: data['id'],
21 | whatFor: data['usage'],
22 | amount: data['value'],
23 | date: data['usage_date'],
24 | name: data['receivers_name'],
25 | hiddenName: data['receiver_hidden_name'],
26 | image: data['storage_image_name'],
27 | imageReceiver: data['storage_image_name_person']);
28 | }
29 |
30 | bool get isWaitingCause => date == null;
31 |
32 | final int? id;
33 | final String whatFor;
34 | final int amount;
35 | final String? date;
36 | final String? name;
37 | final String? hiddenName;
38 | final String? image;
39 | final String? imageReceiver;
40 |
41 | String? get imageLink =>
42 | image == null ? null : '$nhostBaseUrl/storage/o/public/$image';
43 |
44 | String? get imageReceiverLink => imageReceiver == null
45 | ? null
46 | : '$nhostBaseUrl/storage/o/public/$imageReceiver';
47 |
48 | String get dateText {
49 | return date?.toDateTime().format() ?? 'missing';
50 | }
51 |
52 | Usage copyWith({
53 | int? id,
54 | String? whatFor,
55 | int? amount,
56 | String? date,
57 | String? name,
58 | String? hiddenName,
59 | String? image,
60 | String? imageReceiver,
61 | }) =>
62 | Usage(
63 | id: id ?? this.id,
64 | whatFor: whatFor ?? this.whatFor,
65 | amount: amount ?? this.amount,
66 | date: date ?? this.date,
67 | name: name ?? this.name,
68 | hiddenName: hiddenName ?? this.hiddenName,
69 | image: image ?? this.image,
70 | imageReceiver: imageReceiver ?? this.imageReceiver,
71 | );
72 |
73 | @override
74 | String toString() {
75 | return 'Usage{id: $id, whatFor: $whatFor, amount: $amount, createdAt: $date}';
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/lib/presentation/button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class Button extends StatelessWidget {
4 | final VoidCallback onPressed;
5 | final String text;
6 | const Button({Key? key, required this.onPressed, required this.text})
7 | : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return TextButton(
12 | onPressed: onPressed,
13 | child: Padding(
14 | padding: const EdgeInsets.only(left: 8.0, top: 8, right: 8, bottom: 9),
15 | child: Text(
16 | text,
17 | style: Theme.of(context)
18 | .textTheme
19 | .headline5!
20 | .copyWith(color: Colors.white),
21 | ),
22 | ),
23 | style: OutlinedButton.styleFrom(
24 | backgroundColor: const Color(0xff115FA7),
25 | side: BorderSide(color: const Color(0xff115FA7), width: 3),
26 | shape: StadiumBorder(),
27 | ),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/lib/presentation/donations.dart:
--------------------------------------------------------------------------------
1 | import 'package:donation_tracker/_managers/donation_manager.dart';
2 | import 'package:donation_tracker/_services/nhost_service.dart';
3 | import 'package:donation_tracker/constants.dart';
4 | import 'package:donation_tracker/presentation/dialogs.dart';
5 | import 'package:donation_tracker/presentation/edit_donation_dlg.dart';
6 | import 'package:donation_tracker/utils.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:get_it_mixin/get_it_mixin.dart';
9 |
10 | class Donations extends StatelessWidget with GetItMixin {
11 | @override
12 | Widget build(BuildContext context) {
13 | final hasWriteAccess = get().hasWriteAccess;
14 | final donations = watchX((DonationManager m) => m.donationUpdates);
15 | return SingleChildScrollView(
16 | child: Column(
17 | crossAxisAlignment: CrossAxisAlignment.stretch,
18 | children: [
19 | DataTable(
20 | rows: donations
21 | .map((data) {
22 | return DataRow(cells: [
23 | DataCell(Text(data.name ?? 'anonymous')),
24 | DataCell(Text(data.date.toDateTime().format())),
25 | DataCell(Text(data.amount.toCurrency())),
26 | if (hasWriteAccess)
27 | DataCell(
28 | IconButton(
29 | onPressed: () async {
30 | await showAddEditDonationDlg(context, data);
31 | },
32 | icon: Icon(Icons.edit),
33 | ),
34 | ),
35 | if (hasWriteAccess)
36 | DataCell(IconButton(
37 | onPressed: () async {
38 | final shouldDelete = await showQueryDialog(
39 | context,
40 | 'Warning!',
41 | 'Do you really want to delete this entry?');
42 | if (shouldDelete) {
43 | get().deleteDonation!(data);
44 | }
45 | },
46 | icon: Icon(Icons.delete)))
47 | ]);
48 | })
49 | .cast()
50 | .toList(),
51 | columns: [
52 | DataColumn(
53 | label: const Text('Name', style: tableHeaderStyle),
54 | ),
55 | DataColumn(
56 | label: const Text('Date', style: tableHeaderStyle),
57 | ),
58 | DataColumn(
59 | label: const Text('Amount', style: tableHeaderStyle),
60 | ),
61 | if (hasWriteAccess)
62 | DataColumn(
63 | label: const Text('Edit', style: tableHeaderStyle),
64 | ),
65 | if (hasWriteAccess)
66 | DataColumn(
67 | label: const Text('Delete', style: tableHeaderStyle),
68 | ),
69 | ],
70 | ),
71 | ],
72 | ),
73 | );
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/lib/utils.dart:
--------------------------------------------------------------------------------
1 | import 'package:intl/date_symbol_data_local.dart';
2 | import 'package:intl/intl.dart';
3 |
4 | final _numberFormat = NumberFormat('#,##0.00');
5 |
6 | extension DateTimeExtension on DateTime {
7 | String format({String pattern = 'dd/MM/yyyy', String locale = 'fr_FR'}) {
8 | initializeDateFormatting(locale);
9 | return DateFormat(pattern, locale).format(this);
10 | }
11 | }
12 |
13 | extension ToDateExtension on String {
14 | DateTime toDateTime() {
15 | return DateFormat('yyyy-MM-dd\'T\'HH:mm:ssZ').parse(this);
16 | }
17 | }
18 |
19 | extension ToStringCurrency on num {
20 | String toCurrency() {
21 | var amount = this ~/ 100;
22 | return _numberFormat.format(amount) + '€';
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/xcuserdata/
7 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "ephemeral/Flutter-Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import dropfiles_window
9 | import url_launcher_macos
10 |
11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12 | DropfilesWindowPlugin.register(with: registry.registrar(forPlugin: "DropfilesWindowPlugin"))
13 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
14 | }
15 |
--------------------------------------------------------------------------------
/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.11'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | end
35 |
36 | post_install do |installer|
37 | installer.pods_project.targets.each do |target|
38 | flutter_additional_macos_build_settings(target)
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/macos/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - dropfiles_window (0.0.1):
3 | - FlutterMacOS
4 | - FlutterMacOS (1.0.0)
5 | - url_launcher_macos (0.0.1):
6 | - FlutterMacOS
7 |
8 | DEPENDENCIES:
9 | - dropfiles_window (from `Flutter/ephemeral/.symlinks/plugins/dropfiles_window/macos`)
10 | - FlutterMacOS (from `Flutter/ephemeral`)
11 | - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
12 |
13 | EXTERNAL SOURCES:
14 | dropfiles_window:
15 | :path: Flutter/ephemeral/.symlinks/plugins/dropfiles_window/macos
16 | FlutterMacOS:
17 | :path: Flutter/ephemeral
18 | url_launcher_macos:
19 | :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
20 |
21 | SPEC CHECKSUMS:
22 | dropfiles_window: 830efdb761ce08d5da6c5930803431bc445d5881
23 | FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
24 | url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
25 |
26 | PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
27 |
28 | COCOAPODS: 1.10.1
29 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
64 |
65 |
71 |
73 |
79 |
80 |
81 |
82 |
84 |
85 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = donation_tracker
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.devs.help.devs.donationTracker
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.devs.help.devs. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.client
10 |
11 | com.apple.security.network.server
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.network.client
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: donation_tracker
2 | description: DevsHelpDevs Donation Tracker
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.12.0 <3.0.0"
22 |
23 | dependencies:
24 | intl: ^0.17.0
25 | cropper: ^0.5.2
26 | dropfiles_window:
27 | git:
28 | url: https://github.com/escamoteur/dropfiles_window
29 | ref: null-safety
30 | graphql: 5.0.0-nullsafety.1
31 | get_it: ^7.1.2
32 | file_selector:
33 | file_selector_windows: ^0.0.2
34 | flutter_command: any
35 | get_it_mixin: ^3.1.1
36 | image:
37 | url_launcher:
38 | rxdart:
39 | layout:
40 | functional_listener: ^2.0.2
41 | deep_pick: ^0.8.0
42 | flutter_svg:
43 | modal_bottom_sheet: ^2.0.0
44 | reactive_forms:
45 | routemaster: ^0.8.1
46 | flutter:
47 | sdk: flutter
48 |
49 | # The following adds the Cupertino Icons font to your application.
50 | # Use with the CupertinoIcons class for iOS style icons.
51 | cupertino_icons: ^1.0.2
52 |
53 | # Nhost-related
54 | nhost_sdk:
55 | nhost_graphql_adapter:
56 |
57 | dev_dependencies:
58 | test:
59 | flutter_test:
60 | sdk: flutter
61 |
62 | # For information on the generic Dart part of this file, see the
63 | # following page: https://dart.dev/tools/pub/pubspec
64 |
65 | # The following section is specific to Flutter.
66 | flutter:
67 |
68 | # The following line ensures that the Material Icons font is
69 | # included with your application, so that you can use the icons in
70 | # the material Icons class.
71 | uses-material-design: true
72 |
73 | # To add assets to your application, add an assets section, like this:
74 | assets:
75 | - assets/images/
76 |
77 | # An image asset can refer to one or more resolution-specific "variants", see
78 | # https://flutter.dev/assets-and-images/#resolution-aware.
79 |
80 | # For details regarding adding assets from package dependencies, see
81 | # https://flutter.dev/assets-and-images/#from-packages
82 |
83 | # To add custom fonts to your application, add a fonts section here,
84 | # in this "flutter" section. Each entry in this list should have a
85 | # "family" key with the font family name, and a "fonts" key with a
86 | # list giving the asset and other descriptors for the font. For
87 | # example:
88 | # fonts:
89 | # - family: Schyler
90 | # fonts:
91 | # - asset: fonts/Schyler-Regular.ttf
92 | # - asset: fonts/Schyler-Italic.ttf
93 | # style: italic
94 | # - family: Trajan Pro
95 | # fonts:
96 | # - asset: fonts/TrajanPro.ttf
97 | # - asset: fonts/TrajanPro_Bold.ttf
98 | # weight: 700
99 | #
100 | # For details regarding fonts from package dependencies,
101 | # see https://flutter.dev/custom-fonts/#from-packages
102 |
--------------------------------------------------------------------------------
/test/storage_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:donation_tracker/_services/nhost_service.dart';
2 | import 'package:test/test.dart';
3 |
4 | main() {
5 | test('login success', () async {
6 | final server = NhostService();
7 | await server.loginUser('mail@devshelpdevs.org', 'staging');
8 | final fileList = await server.getAvailableFiles();
9 | fileList.forEach((element) {
10 | print(element.fileName);
11 | });
12 | });
13 | }
14 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:donation_tracker/main.dart';
9 | import 'package:flutter/material.dart';
10 | import 'package:flutter_test/flutter_test.dart';
11 |
12 | void main() {
13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(MyApp());
16 |
17 | // Verify that our counter starts at 0.
18 | expect(find.text('0'), findsOneWidget);
19 | expect(find.text('1'), findsNothing);
20 |
21 | // Tap the '+' icon and trigger a frame.
22 | await tester.tap(find.byIcon(Icons.add));
23 | await tester.pump();
24 |
25 | // Verify that our counter has incremented.
26 | expect(find.text('0'), findsNothing);
27 | expect(find.text('1'), findsOneWidget);
28 | });
29 | }
30 |
--------------------------------------------------------------------------------
/web/_redirects:
--------------------------------------------------------------------------------
1 | /* /index.html 200
--------------------------------------------------------------------------------
/web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/web/favicon.ico
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/devshelpdevs/donation_tracker/15a20005591fc8801d3bc20b0d5fb1151cdb5c28/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | donation_tracker
35 |
36 |
37 |
38 |
39 |
40 |
41 |
Please wait
42 |
43 |
44 |
47 | -->
55 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/web/loader.css:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0;
3 | }
4 |
5 | #loader {
6 | width: 100vw;
7 | height: 100vh;
8 | /* display: block; */
9 | display: flex;
10 | flex-direction: column;
11 | justify-content: center;
12 | justify-items: center;
13 | align-items: center;
14 | align-content: center;
15 | background-color: #14142B;
16 | }
17 |
18 | #loader-title {
19 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
20 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
21 |
22 | font-weight: 500;
23 | font-size: 22;
24 | color: white;
25 | }
26 |
27 | .lds-roller {
28 | display: inline-block;
29 | position: relative;
30 | width: 80px;
31 | height: 80px;
32 | }
33 | .lds-roller div {
34 | animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
35 | transform-origin: 40px 40px;
36 | }
37 | .lds-roller div:after {
38 | content: " ";
39 | display: block;
40 | position: absolute;
41 | width: 7px;
42 | height: 7px;
43 | border-radius: 50%;
44 | background: #fff;
45 | margin: -4px 0 0 -4px;
46 | }
47 | .lds-roller div:nth-child(1) {
48 | animation-delay: -0.036s;
49 | }
50 | .lds-roller div:nth-child(1):after {
51 | top: 63px;
52 | left: 63px;
53 | }
54 | .lds-roller div:nth-child(2) {
55 | animation-delay: -0.072s;
56 | }
57 | .lds-roller div:nth-child(2):after {
58 | top: 68px;
59 | left: 56px;
60 | }
61 | .lds-roller div:nth-child(3) {
62 | animation-delay: -0.108s;
63 | }
64 | .lds-roller div:nth-child(3):after {
65 | top: 71px;
66 | left: 48px;
67 | }
68 | .lds-roller div:nth-child(4) {
69 | animation-delay: -0.144s;
70 | }
71 | .lds-roller div:nth-child(4):after {
72 | top: 72px;
73 | left: 40px;
74 | }
75 | .lds-roller div:nth-child(5) {
76 | animation-delay: -0.18s;
77 | }
78 | .lds-roller div:nth-child(5):after {
79 | top: 71px;
80 | left: 32px;
81 | }
82 | .lds-roller div:nth-child(6) {
83 | animation-delay: -0.216s;
84 | }
85 | .lds-roller div:nth-child(6):after {
86 | top: 68px;
87 | left: 24px;
88 | }
89 | .lds-roller div:nth-child(7) {
90 | animation-delay: -0.252s;
91 | }
92 | .lds-roller div:nth-child(7):after {
93 | top: 63px;
94 | left: 17px;
95 | }
96 | .lds-roller div:nth-child(8) {
97 | animation-delay: -0.288s;
98 | }
99 | .lds-roller div:nth-child(8):after {
100 | top: 56px;
101 | left: 12px;
102 | }
103 | @keyframes lds-roller {
104 | 0% {
105 | transform: rotate(0deg);
106 | }
107 | 100% {
108 | transform: rotate(360deg);
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "DevsHelpDevs Donation Tracker",
3 | "short_name": "DevsHelpDevs Donation Tracker",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "DevsHelpDevs Donation Tracker",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | }
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(donation_tracker LANGUAGES CXX)
3 |
4 | set(BINARY_NAME "donation_tracker")
5 |
6 | cmake_policy(SET CMP0063 NEW)
7 |
8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
9 |
10 | # Configure build options.
11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
12 | if(IS_MULTICONFIG)
13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
14 | CACHE STRING "" FORCE)
15 | else()
16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17 | set(CMAKE_BUILD_TYPE "Debug" CACHE
18 | STRING "Flutter build mode" FORCE)
19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
20 | "Debug" "Profile" "Release")
21 | endif()
22 | endif()
23 |
24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
28 |
29 | # Use Unicode for all projects.
30 | add_definitions(-DUNICODE -D_UNICODE)
31 |
32 | # Compilation settings that should be applied to most targets.
33 | function(APPLY_STANDARD_SETTINGS TARGET)
34 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
36 | target_compile_options(${TARGET} PRIVATE /EHsc)
37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
39 | endfunction()
40 |
41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
42 |
43 | # Flutter library and tool build rules.
44 | add_subdirectory(${FLUTTER_MANAGED_DIR})
45 |
46 | # Application build
47 | add_subdirectory("runner")
48 |
49 | # Generated plugin build rules, which manage building the plugins and adding
50 | # them to the application.
51 | include(flutter/generated_plugins.cmake)
52 |
53 |
54 | # === Installation ===
55 | # Support files are copied into place next to the executable, so that it can
56 | # run in place. This is done instead of making a separate bundle (as on Linux)
57 | # so that building and running from within Visual Studio will work.
58 | set(BUILD_BUNDLE_DIR "$")
59 | # Make the "install" step default, as it's required to run.
60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
63 | endif()
64 |
65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
67 |
68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
69 | COMPONENT Runtime)
70 |
71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
72 | COMPONENT Runtime)
73 |
74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
75 | COMPONENT Runtime)
76 |
77 | if(PLUGIN_BUNDLED_LIBRARIES)
78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
80 | COMPONENT Runtime)
81 | endif()
82 |
83 | # Fully re-copy the assets directory on each build to avoid having stale files
84 | # from a previous install.
85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
86 | install(CODE "
87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
88 | " COMPONENT Runtime)
89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
91 |
92 | # Install the AOT library on non-Debug builds only.
93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
94 | CONFIGURATIONS Profile;Release
95 | COMPONENT Runtime)
96 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 |
3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
4 |
5 | # Configuration provided via flutter tool.
6 | include(${EPHEMERAL_DIR}/generated_config.cmake)
7 |
8 | # TODO: Move the rest of this into files in ephemeral. See
9 | # https://github.com/flutter/flutter/issues/57146.
10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
11 |
12 | # === Flutter Library ===
13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
14 |
15 | # Published to parent scope for install step.
16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
20 |
21 | list(APPEND FLUTTER_LIBRARY_HEADERS
22 | "flutter_export.h"
23 | "flutter_windows.h"
24 | "flutter_messenger.h"
25 | "flutter_plugin_registrar.h"
26 | "flutter_texture_registrar.h"
27 | )
28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
29 | add_library(flutter INTERFACE)
30 | target_include_directories(flutter INTERFACE
31 | "${EPHEMERAL_DIR}"
32 | )
33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
34 | add_dependencies(flutter flutter_assemble)
35 |
36 | # === Wrapper ===
37 | list(APPEND CPP_WRAPPER_SOURCES_CORE
38 | "core_implementations.cc"
39 | "standard_codec.cc"
40 | )
41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
43 | "plugin_registrar.cc"
44 | )
45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
46 | list(APPEND CPP_WRAPPER_SOURCES_APP
47 | "flutter_engine.cc"
48 | "flutter_view_controller.cc"
49 | )
50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
51 |
52 | # Wrapper sources needed for a plugin.
53 | add_library(flutter_wrapper_plugin STATIC
54 | ${CPP_WRAPPER_SOURCES_CORE}
55 | ${CPP_WRAPPER_SOURCES_PLUGIN}
56 | )
57 | apply_standard_settings(flutter_wrapper_plugin)
58 | set_target_properties(flutter_wrapper_plugin PROPERTIES
59 | POSITION_INDEPENDENT_CODE ON)
60 | set_target_properties(flutter_wrapper_plugin PROPERTIES
61 | CXX_VISIBILITY_PRESET hidden)
62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
63 | target_include_directories(flutter_wrapper_plugin PUBLIC
64 | "${WRAPPER_ROOT}/include"
65 | )
66 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
67 |
68 | # Wrapper sources needed for the runner.
69 | add_library(flutter_wrapper_app STATIC
70 | ${CPP_WRAPPER_SOURCES_CORE}
71 | ${CPP_WRAPPER_SOURCES_APP}
72 | )
73 | apply_standard_settings(flutter_wrapper_app)
74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
75 | target_include_directories(flutter_wrapper_app PUBLIC
76 | "${WRAPPER_ROOT}/include"
77 | )
78 | add_dependencies(flutter_wrapper_app flutter_assemble)
79 |
80 | # === Flutter tool backend ===
81 | # _phony_ is a non-existent file to force this command to run every time,
82 | # since currently there's no way to get a full input/output list from the
83 | # flutter tool.
84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
86 | add_custom_command(
87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
89 | ${CPP_WRAPPER_SOURCES_APP}
90 | ${PHONY_OUTPUT}
91 | COMMAND ${CMAKE_COMMAND} -E env
92 | ${FLUTTER_TOOL_ENVIRONMENT}
93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
94 | windows-x64 $
95 | VERBATIM
96 | )
97 | add_custom_target(flutter_assemble DEPENDS
98 | "${FLUTTER_LIBRARY}"
99 | ${FLUTTER_LIBRARY_HEADERS}
100 | ${CPP_WRAPPER_SOURCES_CORE}
101 | ${CPP_WRAPPER_SOURCES_PLUGIN}
102 | ${CPP_WRAPPER_SOURCES_APP}
103 | )
104 |
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/cpp_client_wrapper/README:
--------------------------------------------------------------------------------
1 | This code is intended to be built into plugins and applications to provide
2 | higher-level, C++ abstractions for interacting with the Flutter library.
3 |
4 | Over time, the goal is to move more of this code into the library in a way that
5 | provides a usable ABI (e.g., does not use standard library in the interfaces).
6 |
7 | Note that this wrapper is still in early stages. Expect significant churn in
8 | both the APIs and the structure of the wrapper (e.g., the exact set of files
9 | that need to be built).
10 |
--------------------------------------------------------------------------------
/windows/flutter/ephemeral/cpp_client_wrapper/binary_messenger_impl.h:
--------------------------------------------------------------------------------
1 | // Copyright 2013 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_BINARY_MESSENGER_IMPL_H_
6 | #define FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_BINARY_MESSENGER_IMPL_H_
7 |
8 | #include
9 |
10 | #include