├── example
├── android
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── gildaswise
│ │ │ │ │ └── holdinggestureexample
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── .gitignore
│ ├── settings.gradle
│ ├── build.gradle
│ ├── gradlew.bat
│ └── gradlew
├── ios
│ ├── Flutter
│ │ ├── .last_build_id
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ ├── flutter_export_environment.sh
│ │ ├── Flutter.podspec
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Info.plist
│ │ └── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── .gitignore
├── .gitignore
├── README.md
├── .metadata
├── .idea
│ ├── runConfigurations
│ │ └── main_dart.xml
│ ├── libraries
│ │ ├── Flutter_for_Android.xml
│ │ └── Dart_SDK.xml
│ ├── modules.xml
│ └── workspace.xml
├── pubspec.yaml
├── holding_gesture_example.iml
├── holding_gesture_example_android.iml
├── lib
│ └── main.dart
└── pubspec.lock
├── .gitignore
├── .idea
├── modules.xml
├── libraries
│ └── Dart_SDK.xml
└── workspace.xml
├── lib
├── holding_gesture.dart
├── hold_gesture_recognizer.dart
├── hold_detector.dart
├── hold_timeout_detector.dart
└── hold_timeout_gesture_recognizer.dart
├── pubspec.yaml
├── CHANGELOG.md
├── holding_gesture.iml
├── LICENSE
├── README.md
└── pubspec.lock
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | c416ffb560a3e1c2e4742fb412834b61
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 | ios/.generated/
9 | ios/Flutter/Generated.xcconfig
10 | ios/Runner/GeneratedPluginRegistrant.*
11 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gildaswise/holding_gesture/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # holding_gesture_example
2 |
3 | Demonstrates how to use the holding_gesture plugin.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/gildaswise/holdinggestureexample/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.gildaswise.holdinggestureexample
2 |
3 | import android.os.Bundle
4 |
5 | import io.flutter.embedding.android.FlutterActivity
6 |
7 | class MainActivity(): FlutterActivity() {}
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 3b309bda072a6b326e8aa4591a5836af600923ce
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/example/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/example/.idea/libraries/Flutter_for_Android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/lib/holding_gesture.dart:
--------------------------------------------------------------------------------
1 | library holding_gesture;
2 |
3 | import 'dart:async';
4 |
5 | import 'package:flutter/gestures.dart';
6 | import 'package:flutter/services.dart';
7 | import 'package:flutter/material.dart';
8 |
9 | part 'hold_detector.dart';
10 | part 'hold_timeout_detector.dart';
11 | part 'hold_gesture_recognizer.dart';
12 | part 'hold_timeout_gesture_recognizer.dart';
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: holding_gesture
2 | description: A customized GestureDetector that acts on holding a determined Widget.
3 | version: 1.2.0
4 | homepage: https://github.com/gildaswise/holding_gesture
5 |
6 | environment:
7 | sdk: '>=3.0.0 <4.0.0'
8 | flutter: '>=3.0.0'
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: holding_gesture_example
2 | description: Demonstrates how to use the holding_gesture plugin.
3 | homepage: https://github.com/gildaswise/holding_gesture
4 |
5 | version: 1.0.0+10
6 |
7 | environment:
8 | sdk: ">=3.0.0 <4.0.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 | holding_gesture:
18 | path: ../
19 |
20 | flutter:
21 | uses-material-design: true
--------------------------------------------------------------------------------
/example/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/ios/Flutter/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/Users/gildaswise/flutter"
4 | export "FLUTTER_APPLICATION_PATH=/Users/gildaswise/Projects/holding_gesture/example"
5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 | export "FLUTTER_TARGET=lib/main.dart"
7 | export "FLUTTER_BUILD_DIR=build"
8 | export "FLUTTER_BUILD_NAME=1.0.0"
9 | export "FLUTTER_BUILD_NUMBER=10"
10 | export "DART_OBFUSCATION=false"
11 | export "TRACK_WIDGET_CREATION=true"
12 | export "TREE_SHAKE_ICONS=false"
13 | export "PACKAGE_CONFIG=.dart_tool/package_config.json"
14 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.2.0
2 |
3 | * Updates Flutter and Dart requirements
4 |
5 | ## 1.1.0
6 |
7 | * Added `HoldTimeoutGestureRecognizer` and `HoldTimeoutDetector`.
8 |
9 | ## 1.0.0
10 |
11 | * Bumped to stable release.
12 |
13 | ## [1.0.0-dev] - 2021-02-23
14 |
15 | * Updated to support null-safety.
16 |
17 | ## [0.0.3] - 2019-05-14
18 |
19 | * Fixed bug that caused the callback to keep being called when holding for too long, thanks to [@IhorKlimov](https://github.com/gildaswise/holding_gesture/pulls?q=is%3Apr+author%3AIhorKlimov)
20 |
21 | ## [0.0.2] - 2018-09-13
22 |
23 | * Updated README and example to keep in line with Flutter's default app.
24 |
25 | ## [0.0.1] - 2018-09-13
26 |
27 | * First version.
28 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.2.30'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.1.2'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Flutter.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # NOTE: This podspec is NOT to be published. It is only used as a local source!
3 | #
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'Flutter'
7 | s.version = '1.0.0'
8 | s.summary = 'High-performance, high-fidelity mobile apps.'
9 | s.description = <<-DESC
10 | Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
11 | DESC
12 | s.homepage = 'https://flutter.io'
13 | s.license = { :type => 'MIT' }
14 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
15 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
16 | s.ios.deployment_target = '8.0'
17 | s.vendored_frameworks = 'Flutter.framework'
18 | end
19 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/holding_gesture_example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/holding_gesture.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Gildásio Filho
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example/holding_gesture_example_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | holding_gesture_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
18 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # holding_gesture
2 |
3 | A customized GestureDetector that acts on holding a determined Widget.
4 |
5 | ## Getting Started
6 |
7 | ```dart
8 | import 'package:holding_gesture/holding_gesture.dart';
9 | ```
10 |
11 | ### HoldDetector
12 |
13 | After importing, all you have to do is use `HoldDetector` the same way you already used `GestureDetector`! As it is on the documentation, its `onTap` override won't work when using a child that has `onPressed` or a similar callback, so you should pass the single tap behaviour to that.
14 |
15 |
16 | ```dart
17 | HoldDetector(
18 | onHold: _incrementCounter,
19 | holdTimeout: Duration(milliseconds: 200),
20 | enableHapticFeedback: true,
21 | child: ElevatedButton(
22 | onPressed: _incrementCounter,
23 | child: Text("onHold"),
24 | ),
25 | ),
26 | ```
27 |
28 | ### HoldTimeoutDetector
29 |
30 | `HoldTimeoutDetector` works differently, you can use it to hold conditions or display something while the user is holding it for a predetermined time, and then execute an action after this duration passes, or canceling it if the hold action ceases. In the example, I'm using it to show a feedback on the button, and on the screen that something is loading, and then executing the increment once the timeout happens.
31 |
32 | ```dart
33 | HoldTimeoutDetector(
34 | onTimeout: () {
35 | _incrementCounter();
36 | _updateLoading(false);
37 | },
38 | onTimerInitiated: () => _updateLoading(true),
39 | onCancel: () => _updateLoading(false),
40 | holdTimeout: Duration(milliseconds: 3000),
41 | enableHapticFeedback: true,
42 | child: ElevatedButton.icon(
43 | onPressed: () {},
44 | label: Text("onTimeout"),
45 | icon: _isLoading
46 | ? SizedBox(
47 | width: 16,
48 | height: 16,
49 | child: CircularProgressIndicator(
50 | strokeWidth: 2,
51 | valueColor: AlwaysStoppedAnimation(Colors.white),
52 | ),
53 | )
54 | : Icon(Icons.timer_3),
55 | ),
56 | ),
57 | ```
58 |
59 | The main example, above and in `example/`, is the same as the default Flutter app, with the adition of a haptic feedback to each tick and the ability to hold the button to keep adding to the counter.
60 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 27
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.gildaswise.holdinggestureexample"
42 | minSdkVersion 16
43 | targetSdkVersion 27
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67 | }
68 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:holding_gesture/holding_gesture.dart';
3 |
4 | void main() => runApp(MyApp());
5 |
6 | class MyApp extends StatefulWidget {
7 | @override
8 | _MyAppState createState() => _MyAppState();
9 | }
10 |
11 | class _MyAppState extends State {
12 | int _counter = 0;
13 | bool _isLoading = false;
14 |
15 | void _incrementCounter() {
16 | if (mounted) {
17 | setState(() {
18 | _counter += 1;
19 | });
20 | }
21 | }
22 |
23 | void _updateLoading(bool value) {
24 | if (mounted) {
25 | setState(() {
26 | _isLoading = value;
27 | });
28 | }
29 | }
30 |
31 | @override
32 | void initState() {
33 | super.initState();
34 | }
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return MaterialApp(
39 | home: Scaffold(
40 | appBar: AppBar(
41 | title: const Text('holding_gesture'),
42 | ),
43 | body: Center(
44 | child: Column(
45 | mainAxisAlignment: MainAxisAlignment.center,
46 | children: [
47 | Text(
48 | 'You have pushed (or held) the button this many times:',
49 | ),
50 | Text(
51 | '$_counter',
52 | style: Theme.of(context).textTheme.headlineMedium,
53 | ),
54 | ],
55 | ),
56 | ),
57 | bottomNavigationBar: _isLoading ? LinearProgressIndicator() : null,
58 | persistentFooterButtons: [
59 | HoldDetector(
60 | onHold: _incrementCounter,
61 | holdTimeout: Duration(milliseconds: 200),
62 | enableHapticFeedback: true,
63 | child: ElevatedButton(
64 | onPressed: _incrementCounter,
65 | child: Text("onHold"),
66 | ),
67 | ),
68 | HoldTimeoutDetector(
69 | onTimeout: () {
70 | _incrementCounter();
71 | _updateLoading(false);
72 | },
73 | onTimerInitiated: () => _updateLoading(true),
74 | onCancel: () => _updateLoading(false),
75 | holdTimeout: Duration(milliseconds: 3000),
76 | enableHapticFeedback: true,
77 | child: ElevatedButton.icon(
78 | onPressed: () {},
79 | label: Text("onTimeout"),
80 | icon: _isLoading
81 | ? SizedBox(
82 | width: 16,
83 | height: 16,
84 | child: CircularProgressIndicator(
85 | strokeWidth: 2,
86 | valueColor: AlwaysStoppedAnimation(Colors.white),
87 | ),
88 | )
89 | : Icon(Icons.timer_3),
90 | ),
91 | ),
92 | ],
93 | ),
94 | );
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/lib/hold_gesture_recognizer.dart:
--------------------------------------------------------------------------------
1 | part of 'package:holding_gesture/holding_gesture.dart';
2 |
3 | /// Signature for when a pointer has remained in contact with the screen at the
4 | /// same location for a long period of time.
5 | typedef void GestureHoldCallback();
6 |
7 | /// Signature for when the pointer that previously triggered a
8 | /// [GestureTapDownCallback] will not end up causing a tap.
9 | ///
10 | /// See also:
11 | ///
12 | /// * [GestureDetector.onTapCancel], which matches this signature.
13 | /// * [TapGestureRecognizer], which uses this signature in one of its callbacks.
14 | typedef void GestureHoldCancelCallback();
15 |
16 | const int kHoldMilliseconds = 300;
17 | const Duration kHoldTimeout = const Duration(milliseconds: kHoldMilliseconds);
18 |
19 | /// Recognizes when the user has pressed down at the same location for a long
20 | /// period of time. Its waiting duration defaults to [kHoldTimeout].
21 | class HoldGestureRecognizer extends PrimaryPointerGestureRecognizer {
22 | /// Creates a long-press gesture recognizer.
23 | ///
24 | /// Consider assigning the [onHold] callback after creating this object.
25 | HoldGestureRecognizer({
26 | this.timeout = kHoldTimeout,
27 | this.enableHapticFeedback = false,
28 | Object? debugOwner,
29 | }) : super(deadline: kHoldTimeout, debugOwner: debugOwner);
30 |
31 | /// The periodic time for each tick
32 | final Duration? timeout;
33 |
34 | /// Whether or not to get a haptic feedback on each tick
35 | final bool enableHapticFeedback;
36 |
37 | /// Called when a hold is recognized.
38 | GestureHoldCallback? onHold;
39 |
40 | /// Called when the hold is canceled.
41 | GestureHoldCancelCallback? onCancel;
42 |
43 | /// Used to figure out when to call parent's stopTrackingPointer method
44 | bool pointerUp = false;
45 |
46 | ///
47 | Timer? _timer;
48 |
49 | @override
50 | void didExceedDeadline() {
51 | resolve(GestureDisposition.accepted);
52 | if (onHold != null) {
53 | _timer = Timer.periodic(timeout ?? kHoldTimeout, (timer) {
54 | if (timer.isActive) {
55 | if (this.enableHapticFeedback) HapticFeedback.selectionClick();
56 | invokeCallback('onHold', onHold!);
57 | }
58 | });
59 | }
60 | }
61 |
62 | @override
63 | void stopTrackingPointer(int pointer) {
64 | if (pointerUp) {
65 | super.stopTrackingPointer(pointer);
66 | pointerUp = false;
67 | }
68 | }
69 |
70 | @override
71 | void resolve(GestureDisposition disposition) {
72 | super.resolve(disposition);
73 | }
74 |
75 | @override
76 | void handlePrimaryPointer(PointerEvent event) {
77 | if (event is PointerUpEvent ||
78 | event is PointerCancelEvent ||
79 | event is PointerRemovedEvent) {
80 | pointerUp = true;
81 | if (onCancel != null) invokeCallback('onCancel', onCancel!);
82 | _timer?.cancel();
83 | resolve(GestureDisposition.rejected);
84 | }
85 | }
86 |
87 | @override
88 | String get debugDescription => 'hold';
89 | }
90 |
--------------------------------------------------------------------------------
/lib/hold_detector.dart:
--------------------------------------------------------------------------------
1 | part of 'package:holding_gesture/holding_gesture.dart';
2 |
3 | /// A widget that detects a holding gesture.
4 | ///
5 | /// If this widget has a child, it defers to that child for its sizing behavior.
6 | /// If it does not have a child, it grows to fit the parent instead.
7 | ///
8 | /// It defaults to repeating an action every 300ms (customizable), but for now
9 | /// it always waits 300ms to start repeating the [onHold] callback.
10 | ///
11 | /// See for additional information.
12 | ///
13 | /// Material design applications typically react to touches with ink splash
14 | /// effects. The [InkWell] class implements this effect and can be used in place
15 | /// or with a [GestureDetector] for handling taps.
16 | ///
17 | /// The `onTap` override won't work when the `child` has a `onPressed`
18 | /// or similar property, so you might want to pass the same method
19 | /// before, like this:
20 | ///
21 | /// ```dart
22 | /// HoldDetector(
23 | /// onHold: _incrementCounter,
24 | /// child: FloatingActionButton(
25 | /// child: Icon(Icons.add),
26 | /// onPressed: _incrementCounter,
27 | /// ),
28 | /// )
29 | /// ```
30 | ///
31 | /// This example makes the counter keep while holding the button:
32 | ///
33 | /// ```dart
34 | /// HoldDetector(
35 | /// onHold: () {
36 | /// setState(() { _counter += 1; });
37 | /// },
38 | /// child: Text("$_counter"),
39 | /// )
40 | /// ```
41 | ///
42 | class HoldDetector extends StatelessWidget {
43 | final GestureTapCallback? onTap;
44 | final GestureHoldCallback onHold;
45 | final GestureHoldCancelCallback? onCancel;
46 |
47 | final Duration? holdTimeout;
48 |
49 | final HitTestBehavior behavior;
50 | final bool enableHapticFeedback;
51 | final bool excludeFromSemantics;
52 |
53 | final Widget child;
54 |
55 | const HoldDetector({
56 | Key? key,
57 | this.onTap,
58 | this.onCancel,
59 | this.holdTimeout,
60 | this.behavior = HitTestBehavior.translucent,
61 | this.enableHapticFeedback = false,
62 | this.excludeFromSemantics = false,
63 | required this.onHold,
64 | required this.child,
65 | }) : super(key: key);
66 |
67 | @override
68 | Widget build(BuildContext context) {
69 | return RawGestureDetector(
70 | behavior: this.behavior,
71 | excludeFromSemantics: this.excludeFromSemantics,
72 | gestures: {
73 | TapGestureRecognizer:
74 | GestureRecognizerFactoryWithHandlers(
75 | () => TapGestureRecognizer(debugOwner: this),
76 | (instance) => instance..onTap = this.onTap ?? this.onHold,
77 | ),
78 | HoldGestureRecognizer:
79 | GestureRecognizerFactoryWithHandlers(
80 | () => HoldGestureRecognizer(
81 | timeout: this.holdTimeout,
82 | enableHapticFeedback: this.enableHapticFeedback,
83 | debugOwner: this,
84 | ),
85 | (instance) => instance
86 | ..onHold = this.onHold
87 | ..onCancel = this.onCancel,
88 | )
89 | },
90 | child: this.child,
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/hold_timeout_detector.dart:
--------------------------------------------------------------------------------
1 | part of 'package:holding_gesture/holding_gesture.dart';
2 |
3 | /// A widget that detects a holding gesture with a timeout.
4 | ///
5 | /// If this widget has a child, it defers to that child for its sizing behavior.
6 | /// If it does not have a child, it grows to fit the parent instead.
7 | ///
8 | /// It defaults to executing an action after 1000ms (customizable).
9 | ///
10 | /// See for additional information.
11 | ///
12 | /// Material design applications typically react to touches with ink splash
13 | /// effects. The [InkWell] class implements this effect and can be used in place
14 | /// or with a [GestureDetector] for handling taps.
15 | ///
16 | /// The `onTap` override won't work when the `child` has a `onPressed`
17 | /// or similar property, so you might want to pass the same method
18 | /// before, like this:
19 | ///
20 | /// ```dart
21 | /// HoldTimeoutDetector(
22 | /// onTimeout: _incrementCounter,
23 | /// child: FloatingActionButton(
24 | /// child: Icon(Icons.add),
25 | /// onPressed: _incrementCounter,
26 | /// ),
27 | /// )
28 | /// ```
29 | ///
30 | /// This example makes the counter add 1 once the 1000ms passed:
31 | ///
32 | /// ```dart
33 | /// HoldTimeoutDetector(
34 | /// onTimeout: () {
35 | /// setState(() { _counter += 1; });
36 | /// },
37 | /// child: Text("$_counter"),
38 | /// )
39 | /// ```
40 | ///
41 | class HoldTimeoutDetector extends StatelessWidget {
42 | final GestureTapCallback? onTap;
43 | final GestureHoldTimeoutCallback onTimeout;
44 | final GestureHoldTimeoutCallback onTimerInitiated;
45 | final GestureHoldTimeoutCancelCallback? onCancel;
46 |
47 | final Duration? holdTimeout;
48 |
49 | final HitTestBehavior behavior;
50 | final bool enableHapticFeedback;
51 | final bool excludeFromSemantics;
52 |
53 | final Widget child;
54 |
55 | const HoldTimeoutDetector({
56 | Key? key,
57 | this.onTap,
58 | this.onCancel,
59 | this.holdTimeout,
60 | this.behavior = HitTestBehavior.translucent,
61 | this.enableHapticFeedback = false,
62 | this.excludeFromSemantics = false,
63 | required this.onTimeout,
64 | required this.onTimerInitiated,
65 | required this.child,
66 | }) : super(key: key);
67 |
68 | @override
69 | Widget build(BuildContext context) {
70 | return RawGestureDetector(
71 | behavior: this.behavior,
72 | excludeFromSemantics: this.excludeFromSemantics,
73 | gestures: {
74 | TapGestureRecognizer:
75 | GestureRecognizerFactoryWithHandlers(
76 | () => TapGestureRecognizer(debugOwner: this),
77 | (instance) => instance..onTap = this.onTap ?? this.onTimerInitiated,
78 | ),
79 | HoldTimeoutGestureRecognizer:
80 | GestureRecognizerFactoryWithHandlers(
81 | () => HoldTimeoutGestureRecognizer(
82 | timeout: this.holdTimeout,
83 | enableHapticFeedback: this.enableHapticFeedback,
84 | debugOwner: this,
85 | ),
86 | (instance) => instance
87 | ..onTimeout = this.onTimeout
88 | ..onTimerInitiated = this.onTimerInitiated
89 | ..onCancel = this.onCancel,
90 | )
91 | },
92 | child: this.child,
93 | );
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/lib/hold_timeout_gesture_recognizer.dart:
--------------------------------------------------------------------------------
1 | part of 'package:holding_gesture/holding_gesture.dart';
2 |
3 | /// Signature for when a pointer has remained in contact with the screen at the
4 | /// same location for a long period of time.
5 | typedef void GestureHoldTimeoutCallback();
6 |
7 | /// Signature for when the pointer that previously triggered a
8 | /// [GestureTapDownCallback] will not end up causing a tap.
9 | ///
10 | /// See also:
11 | ///
12 | /// * [GestureDetector.onTapCancel], which matches this signature.
13 | /// * [TapGestureRecognizer], which uses this signature in one of its callbacks.
14 | typedef void GestureHoldTimeoutCancelCallback();
15 |
16 | const int kHoldTimeoutMilliseconds = 1000;
17 | const Duration kHoldTimeoutDuration =
18 | const Duration(milliseconds: kHoldMilliseconds);
19 |
20 | /// Recognizes when the user has pressed down at the same location for a long
21 | /// period of time. Its waiting duration defaults to [kHoldTimeoutDuration].
22 | class HoldTimeoutGestureRecognizer extends PrimaryPointerGestureRecognizer {
23 | /// Creates a long-press gesture recognizer.
24 | ///
25 | /// Consider assigning the [onTimeout] callback after creating this object.
26 | HoldTimeoutGestureRecognizer({
27 | this.timeout = kHoldTimeout,
28 | this.enableHapticFeedback = false,
29 | Object? debugOwner,
30 | }) : super(deadline: kHoldTimeout, debugOwner: debugOwner);
31 |
32 | /// The periodic time for each tick
33 | final Duration? timeout;
34 |
35 | /// Whether or not to get a haptic feedback on each tick
36 | final bool enableHapticFeedback;
37 |
38 | /// Called when the set duration is over.
39 | GestureHoldTimeoutCallback? onTimeout;
40 |
41 | /// Called when the timer starts.
42 | GestureHoldTimeoutCallback? onTimerInitiated;
43 |
44 | /// Called when the hold is canceled.
45 | GestureHoldTimeoutCancelCallback? onCancel;
46 |
47 | /// Used to figure out when to call parent's stopTrackingPointer method
48 | bool pointerUp = false;
49 |
50 | ///
51 | Timer? _timer;
52 |
53 | @override
54 | void didExceedDeadline() {
55 | resolve(GestureDisposition.accepted);
56 | if (onTimerInitiated != null && onTimeout != null) {
57 | invokeCallback('onTimerInitiated', onTimerInitiated!);
58 | _timer = Timer.periodic(timeout ?? kHoldTimeout, (timer) {
59 | if (timer.isActive) {
60 | if (this.enableHapticFeedback) HapticFeedback.selectionClick();
61 | invokeCallback('onTimeout', onTimeout!);
62 | timer.cancel();
63 | }
64 | });
65 | }
66 | }
67 |
68 | @override
69 | void stopTrackingPointer(int pointer) {
70 | if (pointerUp) {
71 | super.stopTrackingPointer(pointer);
72 | pointerUp = false;
73 | }
74 | }
75 |
76 | @override
77 | void resolve(GestureDisposition disposition) {
78 | super.resolve(disposition);
79 | }
80 |
81 | @override
82 | void handlePrimaryPointer(PointerEvent event) {
83 | if (event is PointerUpEvent ||
84 | event is PointerCancelEvent ||
85 | event is PointerRemovedEvent) {
86 | pointerUp = true;
87 | if (onCancel != null) invokeCallback('onCancel', onCancel!);
88 | _timer?.cancel();
89 | resolve(GestureDisposition.rejected);
90 | }
91 | }
92 |
93 | @override
94 | String get debugDescription => 'hold-timeout';
95 | }
96 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9 | url: "https://pub.dev"
10 | source: hosted
11 | version: "2.11.0"
12 | boolean_selector:
13 | dependency: transitive
14 | description:
15 | name: boolean_selector
16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17 | url: "https://pub.dev"
18 | source: hosted
19 | version: "2.1.1"
20 | characters:
21 | dependency: transitive
22 | description:
23 | name: characters
24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25 | url: "https://pub.dev"
26 | source: hosted
27 | version: "1.3.0"
28 | clock:
29 | dependency: transitive
30 | description:
31 | name: clock
32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33 | url: "https://pub.dev"
34 | source: hosted
35 | version: "1.1.1"
36 | collection:
37 | dependency: transitive
38 | description:
39 | name: collection
40 | sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
41 | url: "https://pub.dev"
42 | source: hosted
43 | version: "1.17.1"
44 | fake_async:
45 | dependency: transitive
46 | description:
47 | name: fake_async
48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
49 | url: "https://pub.dev"
50 | source: hosted
51 | version: "1.3.1"
52 | flutter:
53 | dependency: "direct main"
54 | description: flutter
55 | source: sdk
56 | version: "0.0.0"
57 | flutter_test:
58 | dependency: "direct dev"
59 | description: flutter
60 | source: sdk
61 | version: "0.0.0"
62 | js:
63 | dependency: transitive
64 | description:
65 | name: js
66 | sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
67 | url: "https://pub.dev"
68 | source: hosted
69 | version: "0.6.7"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
75 | url: "https://pub.dev"
76 | source: hosted
77 | version: "0.12.15"
78 | material_color_utilities:
79 | dependency: transitive
80 | description:
81 | name: material_color_utilities
82 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
83 | url: "https://pub.dev"
84 | source: hosted
85 | version: "0.2.0"
86 | meta:
87 | dependency: transitive
88 | description:
89 | name: meta
90 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
91 | url: "https://pub.dev"
92 | source: hosted
93 | version: "1.9.1"
94 | path:
95 | dependency: transitive
96 | description:
97 | name: path
98 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
99 | url: "https://pub.dev"
100 | source: hosted
101 | version: "1.8.3"
102 | sky_engine:
103 | dependency: transitive
104 | description: flutter
105 | source: sdk
106 | version: "0.0.99"
107 | source_span:
108 | dependency: transitive
109 | description:
110 | name: source_span
111 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
112 | url: "https://pub.dev"
113 | source: hosted
114 | version: "1.9.1"
115 | stack_trace:
116 | dependency: transitive
117 | description:
118 | name: stack_trace
119 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
120 | url: "https://pub.dev"
121 | source: hosted
122 | version: "1.11.0"
123 | stream_channel:
124 | dependency: transitive
125 | description:
126 | name: stream_channel
127 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
128 | url: "https://pub.dev"
129 | source: hosted
130 | version: "2.1.1"
131 | string_scanner:
132 | dependency: transitive
133 | description:
134 | name: string_scanner
135 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
136 | url: "https://pub.dev"
137 | source: hosted
138 | version: "1.2.0"
139 | term_glyph:
140 | dependency: transitive
141 | description:
142 | name: term_glyph
143 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
144 | url: "https://pub.dev"
145 | source: hosted
146 | version: "1.2.1"
147 | test_api:
148 | dependency: transitive
149 | description:
150 | name: test_api
151 | sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
152 | url: "https://pub.dev"
153 | source: hosted
154 | version: "0.5.1"
155 | vector_math:
156 | dependency: transitive
157 | description:
158 | name: vector_math
159 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
160 | url: "https://pub.dev"
161 | source: hosted
162 | version: "2.1.4"
163 | sdks:
164 | dart: ">=3.0.0-0 <4.0.0"
165 | flutter: ">=2.0.0"
166 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9 | url: "https://pub.dev"
10 | source: hosted
11 | version: "2.11.0"
12 | boolean_selector:
13 | dependency: transitive
14 | description:
15 | name: boolean_selector
16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17 | url: "https://pub.dev"
18 | source: hosted
19 | version: "2.1.1"
20 | characters:
21 | dependency: transitive
22 | description:
23 | name: characters
24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25 | url: "https://pub.dev"
26 | source: hosted
27 | version: "1.3.0"
28 | clock:
29 | dependency: transitive
30 | description:
31 | name: clock
32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33 | url: "https://pub.dev"
34 | source: hosted
35 | version: "1.1.1"
36 | collection:
37 | dependency: transitive
38 | description:
39 | name: collection
40 | sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
41 | url: "https://pub.dev"
42 | source: hosted
43 | version: "1.17.1"
44 | fake_async:
45 | dependency: transitive
46 | description:
47 | name: fake_async
48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
49 | url: "https://pub.dev"
50 | source: hosted
51 | version: "1.3.1"
52 | flutter:
53 | dependency: "direct main"
54 | description: flutter
55 | source: sdk
56 | version: "0.0.0"
57 | flutter_test:
58 | dependency: "direct dev"
59 | description: flutter
60 | source: sdk
61 | version: "0.0.0"
62 | holding_gesture:
63 | dependency: "direct dev"
64 | description:
65 | path: ".."
66 | relative: true
67 | source: path
68 | version: "1.2.0"
69 | js:
70 | dependency: transitive
71 | description:
72 | name: js
73 | sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
74 | url: "https://pub.dev"
75 | source: hosted
76 | version: "0.6.7"
77 | matcher:
78 | dependency: transitive
79 | description:
80 | name: matcher
81 | sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
82 | url: "https://pub.dev"
83 | source: hosted
84 | version: "0.12.15"
85 | material_color_utilities:
86 | dependency: transitive
87 | description:
88 | name: material_color_utilities
89 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
90 | url: "https://pub.dev"
91 | source: hosted
92 | version: "0.2.0"
93 | meta:
94 | dependency: transitive
95 | description:
96 | name: meta
97 | sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
98 | url: "https://pub.dev"
99 | source: hosted
100 | version: "1.9.1"
101 | path:
102 | dependency: transitive
103 | description:
104 | name: path
105 | sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
106 | url: "https://pub.dev"
107 | source: hosted
108 | version: "1.8.3"
109 | sky_engine:
110 | dependency: transitive
111 | description: flutter
112 | source: sdk
113 | version: "0.0.99"
114 | source_span:
115 | dependency: transitive
116 | description:
117 | name: source_span
118 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
119 | url: "https://pub.dev"
120 | source: hosted
121 | version: "1.9.1"
122 | stack_trace:
123 | dependency: transitive
124 | description:
125 | name: stack_trace
126 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
127 | url: "https://pub.dev"
128 | source: hosted
129 | version: "1.11.0"
130 | stream_channel:
131 | dependency: transitive
132 | description:
133 | name: stream_channel
134 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
135 | url: "https://pub.dev"
136 | source: hosted
137 | version: "2.1.1"
138 | string_scanner:
139 | dependency: transitive
140 | description:
141 | name: string_scanner
142 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
143 | url: "https://pub.dev"
144 | source: hosted
145 | version: "1.2.0"
146 | term_glyph:
147 | dependency: transitive
148 | description:
149 | name: term_glyph
150 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
151 | url: "https://pub.dev"
152 | source: hosted
153 | version: "1.2.1"
154 | test_api:
155 | dependency: transitive
156 | description:
157 | name: test_api
158 | sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
159 | url: "https://pub.dev"
160 | source: hosted
161 | version: "0.5.1"
162 | vector_math:
163 | dependency: transitive
164 | description:
165 | name: vector_math
166 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
167 | url: "https://pub.dev"
168 | source: hosted
169 | version: "2.1.4"
170 | sdks:
171 | dart: ">=3.0.0 <4.0.0"
172 | flutter: ">=3.0.0"
173 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | );
27 | name = "Embed Frameworks";
28 | runOnlyForDeploymentPostprocessing = 0;
29 | };
30 | /* End PBXCopyFilesBuildPhase section */
31 |
32 | /* Begin PBXFileReference section */
33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
36 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
37 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
38 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
39 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
40 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
41 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
43 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
44 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
45 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
46 | /* End PBXFileReference section */
47 |
48 | /* Begin PBXFrameworksBuildPhase section */
49 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
50 | isa = PBXFrameworksBuildPhase;
51 | buildActionMask = 2147483647;
52 | files = (
53 | );
54 | runOnlyForDeploymentPostprocessing = 0;
55 | };
56 | /* End PBXFrameworksBuildPhase section */
57 |
58 | /* Begin PBXGroup section */
59 | 9740EEB11CF90186004384FC /* Flutter */ = {
60 | isa = PBXGroup;
61 | children = (
62 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
63 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
64 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
65 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
66 | );
67 | name = Flutter;
68 | sourceTree = "";
69 | };
70 | 97C146E51CF9000F007C117D = {
71 | isa = PBXGroup;
72 | children = (
73 | 9740EEB11CF90186004384FC /* Flutter */,
74 | 97C146F01CF9000F007C117D /* Runner */,
75 | 97C146EF1CF9000F007C117D /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | 97C146EF1CF9000F007C117D /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 97C146EE1CF9000F007C117D /* Runner.app */,
83 | );
84 | name = Products;
85 | sourceTree = "";
86 | };
87 | 97C146F01CF9000F007C117D /* Runner */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
91 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
92 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
93 | 97C147021CF9000F007C117D /* Info.plist */,
94 | 97C146F11CF9000F007C117D /* Supporting Files */,
95 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
96 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
97 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
98 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
99 | );
100 | path = Runner;
101 | sourceTree = "";
102 | };
103 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
104 | isa = PBXGroup;
105 | children = (
106 | );
107 | name = "Supporting Files";
108 | sourceTree = "";
109 | };
110 | /* End PBXGroup section */
111 |
112 | /* Begin PBXNativeTarget section */
113 | 97C146ED1CF9000F007C117D /* Runner */ = {
114 | isa = PBXNativeTarget;
115 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
116 | buildPhases = (
117 | 9740EEB61CF901F6004384FC /* Run Script */,
118 | 97C146EA1CF9000F007C117D /* Sources */,
119 | 97C146EB1CF9000F007C117D /* Frameworks */,
120 | 97C146EC1CF9000F007C117D /* Resources */,
121 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
122 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
123 | );
124 | buildRules = (
125 | );
126 | dependencies = (
127 | );
128 | name = Runner;
129 | productName = Runner;
130 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
131 | productType = "com.apple.product-type.application";
132 | };
133 | /* End PBXNativeTarget section */
134 |
135 | /* Begin PBXProject section */
136 | 97C146E61CF9000F007C117D /* Project object */ = {
137 | isa = PBXProject;
138 | attributes = {
139 | LastUpgradeCheck = 0910;
140 | ORGANIZATIONNAME = "The Chromium Authors";
141 | TargetAttributes = {
142 | 97C146ED1CF9000F007C117D = {
143 | CreatedOnToolsVersion = 7.3.1;
144 | LastSwiftMigration = 0910;
145 | };
146 | };
147 | };
148 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
149 | compatibilityVersion = "Xcode 3.2";
150 | developmentRegion = English;
151 | hasScannedForEncodings = 0;
152 | knownRegions = (
153 | en,
154 | Base,
155 | );
156 | mainGroup = 97C146E51CF9000F007C117D;
157 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
158 | projectDirPath = "";
159 | projectRoot = "";
160 | targets = (
161 | 97C146ED1CF9000F007C117D /* Runner */,
162 | );
163 | };
164 | /* End PBXProject section */
165 |
166 | /* Begin PBXResourcesBuildPhase section */
167 | 97C146EC1CF9000F007C117D /* Resources */ = {
168 | isa = PBXResourcesBuildPhase;
169 | buildActionMask = 2147483647;
170 | files = (
171 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
172 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
173 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
174 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
175 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
176 | );
177 | runOnlyForDeploymentPostprocessing = 0;
178 | };
179 | /* End PBXResourcesBuildPhase section */
180 |
181 | /* Begin PBXShellScriptBuildPhase section */
182 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
183 | isa = PBXShellScriptBuildPhase;
184 | buildActionMask = 2147483647;
185 | files = (
186 | );
187 | inputPaths = (
188 | );
189 | name = "Thin Binary";
190 | outputPaths = (
191 | );
192 | runOnlyForDeploymentPostprocessing = 0;
193 | shellPath = /bin/sh;
194 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
195 | };
196 | 9740EEB61CF901F6004384FC /* Run Script */ = {
197 | isa = PBXShellScriptBuildPhase;
198 | buildActionMask = 2147483647;
199 | files = (
200 | );
201 | inputPaths = (
202 | );
203 | name = "Run Script";
204 | outputPaths = (
205 | );
206 | runOnlyForDeploymentPostprocessing = 0;
207 | shellPath = /bin/sh;
208 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
209 | };
210 | /* End PBXShellScriptBuildPhase section */
211 |
212 | /* Begin PBXSourcesBuildPhase section */
213 | 97C146EA1CF9000F007C117D /* Sources */ = {
214 | isa = PBXSourcesBuildPhase;
215 | buildActionMask = 2147483647;
216 | files = (
217 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
218 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | };
222 | /* End PBXSourcesBuildPhase section */
223 |
224 | /* Begin PBXVariantGroup section */
225 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
226 | isa = PBXVariantGroup;
227 | children = (
228 | 97C146FB1CF9000F007C117D /* Base */,
229 | );
230 | name = Main.storyboard;
231 | sourceTree = "";
232 | };
233 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
234 | isa = PBXVariantGroup;
235 | children = (
236 | 97C147001CF9000F007C117D /* Base */,
237 | );
238 | name = LaunchScreen.storyboard;
239 | sourceTree = "";
240 | };
241 | /* End PBXVariantGroup section */
242 |
243 | /* Begin XCBuildConfiguration section */
244 | 97C147031CF9000F007C117D /* Debug */ = {
245 | isa = XCBuildConfiguration;
246 | buildSettings = {
247 | ALWAYS_SEARCH_USER_PATHS = NO;
248 | CLANG_ANALYZER_NONNULL = YES;
249 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
250 | CLANG_CXX_LIBRARY = "libc++";
251 | CLANG_ENABLE_MODULES = YES;
252 | CLANG_ENABLE_OBJC_ARC = YES;
253 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
254 | CLANG_WARN_BOOL_CONVERSION = YES;
255 | CLANG_WARN_COMMA = YES;
256 | CLANG_WARN_CONSTANT_CONVERSION = YES;
257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
258 | CLANG_WARN_EMPTY_BODY = YES;
259 | CLANG_WARN_ENUM_CONVERSION = YES;
260 | CLANG_WARN_INFINITE_RECURSION = YES;
261 | CLANG_WARN_INT_CONVERSION = YES;
262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
263 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
265 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
266 | CLANG_WARN_STRICT_PROTOTYPES = YES;
267 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
268 | CLANG_WARN_UNREACHABLE_CODE = YES;
269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
270 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
271 | COPY_PHASE_STRIP = NO;
272 | DEBUG_INFORMATION_FORMAT = dwarf;
273 | ENABLE_STRICT_OBJC_MSGSEND = YES;
274 | ENABLE_TESTABILITY = YES;
275 | GCC_C_LANGUAGE_STANDARD = gnu99;
276 | GCC_DYNAMIC_NO_PIC = NO;
277 | GCC_NO_COMMON_BLOCKS = YES;
278 | GCC_OPTIMIZATION_LEVEL = 0;
279 | GCC_PREPROCESSOR_DEFINITIONS = (
280 | "DEBUG=1",
281 | "$(inherited)",
282 | );
283 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
284 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
285 | GCC_WARN_UNDECLARED_SELECTOR = YES;
286 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
287 | GCC_WARN_UNUSED_FUNCTION = YES;
288 | GCC_WARN_UNUSED_VARIABLE = YES;
289 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
290 | MTL_ENABLE_DEBUG_INFO = YES;
291 | ONLY_ACTIVE_ARCH = YES;
292 | SDKROOT = iphoneos;
293 | TARGETED_DEVICE_FAMILY = "1,2";
294 | };
295 | name = Debug;
296 | };
297 | 97C147041CF9000F007C117D /* Release */ = {
298 | isa = XCBuildConfiguration;
299 | buildSettings = {
300 | ALWAYS_SEARCH_USER_PATHS = NO;
301 | CLANG_ANALYZER_NONNULL = YES;
302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
303 | CLANG_CXX_LIBRARY = "libc++";
304 | CLANG_ENABLE_MODULES = YES;
305 | CLANG_ENABLE_OBJC_ARC = YES;
306 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
307 | CLANG_WARN_BOOL_CONVERSION = YES;
308 | CLANG_WARN_COMMA = YES;
309 | CLANG_WARN_CONSTANT_CONVERSION = YES;
310 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
311 | CLANG_WARN_EMPTY_BODY = YES;
312 | CLANG_WARN_ENUM_CONVERSION = YES;
313 | CLANG_WARN_INFINITE_RECURSION = YES;
314 | CLANG_WARN_INT_CONVERSION = YES;
315 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
316 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
317 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
318 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
319 | CLANG_WARN_STRICT_PROTOTYPES = YES;
320 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
321 | CLANG_WARN_UNREACHABLE_CODE = YES;
322 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
323 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
324 | COPY_PHASE_STRIP = NO;
325 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
326 | ENABLE_NS_ASSERTIONS = NO;
327 | ENABLE_STRICT_OBJC_MSGSEND = YES;
328 | GCC_C_LANGUAGE_STANDARD = gnu99;
329 | GCC_NO_COMMON_BLOCKS = YES;
330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
332 | GCC_WARN_UNDECLARED_SELECTOR = YES;
333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
334 | GCC_WARN_UNUSED_FUNCTION = YES;
335 | GCC_WARN_UNUSED_VARIABLE = YES;
336 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
337 | MTL_ENABLE_DEBUG_INFO = NO;
338 | SDKROOT = iphoneos;
339 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
340 | TARGETED_DEVICE_FAMILY = "1,2";
341 | VALIDATE_PRODUCT = YES;
342 | };
343 | name = Release;
344 | };
345 | 97C147061CF9000F007C117D /* Debug */ = {
346 | isa = XCBuildConfiguration;
347 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
348 | buildSettings = {
349 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
350 | CLANG_ENABLE_MODULES = YES;
351 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
352 | ENABLE_BITCODE = NO;
353 | FRAMEWORK_SEARCH_PATHS = (
354 | "$(inherited)",
355 | "$(PROJECT_DIR)/Flutter",
356 | );
357 | INFOPLIST_FILE = Runner/Info.plist;
358 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
359 | LIBRARY_SEARCH_PATHS = (
360 | "$(inherited)",
361 | "$(PROJECT_DIR)/Flutter",
362 | );
363 | PRODUCT_BUNDLE_IDENTIFIER = com.gildaswise.holdingGestureExample;
364 | PRODUCT_NAME = "$(TARGET_NAME)";
365 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
366 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
367 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
368 | SWIFT_VERSION = 4.0;
369 | VERSIONING_SYSTEM = "apple-generic";
370 | };
371 | name = Debug;
372 | };
373 | 97C147071CF9000F007C117D /* Release */ = {
374 | isa = XCBuildConfiguration;
375 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
376 | buildSettings = {
377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378 | CLANG_ENABLE_MODULES = YES;
379 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
380 | ENABLE_BITCODE = NO;
381 | FRAMEWORK_SEARCH_PATHS = (
382 | "$(inherited)",
383 | "$(PROJECT_DIR)/Flutter",
384 | );
385 | INFOPLIST_FILE = Runner/Info.plist;
386 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
387 | LIBRARY_SEARCH_PATHS = (
388 | "$(inherited)",
389 | "$(PROJECT_DIR)/Flutter",
390 | );
391 | PRODUCT_BUNDLE_IDENTIFIER = com.gildaswise.holdingGestureExample;
392 | PRODUCT_NAME = "$(TARGET_NAME)";
393 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
394 | SWIFT_SWIFT3_OBJC_INFERENCE = On;
395 | SWIFT_VERSION = 4.0;
396 | VERSIONING_SYSTEM = "apple-generic";
397 | };
398 | name = Release;
399 | };
400 | /* End XCBuildConfiguration section */
401 |
402 | /* Begin XCConfigurationList section */
403 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
404 | isa = XCConfigurationList;
405 | buildConfigurations = (
406 | 97C147031CF9000F007C117D /* Debug */,
407 | 97C147041CF9000F007C117D /* Release */,
408 | );
409 | defaultConfigurationIsVisible = 0;
410 | defaultConfigurationName = Release;
411 | };
412 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
413 | isa = XCConfigurationList;
414 | buildConfigurations = (
415 | 97C147061CF9000F007C117D /* Debug */,
416 | 97C147071CF9000F007C117D /* Release */,
417 | );
418 | defaultConfigurationIsVisible = 0;
419 | defaultConfigurationName = Release;
420 | };
421 | /* End XCConfigurationList section */
422 | };
423 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
424 | }
425 |
--------------------------------------------------------------------------------