diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/app_icon.png b/android/app/src/main/res/mipmap-mdpi/app_icon.png new file mode 100755 index 0000000..2094aa9 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/app_icon.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/app_icon.png b/android/app/src/main/res/mipmap-xhdpi/app_icon.png new file mode 100755 index 0000000..85bc027 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/app_icon.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/app_icon.png b/android/app/src/main/res/mipmap-xxhdpi/app_icon.png new file mode 100755 index 0000000..0edb65e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/app_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/app_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/app_icon.png new file mode 100755 index 0000000..25e6959 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/app_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/assets/images/blank-card.jpg b/assets/images/blank-card.jpg new file mode 100644 index 0000000..ffacf99 Binary files /dev/null and b/assets/images/blank-card.jpg differ diff --git a/assets/sol-tenerife.jpeg b/assets/sol-tenerife.jpeg new file mode 100644 index 0000000..42fad20 Binary files /dev/null and b/assets/sol-tenerife.jpeg differ diff --git a/flutter b/flutter new file mode 160000 index 0000000..7a4c334 --- /dev/null +++ b/flutter @@ -0,0 +1 @@ +Subproject commit 7a4c33425ddd78c54aba07d86f3f9a4a0051769b diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..e8efba1 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..399e934 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..69c20c4 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,69 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '11.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + pods_ary = [] + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) { |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + pods_ary.push({:name => podname, :path => podpath}); + else + puts "Invalid plugin specification: #{line}" + end + } + return pods_ary +end + +target 'Runner' do + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + + # Flutter Pods + generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') + if generated_xcode_build_settings.empty? + puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." + end + generated_xcode_build_settings.map { |p| + if p[:name] == 'FLUTTER_FRAMEWORK_DIR' + symlink = File.join('.symlinks', 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) + end + } + + # Plugin Pods + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.map { |p| + symlink = File.join('.symlinks', 'plugins', p[:name]) + File.symlink(p[:path], symlink) + pod p[:name], :path => File.join(symlink, 'ios') + } +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end + end +end diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 0000000..ffdb37d --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,33 @@ +PODS: + - Flutter (1.0.0) + - square_in_app_payments (1.3.0): + - Flutter + - SquareBuyerVerificationSDK (= 1.3.0) + - SquareInAppPaymentsSDK (= 1.3.0) + - SquareBuyerVerificationSDK (1.3.0) + - SquareInAppPaymentsSDK (1.3.0) + +DEPENDENCIES: + - Flutter (from `.symlinks/flutter/ios`) + - square_in_app_payments (from `.symlinks/plugins/square_in_app_payments/ios`) + +SPEC REPOS: + trunk: + - SquareBuyerVerificationSDK + - SquareInAppPaymentsSDK + +EXTERNAL SOURCES: + Flutter: + :path: ".symlinks/flutter/ios" + square_in_app_payments: + :path: ".symlinks/plugins/square_in_app_payments/ios" + +SPEC CHECKSUMS: + Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a + square_in_app_payments: 7dbbc686b925573005257c7a3a22642269b2c04d + SquareBuyerVerificationSDK: 6a73cc3b073d8e613cb1fe8643600ff9ac4d6373 + SquareInAppPaymentsSDK: 0cc9fd96e99710a3158362dabb2577416cf8e379 + +PODFILE CHECKSUM: 2d26eaf60b8003833f95ee5b2d79d7d814c85ea2 + +COCOAPODS: 1.8.4 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 249ab3e..658758c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 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 */; }; + AC440D7B92F3AE57944AE639 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 049898927ACFFF776A1DD65E /* libPods-Runner.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -37,13 +38,17 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 049898927ACFFF776A1DD65E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = ""; }; + 186A5E777489077ABC963430 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 7B86E43B9E2443CB93C35407 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 7F262AF8AC521742B25C2B38 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 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 = ""; }; 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; @@ -62,6 +67,7 @@ files = ( 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + AC440D7B92F3AE57944AE639 /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -87,7 +93,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + B1A79012D83E0B1D13EE9344 /* Pods */, + BB55E8DDF2BEE7C6344DA2B0 /* Frameworks */, ); sourceTree = ""; }; @@ -123,6 +130,25 @@ name = "Supporting Files"; sourceTree = ""; }; + B1A79012D83E0B1D13EE9344 /* Pods */ = { + isa = PBXGroup; + children = ( + 7F262AF8AC521742B25C2B38 /* Pods-Runner.debug.xcconfig */, + 7B86E43B9E2443CB93C35407 /* Pods-Runner.release.xcconfig */, + 186A5E777489077ABC963430 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + BB55E8DDF2BEE7C6344DA2B0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 049898927ACFFF776A1DD65E /* libPods-Runner.a */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -130,12 +156,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + AE60FDCB625A96612CAA501F /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 7D35F3B3C87778530CA6F7AF /* [CP] Embed Pods Frameworks */, + 8F8D0990AF730E572D787100 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -208,6 +237,46 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; }; + 7D35F3B3C87778530CA6F7AF /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", + "${PODS_ROOT}/SquareBuyerVerificationSDK/SquareInAppPaymentsSDKs.framework/SquareBuyerVerificationSDK.framework", + "${PODS_ROOT}/SquareInAppPaymentsSDK/SquareInAppPaymentsSDKs.framework/SquareInAppPaymentsSDK.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SquareBuyerVerificationSDK.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SquareInAppPaymentsSDK.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8F8D0990AF730E572D787100 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", + "${PODS_CONFIGURATION_BUILD_DIR}/square_in_app_payments/sqip_flutter_resource.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/sqip_flutter_resource.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -222,6 +291,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + AE60FDCB625A96612CAA501F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100755 index 0000000..472bd2d Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100755 index 0000000..c8d0db4 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100755 index 0000000..97861c7 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100755 index 0000000..1de6d41 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100755 index 0000000..361c26a Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100755 index 0000000..6c28564 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100755 index 0000000..e3032ad Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100755 index 0000000..7b60652 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100755 index 0000000..c7ac4a1 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100755 index 0000000..bd7583b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100755 index 0000000..6a10a4c Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json old mode 100644 new mode 100755 index d36b1fa..73d3b7f --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1 @@ -{ - "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" - } -} +{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "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/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# 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/lib/holiday_landing_page.dart b/lib/holiday_landing_page.dart new file mode 100644 index 0000000..547cd0d --- /dev/null +++ b/lib/holiday_landing_page.dart @@ -0,0 +1,85 @@ +import 'package:flutter/material.dart'; +import './passengers.dart'; + +class HolidayLandingPage extends StatelessWidget { + HolidayLandingPage(this.data); + dynamic data; + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(data["hotel"]), + ), + body: + Center( + child: Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0))), + child: InkWell( + child: Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0), + ), + child: Image.network( + data["thumbnail_url"], + fit:BoxFit.fill + + ), + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.only(left: 12.0, bottom: 12.0, top:12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + ("£" + data["price"].toString()), + style: TextStyle( + color: Colors.grey, + ), + ), + ], + ), + ) + ] + + ), + + ListTile( + title: Text("Overview"), + subtitle: Text( + "Situated in the heart of Costa Teguise town centre on the island of" + "Lanzarote, Oasis Lanz Beach is an attractive apartment complex twined" + "together with towering palm trees and boasting a variety of facilities." + "Framed by expansive green gardens and within walking distance of the beach," + "shops and leisure area, this resort has something for everyone." + "## Please note that building works are currently taking place in this hotel" + "in the reception and part of the main restaurant which is closed off. ##"), + ), + ButtonTheme( + minWidth: 600.0, + height: 50.0, + child: RaisedButton( + child: Text("BOOK NOW"), + color: Colors.yellow, + textColor: Color(0xff17317f), + onPressed: () { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => new Passengers(data), + + ), + ); + } + ) + ) + ], + ), + ), + ), + ) + ); + } +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 770f51f..d2e84cc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,6 +16,8 @@ class MainPage extends StatefulWidget { } +int tabNumber = 0; + class MainPageState extends State{ int _selectedPage = 0; final _appBarTitle = [ @@ -35,20 +37,26 @@ class MainPageState extends State{ @override Widget build(BuildContext context) { + var appBarCondition = GradientAppBar( + title: Text(_appBarTitle[_selectedPage], style: TextStyle(color: Color(0xff17317f))), + backgroundColorStart: gradientStart, + backgroundColorEnd: gradientEnd, + ); + return MaterialApp( title: 'On The Beach', debugShowCheckedModeBanner: false, home: Scaffold( - appBar: GradientAppBar( - title: Text(_appBarTitle[_selectedPage], style: TextStyle(color: Color(0xff17317f))), - backgroundColorStart: gradientStart, - backgroundColorEnd: gradientEnd, - ), + + appBar: (_selectedPage > 0) ? appBarCondition : null, + bottomNavigationBar: BottomNavigationBar( currentIndex: _selectedPage, // this will be set when a new tab is tapped onTap: (int index) { setState(() { _selectedPage = index; + tabNumber = index; + cnt = ''; }); }, items: [ @@ -70,4 +78,5 @@ class MainPageState extends State{ ), ); } -} \ No newline at end of file +} + diff --git a/lib/otb.dart b/lib/otb.dart index c8467eb..084eea6 100644 --- a/lib/otb.dart +++ b/lib/otb.dart @@ -1,14 +1,23 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; +import './holiday_landing_page.dart'; import 'dart:async'; import 'dart:convert'; +import 'package:gradient_app_bar/gradient_app_bar.dart'; + +import 'package:stopwatch/holiday_landing_page.dart'; void main() => runApp(new Otb()); +String cnt; +Color gradientStart = const Color(0xff00b5ea); //Change start gradient color here +Color gradientEnd = const Color(0xffffffff); + class Otb extends StatelessWidget { - Color gradientStart = const Color(0xff00b5ea); //Change start gradient color here - Color gradientEnd = const Color(0xffffffff); + @override Widget build(BuildContext context) { final appTitle = 'Form Validation Demo'; @@ -17,6 +26,11 @@ class Otb extends StatelessWidget { title: appTitle, debugShowCheckedModeBanner: false, home: Scaffold( + appBar: GradientAppBar( + title: Text("Let's get you to the beach", style: TextStyle(color: Color(0xff17317f))), + backgroundColorStart: gradientStart, + backgroundColorEnd: gradientEnd, + ), body: new Container( decoration: BoxDecoration( gradient: LinearGradient( @@ -49,23 +63,26 @@ class MyCustomForm extends StatefulWidget { class MyCustomFormState extends State { final _formKey = GlobalKey(); - - String url = 'http://localhost:3001/api/v1/search/holidays?country=UK'; + dynamic data; + dynamic response; + String url = 'http://localhost:3001/api/v1/search/holidays?country='; // I have used my own private app's API endpoint here - Future getData() async { - var response = await http.get( - Uri.encodeFull(url), + Future getData(dynamic country) async{ + final dest = url+country; + print("Inside function url: " + dest); + response = await http.get( + Uri.encodeFull(dest), headers: { 'Accept': 'application/json' } ); - try { - List data = json.decode(response.body); - print(data); - } catch(_) { - print('WTF'); - } + setState(() { + Iterable result = json.decode(response.body); + data = result.toList(); + }); + print("Inside function country: " + country); + print("Inside function data: " + data.toString()); } @override Widget build(BuildContext context) { @@ -80,34 +97,85 @@ class MyCustomFormState extends State { height: 150, width: 200, ), - TextFormField( - decoration: InputDecoration( - filled: true, - fillColor: Colors.white, - labelText: 'Where To' - ), - validator: (value) { - if (value.isEmpty) { - return 'Please enter your destination.'; - } - return null; - }, - ), + DropdownExample(), Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: RaisedButton( onPressed: () { - if (_formKey.currentState.validate()) { - // If the form is valid, display a Snackbar. - Scaffold.of(context) - .showSnackBar(SnackBar(content: Text('Searching Holidays..'))); - getData(); + setState(() {}); + if (cnt != null) { + print("Country: " + cnt); + getData(cnt); + data == null ? 0 : data; + print("data: " + data.toString()); + if (data.length != 0 ) { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) { + return Scaffold( + // appBar: PreferredSize( + // preferredSize: Size.fromHeight(10.0), + // child: FlexibleSpaceBar( + // centerTitle: true, + // title: Text(data.length.toString() + " hotels found", + // style: TextStyle( + // color: Colors.black, + // ),), + // ), + // ), + appBar: GradientAppBar( + title: Text(data.length.toString() + " hotels found", style: TextStyle(color: Color(0xff17317f))), + backgroundColorStart: gradientStart, + backgroundColorEnd: gradientEnd, + ), + body: ListView.builder( + itemCount: data == null? 0 : data.length, + itemBuilder: (BuildContext context, i){ + return Center( + child: Card( + shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8.0))), + child: InkWell( + onTap: () => Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => new HolidayLandingPage(data[i]), ),), + child: Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0), + topRight: Radius.circular(8.0), + ), + child: Image.network( + data[i]["thumbnail_url"], + fit:BoxFit.fill - - } + ), + ), + ListTile( + title: Text(data[i]["hotel"]), + subtitle: Text(data[i]["country"]), + trailing: Text("£" + (data[i]["price"]).toString()), + ), + ], + ), + ), + ), + ); + } + ), + ); + }, + )); + } + else if(cnt != null && data.length == 0) { + Scaffold.of(context) + .showSnackBar(SnackBar(duration: Duration(seconds: 1), content: Text("No Holidays Found"))); + } + else { + Scaffold.of(context) + .showSnackBar(SnackBar(duration: Duration(seconds: 1), content: Text("Validation error"))); + } + }; }, textColor: Color(0xff17317f), - color: Colors.yellow, padding: const EdgeInsets.all(8.0), child: Text( @@ -120,3 +188,61 @@ class MyCustomFormState extends State { ); } } + +class DropdownExample extends StatefulWidget { + @override + _DropdownExampleState createState() { + return _DropdownExampleState(); + } + } + + class _DropdownExampleState extends State { + String _value; + + @override + Widget build(BuildContext context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + color: Colors.white, + child: DropdownButton( + items: [ + DropdownMenuItem( + child: Text('Malta'), + value: 'Malta', + ), + DropdownMenuItem( + child: Text('Spain'), + value: 'Spain', + ), + DropdownMenuItem( + child: Text('France'), + value: 'France', + ), + DropdownMenuItem( + child: Text('Dubai'), + value: 'Dubai', + ), + ], + onChanged: (String value) { + setState(() { + _value = value; + cnt = value; + }); + }, + hint: Text('Where To'), + value: _value, + iconEnabledColor: Colors.yellow, + isExpanded: true, + isDense: true, + ), + ) + ], + + )); + } + } + diff --git a/lib/passengers.dart b/lib/passengers.dart new file mode 100644 index 0000000..f78ed63 --- /dev/null +++ b/lib/passengers.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import './pay_with_card.dart'; +import 'package:gradient_app_bar/gradient_app_bar.dart'; + +Color gradientStart = const Color(0xff00b5ea); //Change start gradient color here +Color gradientEnd = const Color(0xffffffff); + +class Passengers extends StatelessWidget { + Passengers(this.data); + dynamic data; + TabController controller; + + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: DefaultTabController( + length: 3, + child: Scaffold( + appBar: GradientAppBar( + bottom: TabBar( + tabs: [ + Tab(icon: Icon(Icons.credit_card)), + Tab(icon: Icon(Icons.directions_transit)), + Tab(icon: Icon(Icons.attach_money)), + ], + ), + title: Text('Payment Method', style: TextStyle(color: Color(0xff17317f))), + backgroundColorStart: gradientStart, + backgroundColorEnd: gradientEnd, + ), + body: TabBarView( + children: [ + PayWithCard(data), + Icon(Icons.directions_transit), + Icon(Icons.directions_bike), + ], + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/pay_with_card.dart b/lib/pay_with_card.dart new file mode 100644 index 0000000..a4c0304 --- /dev/null +++ b/lib/pay_with_card.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:square_in_app_payments/in_app_payments.dart'; +import 'package:square_in_app_payments/models.dart'; +// import 'package:paystack_sdk/paystack_sdk.dart'; + +class PayWithCard extends StatelessWidget { + PayWithCard(this.data); + dynamic data; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('Pay with your card', + style: TextStyle( + color: Colors.grey[800], + fontWeight: FontWeight.bold, + fontSize: 40)), + + new Row( + children: [ + new Image.asset('assets/images/blank-card.jpg', + height: 200, + width: 400, + ) + ], + ), + + ButtonTheme( + minWidth: 345.0, + child: RaisedButton( + child: Text('PAY NOW'), + textColor: Color(0xff17317f), + color: Colors.yellow, + onPressed: () { + _pay(); + }, + ), + ) + ], + ), + ) + ); + } +} + +void _pay() { + InAppPayments.setSquareApplicationId('sandbox-sq0idb-wfPyi4q17IXkBli8tHzYsQ'); + InAppPayments.startCardEntryFlow( + onCardNonceRequestSuccess: _cardNonceRequestSuccess, + onCardEntryCancel: _cardEntryCancel, + ); +} + +void _cardEntryCancel() { +// cancelled +} + +void _cardNonceRequestSuccess(CardDetails result) { + print(result.nonce); + + InAppPayments.completeCardEntry( + onCardEntryComplete: _cardEntryComplete, + ); +} + +void _cardEntryComplete() { + // success + print('success...........................'); +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index c549693..d352eed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,27 @@ # Generated by pub # See https://www.dartlang.org/tools/pub/glossary#lockfile packages: + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.36.4" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" async: dependency: transitive description: @@ -15,6 +36,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.2" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "6.8.2" + built_value_generator: + dependency: transitive + description: + name: built_value_generator + url: "https://pub.dartlang.org" + source: hosted + version: "6.8.2" charcode: dependency: transitive description: @@ -22,6 +78,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.2" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" collection: dependency: transitive description: @@ -29,6 +92,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" + 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.4" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" cupertino_icons: dependency: "direct main" description: @@ -36,6 +120,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.2" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.7" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -46,6 +144,20 @@ packages: description: flutter source: sdk version: "0.0.0" + front_end: + dependency: transitive + description: + name: front_end + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.19" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" gradient_app_bar: dependency: "direct main" description: @@ -53,6 +165,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.1" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+2" http: dependency: "direct main" description: @@ -67,6 +186,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1+1" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + kernel: + dependency: transitive + description: + name: kernel + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.19" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "0.11.3+2" matcher: dependency: transitive description: @@ -81,6 +228,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.6" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1+2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" path: dependency: transitive description: @@ -95,6 +263,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.5.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.2" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" quiver: dependency: transitive description: @@ -107,6 +289,13 @@ packages: description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.4+4" source_span: dependency: transitive description: @@ -114,6 +303,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.5.5" + square_in_app_payments: + dependency: "direct dev" + description: + name: square_in_app_payments + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" stack_trace: dependency: transitive description: @@ -163,5 +359,19 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+13" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" sdks: - dart: ">=2.2.0 <3.0.0" + dart: ">=2.2.2 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0c9baea..09c9892 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,6 +29,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + square_in_app_payments: ^1.3.0 # For information on the generic Dart part of this file, see the @@ -36,6 +37,8 @@ dev_dependencies: # The following section is specific to Flutter. flutter: + assets: + - assets/images/blank-card.jpg # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in