Skip to content

Commit

Permalink
Merge branch 'master' into create-a-pkpass
Browse files Browse the repository at this point in the history
  • Loading branch information
ueman committed Aug 4, 2024
2 parents 5562a60 + 60341f4 commit 4efb60d
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 33 deletions.
1 change: 1 addition & 0 deletions app/lib/example/example_passes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class _ExamplePassesState extends State<ExamplePasses> {
final pass = PkPass.fromBytes(
data.buffer.asUint8List(),
skipChecksumVerification: true,
skipSignatureVerification: true,
);
passes.add(pass);
} catch (exception, stackTrace) {
Expand Down
6 changes: 5 additions & 1 deletion app/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ class _HomePageState extends State<HomePage> {
Future<void> loadPasses() async {
final dbPasses = await database.pass.select(distinct: true).get();
final mappedPasses = dbPasses.map((p) {
return PkPass.fromBytes(p.binaryPass);
return PkPass.fromBytes(
p.binaryPass,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
}).toList();
setState(() {
passes = mappedPasses;
Expand Down
12 changes: 10 additions & 2 deletions app/lib/import_pass/import_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@ class PkPassImportSource {
Future<PkPass> getPass() async {
if (path != null) {
final Content content = await ContentResolver.resolveContent(path!);
return PkPass.fromBytes(content.data);
return PkPass.fromBytes(
content.data,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
} else if (bytes != null) {
return PkPass.fromBytes(bytes!);
return PkPass.fromBytes(
bytes!,
skipChecksumVerification: true,
skipSignatureVerification: true,
);
}
throw Exception('No data');
}
Expand Down
6 changes: 5 additions & 1 deletion passkit/example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import 'package:passkit/passkit.dart';

void main() async {
final passKitBytes = await File('pass.pkpass').readAsBytes();
final pkPass = PkPass.fromBytes(passKitBytes);
final pkPass = PkPass.fromBytes(
passKitBytes,
skipChecksumVerification: true,
skipSignatureVerification: true,
);

print(pkPass.pass.description);

Expand Down
1 change: 1 addition & 0 deletions passkit_ui/lib/src/boarding_pass.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:passkit/passkit.dart';
import 'package:passkit_ui/passkit_ui.dart';
import 'package:passkit_ui/src/theme/boarding_pass_theme.dart';
import 'package:passkit_ui/src/widgets/header_row.dart';
import 'package:passkit_ui/src/widgets/transit_types/transit_type_widget.dart';

/// A boarding pass looks like the following:
///
Expand Down
21 changes: 0 additions & 21 deletions passkit_ui/lib/src/widgets/transit_types/generic_transit_type.dart

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:passkit/passkit.dart';
import 'package:passkit_ui/src/widgets/transit_types/bus_icon.dart';
import 'package:passkit_ui/src/widgets/transit_types/generic_transit_type.dart';
import 'package:passkit_ui/src/widgets/transit_types/plane_icon.dart';

class TransitTypeWidget extends StatelessWidget {
Expand All @@ -22,11 +22,13 @@ class TransitTypeWidget extends StatelessWidget {
Widget build(BuildContext context) {
return switch (transitType) {
TransitType.air => PlaneIcon(color: color, width: width),
TransitType.boat => GenericTransitType(color: color, size: width),
TransitType.boat =>
Icon(Icons.directions_boat, size: width, color: color),
TransitType.bus => BusIcon(color: color, width: width),
TransitType.train =>
Icon(CupertinoIcons.train_style_one, size: width, color: color),
TransitType.generic => GenericTransitType(color: color, size: width),
TransitType.generic =>
Icon(Icons.arrow_right_alt_rounded, size: width + 10, color: color),
};
}
}
4 changes: 0 additions & 4 deletions passkit_ui/lib/src/widgets/transit_types/transit_types.dart

This file was deleted.

1 change: 0 additions & 1 deletion passkit_ui/lib/src/widgets/widgets.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export 'transit_types/transit_types.dart';
export 'footer.dart';
export 'logo.dart';
export 'passkit_barcode.dart';

0 comments on commit 4efb60d

Please sign in to comment.