PkPass class
https://developer.apple.com/library/archive/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/Introduction.html https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/index.html#//apple_ref/doc/uid/TP40012195
The file structure of a .pkpass
file looks like the following:
de-de.lproj/
├─ logo.png
├─ pass.string
en.lproj/
├─ logo.png
├─ logo@2x.png
├─ pass.strings
icon.png
icon@2x.png
manifest.json
pass.json
signature
Constructors
-
PkPass({required PassData pass, required Map<
String, dynamic> manifest, required List<int> sourceData, PkImage? background, PkImage? icon, PkImage? logo, PkImage? strip, PkImage? thumbnail, Map<String, Map< ? languageData, Personalization? personalization, PkImage? personalizationLogo})String, dynamic> >
Properties
-
availableLanguages
→ Iterable<
String> -
List of available languages. Each value is a language identifier as
described in https://developer.apple.com/documentation/xcode/choosing-localization-regions-and-scripts
no setter
- background → PkImage?
-
The image displayed as the background of the front of the pass.
final
-
The image displayed on the front of the pass near the barcode.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → PkImage?
-
The pass’s icon. This is displayed in notifications and in emails that
have a pass attached, and on the lock screen.
When it is displayed, the icon gets a shine effect and rounded corners.
final
- isWebServiceAvailable → bool
-
Indicates whether a webservices is available.
no setter
-
languageData
→ Map<
String, Map< ?String, dynamic> > -
Translations for this PkPass.
Consists of a mapping of language identifier to translation key-value
pairs.
The language identifier looks as described in
https://developer.apple.com/documentation/xcode/choosing-localization-regions-and-scripts
final
- logo → PkImage?
-
The image displayed on the front of the pass in the top left.
final
-
manifest
→ Map<
String, dynamic> -
Mapping of files to their respective checksums. Typically not relevant for
users of this package.
final
- pass → PassData
-
Data of the PkPass
final
- personalization → Personalization?
-
This file specifies the personal information requested by the signup form.
It also contains a description of the program and (optionally) the
program’s terms and conditions.
final
- personalizationLogo → PkImage?
-
Use a 150 x 40 point png file.
This logo is displayed at the top of the signup form.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sourceData
→ List<
int> -
The bytes of this PkPass
final
- strip → PkImage?
-
The image displayed behind the primary fields on the front of the pass.
final
- thumbnail → PkImage?
-
An additional image displayed on the front of the pass.
For example, on a membership card, the thumbnail could be used
to a picture of the cardholder.
final
- type → PassType
-
The PassType of this PkPass.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
{SignatureBuilder? signatureBuilder}) → Uint8List? - Creates a PkPass file. If this instance was created via PkPass.fromBytes it overwrites the signature if possible.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromBytes(
List< int> bytes, {bool skipChecksumVerification = false, bool skipSignatureVerification = false}) → PkPass - Parses bytes to a PkPass instance.
-
passesFromBytes(
List< int> bytes, {bool skipChecksumVerification = false, bool skipSignatureVerification = false}) → List<PkPass> -
Parses a
.pkpasses
to a list of PkPasses. The mimetype of that file isapplication/vnd.apple.pkpasses
. A.pkpasses
file cna contain up to ten PkPasses.