A Flutter library for work with Apple Wallet passes.

Overview

Apple Wallet logo

Flutter GitHub Actions Pub Package

pass-flutter

A Flutter library for work with Apple Wallet passes.

How use it

Getting pass from URL to internal memory

import 'package:pass_flutter/pass_flutter.dart';

PassFile passFile = await Pass().saveFromUrl(url: 'https://link_to_pass/pass.pkpass');

Getting list of all saved passes

import 'package:pass_flutter/pass_flutter.dart';

List<PassFile> passes = await Pass().getAllSaved();

Fetch preview from url and save it

import 'package:pass_flutter/pass_flutter.dart';

PassFile passFile = await Pass().fetchPreviewFromUrl(url: 'https://link_to_pass/pass.pkpass');
passFile.save();

or delete it

import 'package:pass_flutter/pass_flutter.dart';

PassFile passFile = await Pass().fetchPreviewFromUrl(url: 'https://link_to_pass/pass.pkpass');
passFile.delete();

Delete pass file from internal memory

import 'package:pass_flutter/pass_flutter.dart';

Pass pass = Pass();
PassFile passFile = await pass.saveFromUrl(url: 'https://link_to_pass/pass.pkpass');
await pass.delete(passFile);

OR

passFile.delete();

Contribute

Please feel free to fork, improve, make pull requests or fill issues. I'll be glad to fix bugs you encountered or improve the extension.

Changelog

Refer to the Changelog to get all release notes.

Comments
  •       this.delete(passDirectory, passFile);

    this.delete(passDirectory, passFile);

    I'm getting this error after ZipDecoder().decodeBytes(passArchive). I tried with several pkpasses of different companies and get the same error every time.

    I'm testing it on Android, should the plugin work on Android too?

    help wanted 
    opened by nicowernli 9
  • Color problems

    Color problems

    Hello. I am using this package, and I managed to get pass from URL. Everything looks fine except the colors. The passFile.pass.backgroundColor, the foregroundColor and the labelColor are all white(rgb(255, 255, 255)) but they should be colored. Can anyone help me please?

    bug 
    opened by eltiganiomar 6
  • pass.json escape \n \t \r

    pass.json escape \n \t \r

    image

    in some pass i am using comes with \n \t \r chars inside json. It needs some replace method to taka the actual json.

    I have been researching and trying to solve the issue for couple days but I haven't solved it yet. @alexeynobody can you help me with this ?

    bug 
    opened by srcnysf 5
  • Crashing on iOS after fetching preview or saving

    Crashing on iOS after fetching preview or saving

    Could not cast value of type '__NSArrayM' (0x1f397f190) to 'FlutterStandardTypedData' (0x1f397f178). 2022-02-09 00:44:14.720718+0500 Runner Dev[2961:154000] Could not cast value of type '__NSArrayM' (0x1f397f190) to 'FlutterStandardTypedData' (0x1f397f178).

    • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00000001cd1ee7b0 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill: -> 0x1cd1ee7b0 <+8>: b.lo 0x1cd1ee7cc ; <+36> 0x1cd1ee7b4 <+12>: stp x29, x30, [sp, #-0x10]! 0x1cd1ee7b8 <+16>: mov x29, sp 0x1cd1ee7bc <+20>: bl 0x1cd1cb1fc ; cerror_nocancel
    opened by abdulahad1991 4
  • Does not appear in Apple Wallet

    Does not appear in Apple Wallet

    Hello In Xcode im added certificate to wallet. When im take url to .pkpass, I use Pass().saveFromUrl, and yes, pass saved to internal memory, but im thinking that's it must be added to Apple Wallet. Or I must do something more ?

    Thanks

    opened by faider29 4
  • Error compiling in AndroidStudio for iOS

    Error compiling in AndroidStudio for iOS

    The last version is failing with the error "The plugin pass_flutter doesn't have a main class defined in /Users/fede/.pub-cache/hosted/pub.dartlang.org/pass_flutter-1.2.1/android/src/main/java/com/alexeynobody/pass_flutter/PassFlutterPlugin.java or /Users/fede/.pub-cache/hosted/pub.dartlang.org/pass_flutter-1.2.1/android/src/main/kotlin/com/alexeynobody/pass_flutter/PassFlutterPlugin.kt. This is likely to due to an incorrect androidPackage: com.alexeynobody.pass_flutter or mainClass entry in the plugin's pubspec.yaml. If you are the author of this plugin, fix the androidPackage entry or move the main class to any of locations used above. Otherwise, please contact the author of this plugin and consider using a different plugin in the meanwhile."

    Please, tell me if you need more information about this error.

    Thank you.

    bug 
    opened by GrupoDO 2
  • Android support

    Android support

    Hello, I see that this package supports Android as well, but I didn't see how. On what App does it add the passkit entries? Does it work with google wallet?

    Thanks!

    documentation 
    opened by netgfx 2
  • _convertToColor null exception

    _convertToColor null exception

    in Some case when I generate Event pass from https://www.passsource.com/ the labelColor comes null so

    _convertToColor method throw excetion

    It can be solved by adding

     static Color _convertToColor(String rgbCssColor) {
        if (rgbCssColor == null) {
          return Color.fromRGBO(255, 255, 255, 1);
        }
    ...
    }
    
    bug 
    opened by srcnysf 2
  • Unable to run application after adding flutter_pass dependency

    Unable to run application after adding flutter_pass dependency

    Hi, Thank you for doing hardwork and provide this library. Unfortunately I am not yet succeeded to run the application with this dependency. Here below is the log:

    Launching lib/main.dart on iPhone 11 Pro in debug mode... Running pod install... 0.7s CocoaPods' output: ↳ Preparing

    Analyzing dependencies
    
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    
    Finding Podfile changes
      A pass_flutter
      A path_provider
      A path_provider_macos
      - Flutter
    
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `pass_flutter` from `.symlinks/plugins/pass_flutter/ios`
    [!] No podspec found for `pass_flutter` in `.symlinks/plugins/pass_flutter/ios`
    
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:901:in `fetch_external_source'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:880:in `block (2 levels) in fetch_external_sources'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:879:in `each'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:879:in `block in fetch_external_sources'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:878:in `fetch_external_sources'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:22:in `load'
    /usr/local/bin/pod:22:in `<main>'
    

    Error output from CocoaPods: ↳

    [!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See
    `https://guides.cocoapods.org/syntax/podfile.html#platform`.
    

    Error running pod install Error launching application on iPhone 11 Pro.

    I tried reinstall pod and update pod but seems nothing works.

    It looks like this plugin is not able to create/run pod file while fetching external sources in my app.

    Let me know if there is solution for that.

    Doctor report: flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel unknown, v1.12.13+hotfix.9, on Mac OS X 10.14.6 18G5015, locale en-GB)

    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Xcode - develop for iOS and macOS (Xcode 11.3) [✓] Android Studio (version 3.5) [✓] Connected device (2 available)

    ! Doctor found issues in 1 category.

    bug 
    opened by sohitEngg 2
  • Null safety bugfix

    Null safety bugfix

    Hello,

    Once Flutter team moves null-safety into stable channel, existing repository won't be working anymore. It can't even be downloaded so I just made a fork with couple of fixes.

    Feel free to accomodate changes.

    enhancement 
    opened by WebEferen 1
  • Null safety issue

    Null safety issue

    Hello,

    Once Flutter introduces null-safety as it's stable branch, issues popped out. I just made simple fork with fixes -> if You want You can use them in order to bump this package.

    https://github.com/WebEferen/pass-flutter

    opened by WebEferen 1
  • Text Alignment and Styling

    Text Alignment and Styling

    Add ability to see the styling and alignment in the Fields. JSON structure of pass.json looks like this:

    Date style

    "auxiliaryFields" : [
          {
            "key" : "expiryDate",
            "dateStyle" : "PKDateStyleShort",
            "label" : "Expiry Date",
            "value" : "2013-12-31T00:00-23:59"
          }
        ],
    
    Text alignment:
    
    "secondaryFields": [
                {
                    "key": "TicketTitle",
                    "label": "2 Karten für",
                    "textAlignment": "PKTextAlignmentLeft",
                    "value": "A Quiet Place 2"
                }
            ],
    

    Right now, only 4 props can be accessed. Idea:

    Add new fields to the Field object:

    const Fields({
        required this.key,
        required this.value,
        this.label,
        this.changeMessage,
        this.dateStyle,
        this.textAlignment,
      });
    
      /// Required. The key must be unique within the scope of the entire pass. For example, “departure-gate.”
      final String key;
    
      /// Optional. Label text for the field.
      final String? label;
    
      /// Required. Value of the field, for example, 42.
      final String value;
    
      /// Optional. Format string for the alert text that is displayed when the pass is updated.
      /// The format string must contain the escape %@, which is replaced with the field’s new value.
      /// For example, “Gate changed to %@.”
      /// If you don’t specify a change message, the user isn’t notified when the field changes.
      final String? changeMessage;
    
      /// Optional.
      final String textAlignment;
    
      /// Optional
      final String dateStyle;
    
      /// Convert to json
      Map<String, dynamic> toJson() => _$FieldsToJson(this);
    
      @override
      List<Object?> get props => [key, label, value, changeMessage, textAlignment, dateStyle];
    
    enhancement help wanted good first issue 
    opened by lrsvmb 0
  • Add into apple wallet

    Add into apple wallet

    As already meantioned in https://github.com/alexeynobody/pass-flutter/issues/20

    A feature where you can add directly with this package into the wallet app would be awesome.

    enhancement help wanted good first issue 
    opened by JakobStadlhuber 2
Releases(v2.0.1)
  • v2.0.1(Feb 21, 2022)

  • 1.2.1(Feb 26, 2021)

  • 1.2.0(Oct 2, 2020)

  • 1.1.3(Aug 6, 2020)

  • 1.1.2+hotfix1(Jul 16, 2020)

  • 1.1.1(Apr 15, 2020)

  • 1.1.0(Apr 14, 2020)

    • BREAKING: change method fetchPreviewFromUrl return type PreviewPassFile -> PassFile
    • BREAKING: remove PreviewPassFile
    • BREAKING: params name in methods fetchPreviewFromUrl and saveFromUrl changed urlToPass -> url
    • Now PassFile include method for saving it toNow PassFile includes a method for saving it in the internal memory
    • Refactoring and optimisation
    Source code(tar.gz)
    Source code(zip)
Shacoin-wallet - A flutter wallet app for shacoin

SHACOIN Mobile app for storing your shacoins · Report Bug · Request Feature Tabl

batuhan demircan 0 Jan 7, 2022
This is an on-chain(truffle) ETH wallet with traditional crypto wallet features

This is an on-chain(truffle) ETH wallet with traditional crypto wallet features (including live ETH price display). I enjoyed playing with emojis in this one ??

Chinyeaka Chinonso 15 Dec 7, 2022
A Widget that passes a Reactive Model to all of it's children

scoped_model A set of utilities that allow you to easily pass a data Model from a parent Widget down to its descendants. In addition, it also rebuilds

Brian Egan 779 Nov 30, 2022
A modular app architecture that can be scalable as the time passes

A modular app architecture that can be scalable as the time passes. I will be using the BLoC state-management package.

Md. Siam 62 Dec 25, 2022
Flutter widget library containing buttons for authenticating with popular social networks: Apple, Google, Facebook, Twitter and Microsoft.

Flutter Auth Buttons This library is now in maintenance mode I'm no longer actively using Flutter and don't have the time to keep this library maintai

Duncan Jones 115 Nov 3, 2022
Flutter library for Moyasar. Supports Apple Pay, STC Pay and Credit Card.

Flutter library for Moyasar. Supports Apple Pay, STC Pay and Credit Card.

null 12 Oct 22, 2022
🚗 Apple CarPlay for Flutter Apps. Aims to make it safe to use apps made with Flutter in the car by integrating with CarPlay.

CarPlay with Flutter ?? Flutter Apps now on Apple CarPlay! flutter_carplay aims to make it safe to use iPhone apps made with Flutter in the car by int

Oğuzhan Atalay 156 Dec 26, 2022
A music player component for Flutter (i.e. Spotify, Apple Music, etc.) [AGPL/example/no longer maintaining]

This is an example I currently have no plans of putting this on Pub. Originally, I did, but I lost interest. However, I think this is a good example,

Tobe Osakwe 215 Dec 12, 2022
Authentication API client with Flutter (Login, Register, Google Login, Facebook Login, Apple Login)

Flutter Auth App (Login, Register, Google Login, Facebook Login, Apple Login) To use this client, get the server up and running. Try it out now! App S

Denzel Giraldo 50 Jan 4, 2023
A lightweight flutter plugin to check if your app is up-to-date on Google Play Store or Apple App Store

App Version Checker this package is used to check if your app has a new version on playstore or apple app store. or you can even check what is the lat

Iheb Briki 6 Dec 14, 2022
Maps for Flutter developers. Supports Apple, Bing, and Google APIs.

Overview Cross-platform geographic maps for Flutter applications. Pull requests are welcome! The packages are licensed under the Apache License 2.0. P

Dint 17 Oct 13, 2022
Plist parser - A Plist parser for Flutter supports XML and binary Apple Property list (plist) formats

Plist Parser for Flutter ?? A Flutter Plugin for Plist parser supporting XML and

dirablue ( gaku ) 4 Nov 17, 2022
[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

Kauê Murakami 11 Nov 9, 2022
Wallet app built in flutter

flutter_wallet_app Smart course app is a design implementaion of Wallet App designed by Muhammad Abdull Download App Android Screenshots HomePage Tran

Sonu Sharma 291 Dec 24, 2022
A reference credential wallet built on Flutter and DIDKit.

Check out the Credible documentation here. Credible Credible is a native mobile wallet that supports W3C Verifiable Credentials and Decentralized Iden

Spruce Systems, Inc. 31 Nov 7, 2022
Wallet for Peercoin and Peercoin Testnet written in Flutter

peercoin_flutter Wallet for Peercoin and Peercoin Testnet using Electrumx as backend. App in constant development Basic testing successfull on iOS 14.

Peercoin project 21 Oct 25, 2022
Flutter Wallet APP UI Challenge

flutter_wallet_ui_challenge A new Flutter project. Project Demo Video : https://www.youtube.com/watch?v=Vyj65qh_QiA Getting Started Flutter Wallet UI

Yasin ilhan 489 Dec 18, 2022
A Flutter project created for test purposes based on the wallet settings screen of the polkadex mobile app.

polkadex_mobile_test A Flutter project created for test purposes based on the wallet settings screen of the polkadex mobile app. Getting Started This

null 0 Jan 10, 2022
Wallet Application Built With Flutter

Wallet Application Flutter Wallet Page Contact Page Send Money Page Contact Page

Isaac Pitwa Nyonyintono 12 Nov 9, 2022