diff --git "a/\\" "b/\\" new file mode 100644 index 00000000..d9dc4642 --- /dev/null +++ "b/\\" @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:fluro/fluro.dart'; + +import 'package:app/routes/edit_business_info.dart'; +import 'package:app/routes/forgot_password.dart'; +import 'package:app/routes/create_account.dart'; +import 'package:app/routes/set_currency.dart'; +import 'package:app/routes/new_address.dart'; +import 'package:app/routes/new_invoice.dart'; +import 'package:app/routes/navigation.dart'; +import 'package:app/routes/addresses.dart'; +import 'package:app/routes/settings.dart'; +import 'package:app/routes/payments.dart'; +import 'package:app/routes/login.dart'; +import 'package:app/preloader.dart'; + +import 'package:app/authentication.dart'; + +class FluroRouter { + static Router router = Router(); + + static newHandler(klass, [key]) { + return Handler(handlerFunc: (BuildContext context, Map params) { + Authentication.appContext = context; + Preloader.downloadImages(context); + + if (key == null) return klass(); + else return klass(params[key][0]); + }); + } + + static void setupRouter() { + router.define( + '/login', + handler: newHandler(() => Login()), + transitionType: TransitionType.fadeIn, + ); + router.define( + '/registration', + handler: newHandler(() => CreateAccount()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/register-business', + handler: newHandler(() => EditBusinessInfo(allowBack: false)), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/password-reset', + handler: newHandler(() => ForgotPassword()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/invoices/:id', + handler: newHandler(() => NewInvoice()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/new-invoice', + handler: newHandler(() => NewInvoice()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/navigation', + handler: newHandler(() => Navigation()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/settings', + handler: newHandler(() => Settings()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/settings/business-info', + handler: newHandler(() => EditBusinessInfo()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/settings/currency', + handler: newHandler(() => SetCurrency()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/settings/addresses', + handler: newHandler(() => Addresses()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/payments', + handler: newHandler(() => Payments()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/quick-start', + handler: newHandler(() => Addresses()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/new-address/:code', + handler: newHandler((code) => NewAddress(code), 'code'), + transitionType: TransitionType.inFromBottom, + ); + } +} diff --git a/embeds/invoice/.gitignore b/embeds/invoice/.gitignore new file mode 100644 index 00000000..f3c20534 --- /dev/null +++ b/embeds/invoice/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/embeds/invoice/.metadata b/embeds/invoice/.metadata new file mode 100644 index 00000000..17bcb3eb --- /dev/null +++ b/embeds/invoice/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 2738a1148ba6c9a6114df62358109407c3ef2553 + channel: beta + +project_type: app diff --git a/embeds/invoice/README.md b/embeds/invoice/README.md new file mode 100644 index 00000000..b819468e --- /dev/null +++ b/embeds/invoice/README.md @@ -0,0 +1,16 @@ +# invoice + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/embeds/invoice/android/.gitignore b/embeds/invoice/android/.gitignore new file mode 100644 index 00000000..bc2100d8 --- /dev/null +++ b/embeds/invoice/android/.gitignore @@ -0,0 +1,7 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java diff --git a/embeds/invoice/android/app/build.gradle b/embeds/invoice/android/app/build.gradle new file mode 100644 index 00000000..b6543291 --- /dev/null +++ b/embeds/invoice/android/app/build.gradle @@ -0,0 +1,63 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.invoice" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/embeds/invoice/android/app/src/debug/AndroidManifest.xml b/embeds/invoice/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..9b8db807 --- /dev/null +++ b/embeds/invoice/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/embeds/invoice/android/app/src/main/AndroidManifest.xml b/embeds/invoice/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a9068f56 --- /dev/null +++ b/embeds/invoice/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/embeds/invoice/android/app/src/main/kotlin/com/example/invoice/MainActivity.kt b/embeds/invoice/android/app/src/main/kotlin/com/example/invoice/MainActivity.kt new file mode 100644 index 00000000..4266e069 --- /dev/null +++ b/embeds/invoice/android/app/src/main/kotlin/com/example/invoice/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.invoice + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/embeds/invoice/android/app/src/main/res/drawable/launch_background.xml b/embeds/invoice/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/embeds/invoice/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/embeds/invoice/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/embeds/invoice/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/embeds/invoice/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/embeds/invoice/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/embeds/invoice/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/embeds/invoice/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/embeds/invoice/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/embeds/invoice/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/embeds/invoice/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/embeds/invoice/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/embeds/invoice/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/embeds/invoice/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/embeds/invoice/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/embeds/invoice/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/embeds/invoice/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/embeds/invoice/android/app/src/main/res/values/styles.xml b/embeds/invoice/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..1f83a33f --- /dev/null +++ b/embeds/invoice/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/embeds/invoice/android/app/src/profile/AndroidManifest.xml b/embeds/invoice/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..9b8db807 --- /dev/null +++ b/embeds/invoice/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/embeds/invoice/android/build.gradle b/embeds/invoice/android/build.gradle new file mode 100644 index 00000000..3100ad2d --- /dev/null +++ b/embeds/invoice/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/embeds/invoice/android/gradle.properties b/embeds/invoice/android/gradle.properties new file mode 100644 index 00000000..38c8d454 --- /dev/null +++ b/embeds/invoice/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/embeds/invoice/android/gradle/wrapper/gradle-wrapper.properties b/embeds/invoice/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..296b146b --- /dev/null +++ b/embeds/invoice/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/embeds/invoice/android/settings.gradle b/embeds/invoice/android/settings.gradle new file mode 100644 index 00000000..d3b6a401 --- /dev/null +++ b/embeds/invoice/android/settings.gradle @@ -0,0 +1,15 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/embeds/invoice/assets/fonts/Ubuntu-Bold.ttf b/embeds/invoice/assets/fonts/Ubuntu-Bold.ttf new file mode 100755 index 00000000..4af149ac Binary files /dev/null and b/embeds/invoice/assets/fonts/Ubuntu-Bold.ttf differ diff --git a/embeds/invoice/assets/fonts/Ubuntu-Regular.ttf b/embeds/invoice/assets/fonts/Ubuntu-Regular.ttf new file mode 100755 index 00000000..dbb834a4 Binary files /dev/null and b/embeds/invoice/assets/fonts/Ubuntu-Regular.ttf differ diff --git a/embeds/invoice/assets/images/anypay-logo.png b/embeds/invoice/assets/images/anypay-logo.png new file mode 100644 index 00000000..ec37a121 Binary files /dev/null and b/embeds/invoice/assets/images/anypay-logo.png differ diff --git a/embeds/invoice/assets/images/close-button-light.png b/embeds/invoice/assets/images/close-button-light.png new file mode 120000 index 00000000..8e604055 --- /dev/null +++ b/embeds/invoice/assets/images/close-button-light.png @@ -0,0 +1 @@ +assets/images/close-button-light.png \ No newline at end of file diff --git a/embeds/invoice/assets/images/close-button.png b/embeds/invoice/assets/images/close-button.png new file mode 100644 index 00000000..02fc63db Binary files /dev/null and b/embeds/invoice/assets/images/close-button.png differ diff --git a/embeds/invoice/assets/images/copy_icon.png b/embeds/invoice/assets/images/copy_icon.png new file mode 100644 index 00000000..13b09440 Binary files /dev/null and b/embeds/invoice/assets/images/copy_icon.png differ diff --git a/embeds/invoice/assets/images/having-issues.png b/embeds/invoice/assets/images/having-issues.png new file mode 100644 index 00000000..ed478e0c Binary files /dev/null and b/embeds/invoice/assets/images/having-issues.png differ diff --git a/embeds/invoice/assets/images/wallet_icon.png b/embeds/invoice/assets/images/wallet_icon.png new file mode 100644 index 00000000..a9a4075c Binary files /dev/null and b/embeds/invoice/assets/images/wallet_icon.png differ diff --git a/embeds/invoice/ios/.gitignore b/embeds/invoice/ios/.gitignore new file mode 100644 index 00000000..e96ef602 --- /dev/null +++ b/embeds/invoice/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/embeds/invoice/ios/Flutter/AppFrameworkInfo.plist b/embeds/invoice/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..6b4c0f78 --- /dev/null +++ b/embeds/invoice/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/embeds/invoice/ios/Flutter/Debug.xcconfig b/embeds/invoice/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/embeds/invoice/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/embeds/invoice/ios/Flutter/Release.xcconfig b/embeds/invoice/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/embeds/invoice/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/embeds/invoice/ios/Runner.xcodeproj/project.pbxproj b/embeds/invoice/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..70d5217e --- /dev/null +++ b/embeds/invoice/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,503 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 97C146F11CF9000F007C117D /* Supporting Files */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + 97C146F11CF9000F007C117D /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.invoice; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.invoice; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.invoice; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/embeds/invoice/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/embeds/invoice/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..a28140cf --- /dev/null +++ b/embeds/invoice/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/embeds/invoice/ios/Runner.xcworkspace/contents.xcworkspacedata b/embeds/invoice/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/embeds/invoice/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/embeds/invoice/ios/Runner/AppDelegate.swift b/embeds/invoice/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/embeds/invoice/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/embeds/invoice/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/embeds/invoice/ios/Runner/Base.lproj/LaunchScreen.storyboard b/embeds/invoice/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/embeds/invoice/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/embeds/invoice/ios/Runner/Base.lproj/Main.storyboard b/embeds/invoice/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/embeds/invoice/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/embeds/invoice/ios/Runner/Info.plist b/embeds/invoice/ios/Runner/Info.plist new file mode 100644 index 00000000..38d4548c --- /dev/null +++ b/embeds/invoice/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + invoice + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/embeds/invoice/ios/Runner/Runner-Bridging-Header.h b/embeds/invoice/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/embeds/invoice/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/embeds/invoice/lib/app_controller.dart b/embeds/invoice/lib/app_controller.dart new file mode 100644 index 00000000..e3082b94 --- /dev/null +++ b/embeds/invoice/lib/app_controller.dart @@ -0,0 +1,164 @@ +import 'package:flutter/scheduler.dart'; +import 'package:flutter/material.dart'; +import 'dart:async'; +import 'dart:math'; + +class AppController extends StatefulWidget { + final Function(BuildContext) builder; + + static final globalKey = new GlobalKey(); + static bool enableDarkMode = false; + static bool dialogIsOpen = false; + static String openedPath; + + static String logoImagePath() { + var modifier = enableDarkMode ? '-white' : ''; + return 'assets/images/anypay-full-logo$modifier.png'; + } + + static String havingIssuesImagePath() { + var modifier = enableDarkMode ? '-white' : ''; + return 'assets/images/having-issues$modifier.png'; + } + + static String backspaceImagePath() { + var modifier = enableDarkMode ? '-white' : ''; + return 'assets/images/backspace$modifier.png'; + } + + static Color randomColor = randomizeColor(); + + static Color randomizeColor() { + randomColor = (colors..shuffle()).first; + return randomColor; + } + + static void toggleDarkMode([value = null]) { + enableDarkMode = value ?? !enableDarkMode; + } + + static ThemeData get lightTheme => ThemeData( + primaryColorDark: Color(0xFF707070), + primaryColorLight: Color(0xFF404040), + brightness: Brightness.light, + accentColor: AppController.blue, + fontFamily: 'Ubuntu', + ); + + static ThemeData get darkTheme => ThemeData( + primaryColorDark: Color(0xffCCCCCC), + primaryColorLight: Color(0xFFFFFFFF), + accentColor: Color(0xff2196f3), + brightness: Brightness.dark, + fontFamily: 'Ubuntu', + ); + + static double topPadding() { + return MediaQuery.of(getCurrentContext()).padding.top; + } + + static double leftPadding() { + return MediaQuery.of(getCurrentContext()).padding.left; + } + + static Color yellow = Color(0xFFcfa015); + static Color purple = Color(0xFF8c5ca6); + static Color green = Color(0xFF1a8e5a); + static Color blue = Color(0xFF0177c0); + static Color red = Color(0xFFc74a43); + static Color white = Colors.white; + static Color grey = Colors.grey; + + static List colors = [ + purple, + yellow, + green, + blue, + red, + ].toList(); + + static BuildContext getCurrentContext() { + return globalKey.currentState.overlay.context; + } + + static double scale(num value, {num maxValue, num minValue}) { + var screenData = MediaQuery.of(getCurrentContext()); + value = value * screenData.size.height/650; + value = min(value, maxValue ?? double.maxFinite); + value = max(value, minValue ?? 0); + return value.toDouble(); + } + + static void openDialog(title, body, {path: null, buttonText: null, buttons: null}) async { + if (dialogIsOpen) return; + dialogIsOpen = true; + + var context = getCurrentContext(); + buttons ??= []; + showDialog( + context: context, + builder: (context) => AlertDialog( + content: ListTile( + title: Text(title), + subtitle: Text(body), + ), + actions: [ + ...buttons.map((button) { + return FlatButton( + child: Text(button['text']), + onPressed: () { + dialogIsOpen = false; + Navigator.of(context).pop(); + button['onPressed'](); + }, + ); + }), + FlatButton( + child: Text(buttonText ?? 'Ok'), + onPressed: () { + dialogIsOpen = false; + Navigator.of(context).pop(); + if (path != null) + openPath(path); + }, + ), + ], + ), + ); + } + + static void closeUntilPath(String path) { + Navigator.pushNamedAndRemoveUntil(getCurrentContext(), path, (Route route) => false); + } + + static void openPath(String path) async { + if (path != null && openedPath != path) + Navigator.pushNamed(getCurrentContext(), path); + Timer(Duration(milliseconds: 5000), () => openedPath = null); + openedPath = path; + } + + const AppController( + {Key key, this.builder}) + : super(key: key); + + @override + AppControllerState createState() => new AppControllerState(); + + static AppControllerState of(BuildContext context) { + return context.ancestorStateOfType(const TypeMatcher()); + } +} + +class AppControllerState extends State { + + @override + Widget build(BuildContext context) { + return widget.builder(context); + } + + void rebuild() { + setState(() {}); + } +} + diff --git a/embeds/invoice/lib/back_button.dart b/embeds/invoice/lib/back_button.dart new file mode 100644 index 00000000..b4270dfd --- /dev/null +++ b/embeds/invoice/lib/back_button.dart @@ -0,0 +1,37 @@ +import 'app_controller.dart'; +import 'package:flutter/material.dart'; + +class CircleBackButton extends StatelessWidget { + CircleBackButton({this.backPath, this.onTap, this.margin, this.opaque}); + final backPath; + final opaque; + final margin; + final onTap; + + @override + Widget build(BuildContext context) { + var imagePath = 'assets/images/close-button.png'; + if (AppController.enableDarkMode) + imagePath = 'assets/images/close-button-light.png'; + var size = AppController.scale(50, minValue: 40, maxValue: 50); + return Container( + margin: margin, + height: size, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(size / 2), + color: (opaque ?? true) ? Theme.of(context).canvasColor : Color(0x00000000), + ), + child: GestureDetector( + onTap: onTap ?? (() { + if (Navigator.canPop(context)) + Navigator.pop(context, true); + else AppController.closeUntilPath(backPath); + }), + child: Image( + width: size, + image: AssetImage(imagePath), + ), + ), + ); + } +} diff --git a/embeds/invoice/lib/client.dart b/embeds/invoice/lib/client.dart new file mode 100644 index 00000000..c0d6f4a4 --- /dev/null +++ b/embeds/invoice/lib/client.dart @@ -0,0 +1,81 @@ +import 'package:basic_utils/basic_utils.dart'; +import 'models/invoice.dart'; +import 'package:http/http.dart' as http; +import 'dart:convert'; +import 'dart:io'; + +class Client { + static final protocol = 'https'; + static final domain = 'api.anypayinc.com'; + static final host = "$protocol://$domain"; + + static String humanize(str) { + if (str != null && str.length > 0) + return StringUtils.capitalize(str); + } + + static Future> getAccount(id) async { + var response = await makeRequest('get', + path: '/accounts/$id', + ); + + return response; + } + + static Future> getInvoice(id) async { + var response = await makeRequest('get', + path: '/invoices/$id', + ); + + if (response['success']) + response['invoice'] = Invoice.fromMap(response['body']); + + return response; + } + + static Future> makeRequest(method, {path, uri, headers, body, genericErrorCodes}) async { + try { + http.Request request = http.Request(method, uri ?? Uri.parse('$host$path')); + if (genericErrorCodes == null) genericErrorCodes = [500]; + + request.headers['Content-Type'] = 'application/json; charset=UTF-8'; + request.body = jsonEncode(body ?? {}); + (headers ?? {}).forEach((key, value) { + request.headers[key] = value; + }); + + http.StreamedResponse streamedResponse = await http.Client().send(request); + http.Response response = await http.Response.fromStream(streamedResponse); + + var responseBody = (json.decode(response.body) as Map); + var message = responseBody['message']; + + var code = response.statusCode; + // For debugging: + // print("PATH: $path, BODY: ${jsonEncode(body ?? {})}, CODE: $code"); + if (response.statusCode == 401) { + return { + 'message': 'Unauthorized', + 'success': false, + 'body': { }, + }; + } else if (genericErrorCodes.contains(response.statusCode)) { + return { + 'success': false, + 'message': "Something went wrong, please try again later", + 'body': { }, + }; + } else return { + 'success': response.statusCode == 200, + 'message': humanize(message ?? ""), + 'body': responseBody, + }; + } on SocketException catch (_) { + return { + 'message': 'Not connected to the internet', + 'success': false, + 'body': { }, + }; + } + } +} diff --git a/embeds/invoice/lib/coins.dart b/embeds/invoice/lib/coins.dart new file mode 100644 index 00000000..38fc7eca --- /dev/null +++ b/embeds/invoice/lib/coins.dart @@ -0,0 +1,4 @@ +class Coins { + static Map all = {}; + static Map supported = {}; +} diff --git a/embeds/invoice/lib/currencies.dart b/embeds/invoice/lib/currencies.dart new file mode 100644 index 00000000..753185bc --- /dev/null +++ b/embeds/invoice/lib/currencies.dart @@ -0,0 +1,923 @@ +class Currencies { + static final all = { + "AED": { + "currency_code": "AED", + "currency_name": "United Arab Emirates dirham", + "decimal_places": 2, + "symbol": "\u062f.\u0625" + }, + "AFN": { + "currency_code": "AFN", + "currency_name": "Afghanistan afghani", + "decimal_places": 2, + "symbol": "\u060b" + }, + "AMD": { + "currency_code": "AMD", + "currency_name": "Armenian dram", + "decimal_places": 2, + "symbol": "\u058f" + }, + "ANG": { + "currency_code": "ANG", + "currency_name": "Netherlands Antillean guilder", + "decimal_places": 2, + "symbol": "\u0192" + }, + "AOA": { + "currency_code": "AOA", + "currency_name": "Angola kwanza", + "decimal_places": 2, + "symbol": "Kz" + }, + "ARS": { + "currency_code": "ARS", + "currency_name": "Argentine peso", + "decimal_places": 2, + "symbol": "\$" + }, + "AUD": { + "currency_code": "AUD", + "currency_name": "Australian dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "AWG": { + "currency_code": "AWG", + "currency_name": "Aruban guilder", + "decimal_places": 2, + "symbol": "\u0192" + }, + "AZN": { + "currency_code": "AZN", + "currency_name": "Azerbaijanian manat", + "decimal_places": 2, + "symbol": "\u20bc" + }, + "BAM": { + "currency_code": "BAM", + "currency_name": "Bosnia and Herzegovina convertible mark", + "decimal_places": 2, + "symbol": "KM" + }, + "BBD": { + "currency_code": "BBD", + "currency_name": "Barbados dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "BDT": { + "currency_code": "BDT", + "currency_name": "Bangladeshi taka", + "decimal_places": 2, + "symbol": "\u09f3" + }, + "BGN": { + "currency_code": "BGN", + "currency_name": "Bulgarian lev", + "decimal_places": 2, + "symbol": "\u043b\u0432" + }, + "BHD": { + "currency_code": "BHD", + "currency_name": "Bahraini dinar", + "decimal_places": 3, + "symbol": ".\u062f.\u0628" + }, + "BIF": { + "currency_code": "BIF", + "currency_name": "Burundian franc", + "decimal_places": 0, + "symbol": "FBu" + }, + "BMD": { + "currency_code": "BMD", + "currency_name": "Bermuda dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "BND": { + "currency_code": "BND", + "currency_name": "Brunei dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "BOB": { + "currency_code": "BOB", + "currency_name": "Bolivian boliviano", + "decimal_places": 2, + "symbol": "\$b" + }, + "BRL": { + "currency_code": "BRL", + "currency_name": "Brazilian real", + "decimal_places": 2, + "symbol": "R\$" + }, + "BSD": { + "currency_code": "BSD", + "currency_name": "Bahamian dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "BWP": { + "currency_code": "BWP", + "currency_name": "Botswana pula", + "decimal_places": 2, + "symbol": "P" + }, + "BYR": { + "currency_code": "BYR", + "currency_name": "Belarussian ruble", + "decimal_places": 0, + "symbol": "Br" + }, + "BYN": { + "currency_code": "BYN", + "currency_name": "Belarussian ruble", + "decimal_places": 2, + "symbol": "Br" + }, + "BZD": { + "currency_code": "BZD", + "currency_name": "Belize dollar", + "decimal_places": 2, + "symbol": "BZ\$" + }, + "CAD": { + "currency_code": "CAD", + "currency_name": "Canadian dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "CDF": { + "currency_code": "CDF", + "currency_name": "Congolese franc", + "decimal_places": 2, + "symbol": "FC" + }, + "CHF": { + "currency_code": "CHF", + "currency_name": "Swiss franc", + "decimal_places": 2, + "symbol": "CHF" + }, + "CLP": { + "currency_code": "CLP", + "currency_name": "Chilean peso", + "decimal_places": 0, + "symbol": "\$" + }, + "CNY": { + "currency_code": "CNY", + "currency_name": "Chinese yuan renminbi", + "decimal_places": 2, + "symbol": "\u00a5" + }, + "COP": { + "currency_code": "COP", + "currency_name": "Columbian peso", + "decimal_places": 2, + "symbol": "\$" + }, + "CRC": { + "currency_code": "CRC", + "currency_name": "Costa Rican colon", + "decimal_places": 2, + "symbol": "\u20a1" + }, + "CSK": { + "currency_code": "CSK", + "currency_name": "Czech koruna", + "decimal_places": 2 + }, + "CVE": { + "currency_code": "CVE", + "currency_name": "Cape Verde escudo", + "decimal_places": 2, + "symbol": "\$" + }, + "CZK": { + "currency_code": "CZK", + "currency_name": "Czech koruna", + "decimal_places": 2, + "symbol": "K\u010d" + }, + "DJF": { + "currency_code": "DJF", + "currency_name": "Djiboutian franc", + "decimal_places": 0, + "symbol": "Fdj" + }, + "DKK": { + "currency_code": "DKK", + "currency_name": "Danish krone", + "decimal_places": 2, + "symbol": "kr" + }, + "DOP": { + "currency_code": "DOP", + "currency_name": "Dominican peso", + "decimal_places": 2, + "symbol": "RD\$" + }, + "DZD": { + "currency_code": "DZD", + "currency_name": "Algerian dinar", + "decimal_places": 2, + "symbol": "\u062f\u062c" + }, + "EGP": { + "currency_code": "EGP", + "currency_name": "Egyptian pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "ERN": { + "currency_code": "ERN", + "currency_name": "Eritrean nakfa", + "decimal_places": 2, + "symbol": "Nfk" + }, + "ETB": { + "currency_code": "ETB", + "currency_name": "Ethiopian birr", + "decimal_places": 2, + "symbol": "Br" + }, + "EUR": { + "currency_code": "EUR", + "currency_name": "Euro", + "decimal_places": 2, + "symbol": "\u20ac" + }, + "FJD": { + "currency_code": "FJD", + "currency_name": "Fiji dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "FKP": { + "currency_code": "FKP", + "currency_name": "Falkland Islands pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "GBP": { + "currency_code": "GBP", + "currency_name": "British pound sterling", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "GEL": { + "currency_code": "GEL", + "currency_name": "Georgian lari", + "decimal_places": 2, + "symbol": "\u20be" + }, + "GHS": { + "currency_code": "GHS", + "currency_name": "Ghana cedi", + "decimal_places": 2, + "symbol": "GH\u20b5" + }, + "GIP": { + "currency_code": "GIP", + "currency_name": "Gibraltar pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "GMD": { + "currency_code": "GMD", + "currency_name": "Gambian dalasi", + "decimal_places": 2, + "symbol": "D" + }, + "GNF": { + "currency_code": "GNF", + "currency_name": "Guinean franc", + "decimal_places": 0, + "symbol": "FG" + }, + "GTQ": { + "currency_code": "GTQ", + "currency_name": "Guatemalan quetzal", + "decimal_places": 2, + "symbol": "Q" + }, + "GWP": { + "currency_code": "GWP", + "currency_name": "Guinea-Bissau peso", + "decimal_places": 0 + }, + "GYD": { + "currency_code": "GYD", + "currency_name": "Guyanese dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "HKD": { + "currency_code": "HKD", + "currency_name": "Hong Kong dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "HNL": { + "currency_code": "HNL", + "currency_name": "Hunduran Lempira", + "decimal_places": 2, + "symbol": "L" + }, + "HRK": { + "currency_code": "HRK", + "currency_name": "Croatian kuna", + "decimal_places": 2, + "symbol": "kn" + }, + "HTG": { + "currency_code": "HTG", + "currency_name": "Haitian gourde", + "decimal_places": 2, + "symbol": "G" + }, + "HUF": { + "currency_code": "HUF", + "currency_name": "Hungarian forint", + "decimal_places": 0, + "symbol": "Ft" + }, + "IDR": { + "currency_code": "IDR", + "currency_name": "Indonesian rupiah", + "decimal_places": 2, + "symbol": "Rp" + }, + "ILS": { + "currency_code": "ILS", + "currency_name": "Israeli sheqel", + "decimal_places": 2, + "symbol": "\u20aa" + }, + "INR": { + "currency_code": "INR", + "currency_name": "Indian rupee", + "decimal_places": 0, + "symbol": "\u20b9" + }, + "IQD": { + "currency_code": "IQD", + "currency_name": "Iraqi dinar", + "decimal_places": 3, + "symbol": "\u0639.\u062f" + }, + "ISK": { + "currency_code": "ISK", + "currency_name": "Icelandic krona", + "decimal_places": 2, + "symbol": "kr" + }, + "JMD": { + "currency_code": "JMD", + "currency_name": "Jamaican dollar", + "decimal_places": 2, + "symbol": "J\$" + }, + "JOD": { + "currency_code": "JOD", + "currency_name": "Jordanian dinar", + "decimal_places": 3, + "symbol": "JD" + }, + "JPY": { + "currency_code": "JPY", + "currency_name": "Japanese yen", + "decimal_places": 0, + "symbol": "\u00a5" + }, + "KES": { + "currency_code": "KES", + "currency_name": "Kenyan shilling", + "decimal_places": 2, + "symbol": "KSh" + }, + "KGS": { + "currency_code": "KGS", + "currency_name": "Kyrgyzstani som", + "decimal_places": 2, + "symbol": "\u043b\u0432" + }, + "KHR": { + "currency_code": "KHR", + "currency_name": "Cambodian riel", + "decimal_places": 2, + "symbol": "\u17db" + }, + "KMF": { + "currency_code": "KMF", + "currency_name": "Comoro franc", + "decimal_places": 0, + "symbol": "CF" + }, + "KRW": { + "currency_code": "KRW", + "currency_name": "South Korean won", + "decimal_places": 0, + "symbol": "\u20a9" + }, + "KWD": { + "currency_code": "KWD", + "currency_name": "Kuwaiti dinar", + "decimal_places": 3, + "symbol": "KD" + }, + "KYD": { + "currency_code": "KYD", + "currency_name": "Cayman Islands dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "KZT": { + "currency_code": "KZT", + "currency_name": "Kazakhstani tenge", + "decimal_places": 2, + "symbol": "\u043b\u0432" + }, + "LAK": { + "currency_code": "LAK", + "currency_name": "Lao kip", + "decimal_places": 2, + "symbol": "\u20ad" + }, + "LBP": { + "currency_code": "LBP", + "currency_name": "Lebanese pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "LKR": { + "currency_code": "LKR", + "currency_name": "Sri Lanka rupee", + "decimal_places": 2, + "symbol": "\u20a8" + }, + "LRD": { + "currency_code": "LRD", + "currency_name": "Liberian dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "LSL": { + "currency_code": "LSL", + "currency_name": "Lesotho loti", + "decimal_places": 2, + "symbol": "M" + }, + "LTL": { + "currency_code": "LTL", + "currency_name": "Lithuanian litas", + "decimal_places": 2, + "symbol": "Lt" + }, + "LVL": { + "currency_code": "LVL", + "currency_name": "Latvian lats", + "decimal_places": 2, + "symbol": "Ls" + }, + "MAD": { + "currency_code": "MAD", + "currency_name": "Moroccan dirham", + "decimal_places": 2, + "symbol": "MAD" + }, + "MDL": { + "currency_code": "MDL", + "currency_name": "Moldovan leu", + "decimal_places": 2, + "symbol": "lei" + }, + "MGA": { + "currency_code": "MGA", + "currency_name": "Malagasy ariary", + "decimal_places": 0, + "symbol": "Ar" + }, + "MKD": { + "currency_code": "MKD", + "currency_name": "Macedonian denar", + "decimal_places": 2, + "symbol": "\u0434\u0435\u043d" + }, + "MMK": { + "currency_code": "MMK", + "currency_name": "Myanmar kyat", + "decimal_places": 2, + "symbol": "K" + }, + "MNT": { + "currency_code": "MNT", + "currency_name": "Mongolian tugrik", + "decimal_places": 2, + "symbol": "\u20ae" + }, + "MOP": { + "currency_code": "MOP", + "currency_name": "Macanese pataca", + "decimal_places": 2, + "symbol": "MOP\$" + }, + "MRO": { + "currency_code": "MRO", + "currency_name": "Mauritanian ouguiya", + "decimal_places": 2, + "symbol": "UM" + }, + "MUR": { + "currency_code": "MUR", + "currency_name": "Mauritius rupee", + "decimal_places": 2, + "symbol": "\u20a8" + }, + "MVR": { + "currency_code": "MVR", + "currency_name": "Maldivian rufiyaa", + "decimal_places": 2, + "symbol": "Rf" + }, + "MWK": { + "currency_code": "MWK", + "currency_name": "Malawian kwacha", + "decimal_places": 2, + "symbol": "MK" + }, + "MXN": { + "currency_code": "MXN", + "currency_name": "Mexican peso", + "decimal_places": 2, + "symbol": "\$" + }, + "MYR": { + "currency_code": "MYR", + "currency_name": "Malaysian ringgit", + "decimal_places": 2, + "symbol": "RM" + }, + "MZN": { + "currency_code": "MZN", + "currency_name": "Mozambican metical", + "decimal_places": 2, + "symbol": "MT" + }, + "NAD": { + "currency_code": "NAD", + "currency_name": "Namibian dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "NGN": { + "currency_code": "NGN", + "currency_name": "Nigerian naira", + "decimal_places": 2, + "symbol": "\u20a6" + }, + "NIO": { + "currency_code": "NIO", + "currency_name": "Cordoba oro", + "decimal_places": 2, + "symbol": "C\$" + }, + "NOK": { + "currency_code": "NOK", + "currency_name": "Norwegian krone", + "decimal_places": 2, + "symbol": "kr" + }, + "NPR": { + "currency_code": "NPR", + "currency_name": "Nepalese rupee", + "decimal_places": 2, + "symbol": "\u20a8" + }, + "NZD": { + "currency_code": "NZD", + "currency_name": "New Zealand dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "OMR": { + "currency_code": "OMR", + "currency_name": "Omani rial", + "decimal_places": 3, + "symbol": "\ufdfc" + }, + "PAB": { + "currency_code": "PAB", + "currency_name": "Panamanian balboa", + "decimal_places": 2, + "symbol": "B/." + }, + "PEN": { + "currency_code": "PEN", + "currency_name": "Peruvian nuevo sol", + "decimal_places": 2, + "symbol": "S/." + }, + "PGK": { + "currency_code": "PGK", + "currency_name": "Papua New Guinean kina", + "decimal_places": 2, + "symbol": "K" + }, + "PHP": { + "currency_code": "PHP", + "currency_name": "Philippine peso", + "decimal_places": 2, + "symbol": "\u20b1" + }, + "PKR": { + "currency_code": "PKR", + "currency_name": "Pakistan rupee", + "decimal_places": 2, + "symbol": "\u20a8" + }, + "PLN": { + "currency_code": "PLN", + "currency_name": "Polish zloty", + "decimal_places": 2, + "symbol": "z\u0142" + }, + "PYG": { + "currency_code": "PYG", + "currency_name": "Paraguayan guarani", + "decimal_places": 0, + "symbol": "Gs" + }, + "QAR": { + "currency_code": "QAR", + "currency_name": "Qatari rial", + "decimal_places": 2, + "symbol": "\ufdfc" + }, + "RON": { + "currency_code": "RON", + "currency_name": "Romanian leu", + "decimal_places": 2, + "symbol": "lei" + }, + "RSD": { + "currency_code": "RSD", + "currency_name": "Serbian dinar", + "decimal_places": 2, + "symbol": "\u0414\u0438\u043d." + }, + "RUB": { + "currency_code": "RUB", + "currency_name": "Russian ruble", + "decimal_places": 2, + "symbol": "\u20bd" + }, + "RWF": { + "currency_code": "RWF", + "currency_name": "Rwanda franc", + "decimal_places": 0, + "symbol": "R\u20a3" + }, + "SAR": { + "currency_code": "SAR", + "currency_name": "Saudi Arabian riyal", + "decimal_places": 2, + "symbol": "\ufdfc" + }, + "SBD": { + "currency_code": "SBD", + "currency_name": "Solomon Islands dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "SCR": { + "currency_code": "SCR", + "currency_name": "Seychelles rupee", + "decimal_places": 2, + "symbol": "\u20a8" + }, + "SEK": { + "currency_code": "SEK", + "currency_name": "Swedish krona", + "decimal_places": 2, + "symbol": "kr" + }, + "SGD": { + "currency_code": "SGD", + "currency_name": "Singapore dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "SHP": { + "currency_code": "SHP", + "currency_name": "Saint Helena pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "SLL": { + "currency_code": "SLL", + "currency_name": "Sierra Leonean leone", + "decimal_places": 2, + "symbol": "Le" + }, + "SOS": { + "currency_code": "SOS", + "currency_name": "Somali shilling", + "decimal_places": 2, + "symbol": "S" + }, + "SRD": { + "currency_code": "SRD", + "currency_name": "Surinamese dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "SSP": { + "currency_code": "SSP", + "currency_name": "South Sudanese pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "STD": { + "currency_code": "STD", + "currency_name": "Sao Tome and Principe dobra", + "decimal_places": 2, + "symbol": "Db" + }, + "SYP": { + "currency_code": "SYP", + "currency_name": "Syrian pound", + "decimal_places": 2, + "symbol": "\u00a3" + }, + "SZL": { + "currency_code": "SZL", + "currency_name": "Swaziland lilangeni", + "decimal_places": 2, + "symbol": "E" + }, + "THB": { + "currency_code": "THB", + "currency_name": "Thai baht", + "decimal_places": 0, + "symbol": "\u0e3f" + }, + "TJS": { + "currency_code": "TJS", + "currency_name": "Tajikistani somoni", + "decimal_places": 2, + "symbol": "SM" + }, + "TND": { + "currency_code": "TND", + "currency_name": "Tunisian dinar", + "decimal_places": 3, + "symbol": "\u062f.\u062a" + }, + "TOP": { + "currency_code": "TOP", + "currency_name": "Tongan pa\u2019anga", + "decimal_places": 2, + "symbol": "T\$" + }, + "TRY": { + "currency_code": "TRY", + "currency_name": "Turkish lira", + "decimal_places": 2, + "symbol": "\u20ba" + }, + "TTD": { + "currency_code": "TTD", + "currency_name": "Trinidad and Tobago dollar", + "decimal_places": 2, + "symbol": "TT\$" + }, + "TWD": { + "currency_code": "TWD", + "currency_name": "Taiwan dollar", + "decimal_places": 2, + "symbol": "NT\$" + }, + "TZS": { + "currency_code": "TZS", + "currency_name": "Tanzanian shilling", + "decimal_places": 2, + "symbol": "TSh" + }, + "UAH": { + "currency_code": "UAH", + "currency_name": "Ukrainian hryvnia", + "decimal_places": 2, + "symbol": "\u20b4" + }, + "UGX": { + "currency_code": "UGX", + "currency_name": "Ugandan shilling", + "decimal_places": 2, + "symbol": "USh" + }, + "USD": { + "currency_code": "USD", + "currency_name": "United States dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "UYU": { + "currency_code": "UYU", + "currency_name": "Uruguayan peso", + "decimal_places": 2, + "symbol": "\$U" + }, + "UZS": { + "currency_code": "UZS", + "currency_name": "Uzbekistan som", + "decimal_places": 2, + "symbol": "\u043b\u0432" + }, + "VEF": { + "currency_code": "VEF", + "currency_name": "Venezuelan bolivar fuerte", + "decimal_places": 2, + "symbol": "Bs" + }, + "VES": { + "currency_code": "VES", + "currency_name": "Venezuelan bolivar soberano", + "decimal_places": 0 + }, + "VND": { + "currency_code": "VND", + "currency_name": "Vietnamese dong", + "decimal_places": 0, + "symbol": "\u20ab" + }, + "VUV": { + "currency_code": "VUV", + "currency_name": "Vanuatu vatu", + "decimal_places": 0, + "symbol": "VT" + }, + "WST": { + "currency_code": "WST", + "currency_name": "Samoan tala", + "decimal_places": 2, + "symbol": "WS\$" + }, + "XAF": { + "currency_code": "XAF", + "currency_name": "CFA franc BEAC", + "decimal_places": 0, + "symbol": "FCFA" + }, + "XCD": { + "currency_code": "XCD", + "currency_name": "East Caribbean dollar", + "decimal_places": 2, + "symbol": "\$" + }, + "XOF": { + "currency_code": "XOF", + "currency_name": "CFA Franc BCEAO", + "decimal_places": 0, + "symbol": "CFA" + }, + "XPF": { + "currency_code": "XPF", + "currency_name": "CFP franc", + "decimal_places": 0, + "symbol": "\u20a3" + }, + "YER": { + "currency_code": "YER", + "currency_name": "Yemeni rial", + "decimal_places": 2, + "symbol": "\ufdfc" + }, + "ZAR": { + "currency_code": "ZAR", + "currency_name": "South African rand", + "decimal_places": 2, + "symbol": "R" + }, + "ZMK": { + "currency_code": "ZMK", + "currency_name": "Zambian kwacha", + "decimal_places": 2 + }, + "ZMW": { + "currency_code": "ZMW", + "currency_name": "Zambian kwacha", + "decimal_places": 2 + }, + "ZWD": { + "currency_code": "ZWD", + "currency_name": "Zimbabwean dollar", + "decimal_places": 2, + "symbol": "Z\$" + }, + }; +} diff --git a/embeds/invoice/lib/main.dart b/embeds/invoice/lib/main.dart new file mode 100644 index 00000000..25fd27d0 --- /dev/null +++ b/embeds/invoice/lib/main.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart' hide Router; +import 'package:flutter/services.dart'; +import 'app_controller.dart'; +import 'router.dart'; + +void main() { + Router.setupRouter(); + runApp(AnypayInvoice()); +} + +class AnypayInvoice extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return AppController(builder: (context) { + var theme; + + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); + theme = AppController.lightTheme; + + if (AppController.enableDarkMode) { + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light); + theme = AppController.darkTheme; + } + + return MaterialApp( + onGenerateRoute: Router.router.generator, + navigatorKey: AppController.globalKey, + title: 'Anypay Cash Register', + initialRoute: '/', + theme: theme, + ); + }); + } +} diff --git a/embeds/invoice/lib/models/invoice.dart b/embeds/invoice/lib/models/invoice.dart new file mode 100644 index 00000000..8bdbe6ce --- /dev/null +++ b/embeds/invoice/lib/models/invoice.dart @@ -0,0 +1,173 @@ +import "package:intl/intl.dart"; +import 'package:app/currencies.dart'; +import 'package:app/client.dart'; +import 'dart:convert'; +import 'dart:io'; + +class Invoice { + String denominationCurrency; + num denominationAmountPaid; + num denominationAmount; + DateTime completedAt; + String blockchainUrl; + List paymentOptions; + String itemName; + String currency; + DateTime expiry; + String address; + int accountId; + bool complete; + String status; + String hash; + List notes; + num amount; + String uri; + String uid; + + Invoice({ + this.denominationAmountPaid, + this.denominationCurrency, + this.denominationAmount, + this.paymentOptions, + this.blockchainUrl, + this.completedAt, + this.accountId, + this.complete, + this.itemName, + this.currency, + this.address, + this.notes, + this.amount, + this.status, + this.expiry, + this.hash, + this.uri, + this.uid, + }); + + String getBlockchainUrl() { + if (blockchainUrl != null && blockchainUrl.length > 0) + return blockchainUrl; + else if (currency == 'BSV') + return "https://whatsonchain.com/tx/$hash"; + else if (currency == 'BCH') + return "https://explorer.bitcoin.com/bch/tx/$hash"; + else if (currency == 'DASH') + return "https://chainz.cryptoid.info/dash/tx.dws?$hash"; + } + + String noteText() { + return (notes ?? []).map((note) => note['content']).join(", "); + } + + String orderNotes() { + if (notes != null && notes.length > 0) + return "Order notes: ${noteText()}"; + else return ""; + } + + int decimalPlaces() { + return (Currencies.all[denominationCurrency] ?? {})['decimal_places'] ?? 2; + } + + String paidAmountWithDenomination() { + return amountWithDenomination(denominationAmountPaid); + } + + String amountWithDenomination([amount = null]) { + var defaultCurrency = 'USD'; + var symbol = (Currencies.all[denominationCurrency ?? defaultCurrency] ?? {})['symbol'] ?? ""; + amount ??= denominationAmount; + + try { + return NumberFormat.currency( + decimalDigits: decimalPlaces(), + locale: Platform.localeName, + symbol: symbol, + ).format(amount); + } catch(e) { + // Fallback in case there is an unsupported locale + var str = amount.toStringAsFixed(decimalPlaces()); + str = str.replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'); + return "$symbol$str"; + } + } + + String inCurrency() { + var defaultCurrency = 'USD'; + var symbol = Currencies.all[denominationCurrency ?? defaultCurrency]['symbol']; + return "$amount $currency"; + } + + bool get isUnpaid => status == 'unpaid'; + + bool get isUnderpaid => status == 'underpaid'; + + bool get isPaid => status == 'paid' || status == 'overpaid'; + + bool get isExpired => expiry.isBefore(DateTime.now()); + + Map get bsvPaymentOption { + return paymentOptions.firstWhere((option) => option['currency'] == 'BSV', orElse: () => null); + } + + String urlStyleUri([useCurrency]) { + useCurrency = useCurrency ?? currency; + String host = Client.host; + String protocol = { + 'BTC': 'bitcoin', + 'BCH': 'bitcoincash', + 'DASH': 'dash', + 'BSV': 'pay', + }[useCurrency] ?? 'pay'; + + return "$protocol:?r=$host/r/$uid"; + } + + String uriFor(currency, {format}) { + if (format == 'pay') return "pay:?r=${Client.host}/r/$uid"; + if (format == 'url') return urlStyleUri(currency); + + return paymentOptionFor(currency)['uri']; + } + + Map paymentOptionFor(currency) { + return paymentOptions.firstWhere((option) { + return option['currency'] == currency; + }) ?? {}; + } + + String formatCompletedAt() { + if (completedAt == null) return ''; + else return DateFormat('E, MMMM d, h:mma').format(completedAt); + } + + factory Invoice.fromMap(Map body) { + var json = body; + return Invoice( + completedAt: json['completed_at'] == null ? null : DateTime.parse(json['completed_at']).toLocal(), + expiry: json['expiry'] == null ? null : DateTime.parse(json['expiry']).toLocal(), + denominationAmountPaid: json['denomination_amount_paid'], + denominationCurrency: json['denomination_currency'], + denominationAmount: json['denomination_amount'], + paymentOptions: json['payment_options'], + blockchainUrl: json['blockchain_url'], + complete: json['complete'] ?? false, + accountId: json['account_id'], + itemName: json['item_name'], + currency: json['currency'], + address: json['address'], + amount: json['amount'], + status: json['status'], + notes: json['notes'], + hash: json['hash'], + uri: json['uri'], + uid: json['uid'], + ); + } + + factory Invoice.fromJson(String body) { + return Invoice.fromMap(jsonDecode(body)); + } +} + diff --git a/embeds/invoice/lib/router.dart b/embeds/invoice/lib/router.dart new file mode 100644 index 00000000..d47d0be9 --- /dev/null +++ b/embeds/invoice/lib/router.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart' hide Router; +import 'package:fluro/fluro.dart'; +import 'routes/invoice.dart'; + +class Home extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container(); + } +} + +class Router { + static FluroRouter router = FluroRouter(); + + static newHandler(klass, [key]) { + return Handler(handlerFunc: (BuildContext context, Map params) { + if (key == null) return klass(); + else return klass(params[key][0]); + }); + } + + static void setupRouter() { + router.define( + '/', + // Replace this with a blank page? Or maybe remove it entirely? + handler: newHandler(() => Home()), + transitionType: TransitionType.inFromBottom, + ); + router.define( + '/invoices/:id', + handler: newHandler((id) => ShowInvoice(id), 'id'), + transitionType: TransitionType.inFromBottom, + ); + } +} diff --git a/embeds/invoice/lib/routes/home.dart b/embeds/invoice/lib/routes/home.dart new file mode 100644 index 00000000..239c9d88 --- /dev/null +++ b/embeds/invoice/lib/routes/home.dart @@ -0,0 +1,2 @@ +class Home extends StatelessWidget { +} diff --git a/embeds/invoice/lib/routes/invoice.dart b/embeds/invoice/lib/routes/invoice.dart new file mode 100644 index 00000000..0570c419 --- /dev/null +++ b/embeds/invoice/lib/routes/invoice.dart @@ -0,0 +1,675 @@ +import 'package:moneybutton_flutter_web/moneybutton_flutter_web.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:qr_flutter/qr_flutter.dart'; +import 'package:confetti/confetti.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:app/models/invoice.dart'; +import 'package:app/app_controller.dart'; +import 'package:app/back_button.dart'; +import 'package:app/client.dart'; +import 'package:app/coins.dart'; +import 'dart:async'; +import 'dart:html'; + +import 'package:url_launcher/url_launcher.dart' + if (dart.library.html) '../web_launcher.dart'; + + +class ShowInvoice extends StatelessWidget { + ShowInvoice(this.id); + + final String id; + + @override + Widget build(BuildContext context) { + return InvoicePage(id: id); + } +} + +class InvoicePage extends StatefulWidget { + InvoicePage({Key key, this.id}) : super(key: key); + + final String id; + + @override + _InvoicePageState createState() => _InvoicePageState(id); +} + +class _InvoicePageState extends State { + _InvoicePageState(this.id); + + Map chosenPaymentOption; + bool _showLinkToWalletHelp = false; + bool businessNameFetched = false; + bool _moneyButtonLoaded = false; + bool choosingCurrency = false; + String _successMessage = ''; + bool usePayProtocol = true; + bool _invoiceReady = false; + bool _submitting = false; + StreamSubscription event; + Timer havingTroubleTimer; + bool useUrlStyle = true; + bool _disposed = false; + Timer periodicRequest; + String _errorMessage; + String businessName; + String currency; + Color qrColor; + String uri; + String id; + + + Invoice invoice; + Map get bsvPaymentOption => invoice.bsvPaymentOption; + + final FocusNode keyboardFocusNode = FocusNode(); + + + @override + Widget build(BuildContext context) { + FocusScope.of(context).requestFocus(keyboardFocusNode); // <-- yup. magic. no idea. + return RawKeyboardListener( + focusNode: keyboardFocusNode, + autofocus: true, + onKey: (key) { + if (key.data.keyLabel == 'Escape') + postMessage(event: 'close'); + }, + child: GestureDetector( + onTap: _closeKeyboard, + child: Scaffold( + floatingActionButton: Stack( + children: [ + Align( + alignment: Alignment.topLeft, + child: CircleBackButton( + margin: EdgeInsets.all(AppController.scale(30)), + onTap: () => postMessage(event: 'close'), + ), + ), + Align( + alignment: Alignment.bottomRight, + child: Visibility( + visible: _showInvoice(), + child: GestureDetector( + onTap: _openHelpUrl, + child: Image( + image: AssetImage(AppController.havingIssuesImagePath()), + width: AppController.scale(40), + ) + ) + ), + ), + ] + ), + body: Center( + // child: Expanded( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + _PageContent(), + Container(), + ], + ), + ), + // ), + ), + ), + ), + ); + } + + @override + void dispose() { + event.cancel(); + super.dispose(); + _disposed = true; + periodicRequest.cancel(); + havingTroubleTimer.cancel(); + } + + void _copyUri() { + Clipboard.setData(ClipboardData(text: uri)); + setState(() => _successMessage = "Coppied!" ); + Timer(Duration(seconds: 2), () { + setState(() => _successMessage = "" ); + }); + } + + void _openHelpUrl() async { + await launch("https://api.anypayinc.com/support/unauthenticated"); + } + + void _openUri() async { + await launch(uri); + } + + void _done() { + if (_submitting) return; + _closeKeyboard(); + setState(() { + _submitting = true; + }); + periodicRequest.cancel(); + } + + void _backToNewInvoice() { + AppController.closeUntilPath('/new-invoice'); + } + + void _toggleUrlStyle() { + useUrlStyle = !useUrlStyle; + _rebuild(); + } + + void _chooseCurrency() { + if (invoice.paymentOptions.length > 1) + choosingCurrency = true; + _rebuild(); + } + + String getFormat() { + if (usePayProtocol) + return 'pay'; + else if (useUrlStyle) + return 'url'; + } + + void _rebuild() { + setState(() { + currency = currency ?? invoice?.currency; + uri = invoice?.uriFor(currency, format: getFormat()); + }); + if (invoice != null && _invoiceReady == false) { + Timer(Duration(milliseconds: 10), () { + _invoiceReady = true; + _rebuild(); + }); + } + } + + void _fetchInvoice() { + if (invoice == null || (invoice.isUnpaid && !invoice.isExpired)) + Client.getInvoice(id).then((response) { + _errorMessage = null; + if (response['success']) { + var wasExpired = invoice?.isExpired; + var statusWas = invoice?.status; + invoice = response['invoice']; + if (invoice.isExpired == true) { + if (wasExpired != true) + postMessage(event: 'update', status: 'expired'); + } else if (statusWas != invoice.status) + postMessage(event: 'update', status: invoice.status); + + _fetchBusinessName(); + } else _errorMessage = response['message']; + + // Checking if disposed to prevent memory leaks + if (!_disposed) _rebuild(); + }); + } + + void postMessage({event, status}) { + var message = { + 'from': "anypay", + 'event': event, + }; + if (status != null) + message['status'] = status; + window.parent.postMessage(message, '*'); + } + + void _fetchBusinessName() { + if (invoice?.accountId == null || businessNameFetched) return; + businessNameFetched = true; + Client.getAccount(invoice.accountId).then((response) { + if (response['success']) + businessName = response['body']['name']; + print("NAME::::::: ${businessName}"); + }); + } + + + + @override + void initState() { + super.initState(); + _fetchInvoice(); + qrColor = AppController.randomColor; + periodicRequest = Timer.periodic(Duration(seconds: 2), (timer) => _fetchInvoice()); + havingTroubleTimer = Timer(Duration(seconds: 50), () { + setState(() => _showLinkToWalletHelp = true ); + }); + // Use if we rebuild with server events: + // Use if we rebuild with server events: + // Use if we rebuild with server events: + // Use if we rebuild with server events: + // + // event = Events.on('invoice.paid', (payload) { + // invoice = Invoice.fromMap(payload); + // _rebuild(); + // }); + } + + Widget _ChooseCurrencyMenu() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 300, + child: GestureDetector( + behavior: HitTestBehavior.translucent, + child: _PaymentTitle('anypay'), + onTap: () { + choosingCurrency = false; + usePayProtocol = true; + _rebuild(); + }, + ) + ), + ...(invoice.paymentOptions.map((option) { + return Container( + width: 300, + margin: EdgeInsets.only(top: 10), + child: GestureDetector( + behavior: HitTestBehavior.translucent, + child: _PaymentTitle(option['currency'], paymentOption: option), + onTap: () { + currency = option['currency']; + chosenPaymentOption = option; + choosingCurrency = false; + usePayProtocol = false; + useUrlStyle = true; + _rebuild(); + }, + ) + ); + })), + ] + ); + } + + Widget _UnderpaidScreen() { + return Container( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + color: AppController.red, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.error_outline, + size: 120, + ), + Container( + margin: EdgeInsets.only(top: 20, bottom: 20), + child: Text(invoice.amountWithDenomination(), + style: TextStyle( + fontWeight: FontWeight.bold, + decoration: TextDecoration.lineThrough, + color: Theme.of(context).primaryColorLight, + fontSize: 28, + ), + ), + ), + Text(invoice.paidAmountWithDenomination(), + style: TextStyle( + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColorLight, + fontSize: 28, + ), + ), + ] + ) + ); + } + + Widget _WebShareOptions() { + return Container( + width: 235, + margin: EdgeInsets.only(top: 20.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: _copyUri, + child: Row( + children: [ + Text('Copy', style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.bold, + )), + Container( + padding: EdgeInsets.only(left: 15), + child: Image( + image: AppController.enableDarkMode ? + AssetImage('assets/images/copy_icon-white.png') : + AssetImage('assets/images/copy_icon.png'), + width: 20, + ) + ) + ] + ) + ), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: _openUri, + child: Row( + children: [ + Text('Open Wallet', style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.bold, + )), + Container( + padding: EdgeInsets.only(left: 15), + child: Image( + image: AppController.enableDarkMode ? + AssetImage('assets/images/wallet_icon-white.png') : + AssetImage('assets/images/wallet_icon.png'), + width: 20, + ) + ) + ] + ) + ), + ] + ), + ); + } + + Widget _PaidScreen() { + return Container( + width: MediaQuery.of(context).size.width, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + child: Image( + width: AppController.scale(140), + image: AssetImage('assets/images/anypay-logo.png') + ), + ), + ConfettiWidget( + confettiController: ConfettiController( + duration: Duration(seconds: 1), + )..play(), + blastDirectionality: BlastDirectionality.explosive, + maxBlastForce: 60, + minBlastForce: 30, + numberOfParticles: 20, + shouldLoop: false, + colors: AppController.colors, + ), + Container( + child: Text('PAID!', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Color(0xFF34b83a), + fontSize: AppController.scale(48, minValue: 44), + ), + ), + ), + Container( + child: Text(businessName ?? "", + style: TextStyle( + color: Theme.of(context).primaryColorDark, + fontSize: 20, + ), + ), + ), + Container( + margin: EdgeInsets.only(top: AppController.scale(35), bottom: 5), + child: Text(invoice.amountWithDenomination(), + style: TextStyle( + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColorDark, + fontSize: 28, + ), + ), + ), + Container( + margin: EdgeInsets.only(bottom: AppController.scale(35)), + child: Text(invoice.inCurrency(), + style: TextStyle( + color: Theme.of(context).primaryColorDark, + fontSize: 20, + ), + ), + ), + Visibility( + visible: (invoice.notes ?? []).length > 0, + child: Column( + children: [ + Text("Order Notes:", + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of(context).primaryColorDark, + fontSize: 20, + ), + ), + Container( + width: 300, + margin: EdgeInsets.only(top: 5), + child: Text(invoice.noteText(), + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of(context).primaryColorDark, + fontWeight: FontWeight.bold, + fontSize: 28, + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: AppController.scale(30), bottom: 20), + child: _submitting ? + SpinKitCircle( + size: AppController.scale(50, minValue: 40), + color: AppController.randomColor, + ) : Container(), + ) + ] + ) + ); + } + + Widget _ExpiredInvoice() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(bottom: 35), + child: Text("Invoice Expired", + style: TextStyle( + fontSize: 31, + color: Theme.of(context).primaryColorLight, + ) + ) + ), + ], + ); + } + + Widget _PaymentTitle(currency, {paymentOption}) { + paymentOption = paymentOption ?? chosenPaymentOption; + var coinDetailsSpecified = paymentOption != null; + var coinIsSupported = Coins.supported[currency] != null; + + paymentOption = paymentOption ?? {}; + if (currency == 'anypay' || coinIsSupported || coinDetailsSpecified) + return Container( + child: Row( + children: currency == 'anypay' ? [ + Container( + width: 60, + child: Image( + image: AssetImage('assets/images/anypay-logo.png') + ), + ), + Text('Anypay', + style: TextStyle(fontSize: 35), + ), + ] : [ + Container( + width: 40, + height: 40, + margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 15, bottom: 15), + child: Image.network(paymentOption['currency_logo_url'] ?? Coins.supported[currency]['icon']), + ), + Text(paymentOption['currency_name'] ?? Coins.supported[currency]['name'], + style: TextStyle(fontSize: 40), + ), + ] + ) + ); + else return Container(); + } + + bool _showInvoice() { + return invoice != null && + !invoice.isUnderpaid && + !invoice.isExpired && + !invoice.isPaid && + !choosingCurrency; + } + + Widget _PageContent() { + if (_showInvoice()) + return _InvoiceComponent(); + else if (invoice == null) + if (_errorMessage != null) + return Text(_errorMessage, style: TextStyle(color: AppController.red)); + else return Container( + child: SpinKitCircle(color: qrColor), + height: AppController.scale(360), + ); + else if (invoice.isUnderpaid) + return _UnderpaidScreen(); + else if (invoice.isPaid) + return _PaidScreen(); + else if (choosingCurrency) + return _ChooseCurrencyMenu(); + else if (invoice.isExpired) + return _ExpiredInvoice(); + } + + Widget _InvoiceComponent() { + return AnimatedOpacity( + opacity: _invoiceReady ? 1.0 : 0.0, + duration: Duration(milliseconds: 300), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text(_successMessage, + style: TextStyle(color: AppController.green), + ), + Visibility( + visible: _showLinkToWalletHelp, + child: GestureDetector( + onTap: _openHelpUrl, + child: Text('Having trouble paying?', + style: TextStyle(color: AppController.blue) + ) + ), + ), + GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: _chooseCurrency, + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _PaymentTitle(usePayProtocol ? 'anypay' : currency), + Visibility( + visible: invoice.paymentOptions.length > 1, + child: Container( + width: 40, + height: 42, + margin: EdgeInsets.only(right: 10.0), + child: Icon(Icons.expand_more, size: 50) + ) + ) + ] + ), + ), + ), + Card( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 12.0, + color: qrColor, + ), + borderRadius: BorderRadius.all(Radius.circular(18.0)), + ), + child: Container( + color: AppController.white, + margin: EdgeInsets.all(12.0), + child: GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: _toggleUrlStyle, + child: QrImage( + foregroundColor: Color(0xFF404040), + version: QrVersions.auto, + size: AppController.scale(220, maxValue: 280, minValue: 100), + data: uri, + ), + ), + ), + ), + _WebShareOptions(), + Container( + width: 300, + height: 150, + child: OverflowBox( + alignment: Alignment.topCenter, + maxHeight: 300, + child: SingleChildScrollView( + physics: NeverScrollableScrollPhysics(), + child: Container( + child: kIsWeb && bsvPaymentOption == null ? null : + MoneyButton({ + 'clientIdentifier': '3de67950b83c16c9dd343f691bc71887', + 'outputs': [{ + "to": bsvPaymentOption['address'], + "amount": bsvPaymentOption['amount'], + "currency": bsvPaymentOption['currency'], + }, { + 'to': 'steven@simply.cash', + 'amount': 0.00009, // $0.02 + 'currency': 'BSV' + }], + 'buttonId': bsvPaymentOption['invoice_uid'], + }, width: 200, + height: 300, + onLoaded: () { + _moneyButtonLoaded = true; + }, + ), + ) + ) + ) + ) + ] + ) + ); + } + + void _closeKeyboard() { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) + currentFocus.unfocus(); + } +} + + + diff --git a/embeds/invoice/lib/web_launcher.dart b/embeds/invoice/lib/web_launcher.dart new file mode 100644 index 00000000..f7032d37 --- /dev/null +++ b/embeds/invoice/lib/web_launcher.dart @@ -0,0 +1,6 @@ +import 'dart:html' show window; + +void launch(url) async { + await window.open(url, ""); +} + diff --git a/embeds/invoice/pubspec.lock b/embeds/invoice/pubspec.lock new file mode 100644 index 00000000..dcacbfe0 --- /dev/null +++ b/embeds/invoice/pubspec.lock @@ -0,0 +1,392 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.5" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0-nullsafety.3" + basic_utils: + dependency: "direct main" + description: + name: basic_utils + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.3" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.5" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.3" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0-nullsafety.5" + confetti: + dependency: "direct main" + description: + name: confetti + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.4+1" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" + easy_web_view: + dependency: transitive + description: + name: easy_web_view + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.3" + fluro: + dependency: "direct main" + description: + name: fluro + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.8" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_markdown: + dependency: transitive + description: + name: flutter_markdown + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + flutter_spinkit: + dependency: "direct main" + description: + name: flutter_spinkit + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.2+1" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + html2md: + dependency: transitive + description: + name: html2md + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.1" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3-nullsafety.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.4" + markdown: + dependency: transitive + description: + name: markdown + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.8" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10-nullsafety.3" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.6" + moneybutton_flutter_web: + dependency: "direct main" + description: + path: "." + ref: e4f37467181a52593af5720ab9830e1ab58c411b + resolved-ref: e4f37467181a52593af5720ab9830e1ab58c411b + url: "https://github.com/BananaNeil/moneybutton_flutter_web.git" + source: git + version: "0.1.2" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.3" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.2" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + qr: + dependency: transitive + description: + name: qr + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + qr_flutter: + dependency: "direct main" + description: + name: qr_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + random_color: + dependency: transitive + description: + name: random_color + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0-nullsafety.4" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0-nullsafety.6" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.3" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.3" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19-nullsafety.6" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0-nullsafety.5" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.5.2" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+1" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0-nullsafety.5" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.24" +sdks: + dart: ">=2.12.0-0.0 <3.0.0" + flutter: ">=1.22.0 <2.0.0" diff --git a/embeds/invoice/pubspec.yaml b/embeds/invoice/pubspec.yaml new file mode 100644 index 00000000..9c964536 --- /dev/null +++ b/embeds/invoice/pubspec.yaml @@ -0,0 +1,100 @@ +name: app +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 0.1.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + basic_utils: '^2.5.3' + # timeago: '^2.0.26' + # http: '^0.12.1' + intl: '^0.16.1' + fluro: '^1.7.8' + confetti: '^0.5.2' + qr_flutter: '^3.2.0' + url_launcher: '5.5.2' + flutter_spinkit: '^4.1.2' + moneybutton_flutter_web: # '^0.1.2' + git: + # Patched the monebutton package to add the ability to change the height of the widget + url: https://github.com/BananaNeil/moneybutton_flutter_web.git + ref: e4f37467181a52593af5720ab9830e1ab58c411b + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^0.1.3 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + assets: + - assets/images/ + + fonts: + - family: Ubuntu + fonts: + - asset: assets/fonts/Ubuntu-Regular.ttf + - asset: assets/fonts/Ubuntu-Bold.ttf + weight: 700 + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/embeds/invoice/test/widget_test.dart b/embeds/invoice/test/widget_test.dart new file mode 100644 index 00000000..d47cda8e --- /dev/null +++ b/embeds/invoice/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:invoice/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/embeds/invoice/web/favicon.png b/embeds/invoice/web/favicon.png new file mode 100644 index 00000000..8aaa46ac Binary files /dev/null and b/embeds/invoice/web/favicon.png differ diff --git a/embeds/invoice/web/icons/Icon-192.png b/embeds/invoice/web/icons/Icon-192.png new file mode 100644 index 00000000..b749bfef Binary files /dev/null and b/embeds/invoice/web/icons/Icon-192.png differ diff --git a/embeds/invoice/web/icons/Icon-512.png b/embeds/invoice/web/icons/Icon-512.png new file mode 100644 index 00000000..88cfd48d Binary files /dev/null and b/embeds/invoice/web/icons/Icon-512.png differ diff --git a/embeds/invoice/web/index.html b/embeds/invoice/web/index.html new file mode 100644 index 00000000..6a90e5c0 --- /dev/null +++ b/embeds/invoice/web/index.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + invoice + + + + + + + + diff --git a/embeds/invoice/web/manifest.json b/embeds/invoice/web/manifest.json new file mode 100644 index 00000000..a938cfda --- /dev/null +++ b/embeds/invoice/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "invoice", + "short_name": "invoice", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/lib/app_controller.dart b/lib/app_controller.dart index f6c29d7a..26468da8 100644 --- a/lib/app_controller.dart +++ b/lib/app_controller.dart @@ -55,6 +55,22 @@ class AppController extends StatefulWidget { else return await Storage.write('enableDarkMode', 'false'); } + static ThemeData get lightTheme => ThemeData( + primaryColorDark: Color(0xFF707070), + primaryColorLight: Color(0xFF404040), + brightness: Brightness.light, + accentColor: AppController.blue, + fontFamily: 'Ubuntu', + ); + + static ThemeData get darkTheme => ThemeData( + primaryColorDark: Color(0xffCCCCCC), + primaryColorLight: Color(0xFFFFFFFF), + accentColor: Color(0xff2196f3), + brightness: Brightness.dark, + fontFamily: 'Ubuntu', + ); + static double topPadding() { return MediaQuery.of(getCurrentContext()).padding.top; } diff --git a/lib/main.dart b/lib/main.dart index 7cf94e99..c97c3c14 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -24,27 +24,13 @@ class Anypay extends StatelessWidget { Widget build(BuildContext context) { return AppController(builder: (context) { var theme; - var lightTheme = ThemeData( - primaryColorDark: Color(0xFF707070), - primaryColorLight: Color(0xFF404040), - brightness: Brightness.light, - accentColor: AppController.blue, - fontFamily: 'Ubuntu', - ); - var darkTheme = ThemeData( - primaryColorDark: Color(0xffCCCCCC), - primaryColorLight: Color(0xFFFFFFFF), - accentColor: Color(0xff2196f3), - brightness: Brightness.dark, - fontFamily: 'Ubuntu', - ); SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark); - theme = lightTheme; + theme = AppController.lightTheme; if (AppController.enableDarkMode) { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light); - theme = darkTheme; + theme = AppController.darkTheme; } return MaterialApp( diff --git a/pubspec.lock b/pubspec.lock index 4e180ca5..5d40d8ba 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.2" + version: "2.5.0-nullsafety.3" barcode_scan: dependency: "direct main" description: @@ -72,7 +72,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.2" + version: "2.1.0-nullsafety.3" build: dependency: transitive description: @@ -149,14 +149,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.4" + version: "1.1.0-nullsafety.5" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0-nullsafety.3" checked_yaml: dependency: transitive description: @@ -177,7 +177,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.2" + version: "1.1.0-nullsafety.3" code_builder: dependency: transitive description: @@ -191,7 +191,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.4" + version: "1.15.0-nullsafety.5" confetti: dependency: "direct main" description: @@ -261,7 +261,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0-nullsafety.3" firebase_messaging: dependency: "direct main" description: @@ -402,7 +402,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.2" + version: "0.6.3-nullsafety.3" json_annotation: dependency: transitive description: @@ -430,14 +430,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.2" + version: "0.12.10-nullsafety.3" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.5" + version: "1.3.0-nullsafety.6" mime: dependency: transitive description: @@ -448,9 +448,11 @@ packages: moneybutton_flutter_web: dependency: "direct main" description: - path: "/Users/neil/Projects/anypay/moneybutton_flutter_web" - relative: false - source: path + path: "." + ref: e4f37467181a52593af5720ab9830e1ab58c411b + resolved-ref: e4f37467181a52593af5720ab9830e1ab58c411b + url: "https://github.com/BananaNeil/moneybutton_flutter_web.git" + source: git version: "0.1.2" node_interop: dependency: transitive @@ -479,7 +481,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.0-nullsafety.3" pedantic: dependency: transitive description: @@ -638,21 +640,21 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.3" + version: "1.8.0-nullsafety.4" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.5" + version: "1.10.0-nullsafety.6" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.2" + version: "2.1.0-nullsafety.3" stream_transform: dependency: transitive description: @@ -666,21 +668,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.2" + version: "1.1.0-nullsafety.3" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.2" + version: "1.2.0-nullsafety.3" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.4" + version: "0.2.19-nullsafety.6" timeago: dependency: "direct main" description: @@ -701,7 +703,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.5" url_launcher: dependency: "direct main" description: @@ -743,7 +745,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.4" + version: "2.1.0-nullsafety.5" watcher: dependency: transitive description: @@ -780,5 +782,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.11.0-0.0 <2.12.0" + dart: ">=2.12.0-0.0 <3.0.0" flutter: ">=1.20.0 <2.0.0"