Skip to content

Commit

Permalink
Merge pull request #415 from project-violet/pencil
Browse files Browse the repository at this point in the history
Supports apple pencil double tap
  • Loading branch information
violet-dev authored May 15, 2024
2 parents 35db031 + 78a8e18 commit cc40921
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
platform :ios, '12.1'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
7 changes: 7 additions & 0 deletions lib/pages/viewer/viewer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import 'dart:async';
import 'dart:io';

import 'package:apple_pencil_double_tap/apple_pencil_double_tap.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
Expand Down Expand Up @@ -162,6 +163,12 @@ class _ViewerPageState extends State<ViewerPage> {
},
);

ApplePencilDoubleTap().listen((PreferredDoubleTapAction preferedAction) {
if (ModalRoute.of(context)!.isCurrent) {
c.next();
}
});

WidgetsBinding.instance.addObserver(_lifecycleEventHandler);
}

Expand Down
12 changes: 10 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.8"
apple_pencil_double_tap:
dependency: "direct main"
description:
name: apple_pencil_double_tap
sha256: "17dd723f038191dfa6f284910d86ca3be1598f85a64021abc89c60579275eed8"
url: "https://pub.dev"
source: hosted
version: "0.0.2"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -1383,10 +1391,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.6"
version: "2.1.8"
pointer_interceptor:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies:
android_intent_plus: ^3.1.0
animated_widgets: ^1.1.0
animations:
apple_pencil_double_tap: ^0.0.2
async:
auto_animated: ^3.0.1
azlistview:
Expand Down

0 comments on commit cc40921

Please sign in to comment.