├── .gitignore ├── LICENSE ├── README.md ├── doc ├── logo │ ├── Version1_hdpi.png │ ├── Version1_ldpi.png │ ├── Version1_mdpi.png │ ├── Version1_xhdpi.png │ ├── Version1_xxhdpi.png │ ├── Version1_xxxhdpi.png │ ├── Version2_hdpi.png │ ├── Version2_ldpi.png │ ├── Version2_mdpi.png │ ├── Version2_xhdpi.png │ ├── Version2_xxhdpi.png │ └── Version2_xxxhdpi.png ├── signature_pad.png └── signature_pad_ios.png ├── example ├── css │ └── signature-pad.css ├── index.html └── main.dart ├── lib ├── bezier.dart ├── mark.dart ├── signature_pad.dart └── signature_pad_html.dart ├── pubspec.yaml └── signature_pad_flutter ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── yourcompany │ │ │ │ └── example │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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 │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart └── pubspec.yaml ├── lib ├── signature_pad_flutter.dart └── src │ ├── colors.dart │ ├── painter.dart │ └── point.dart └── pubspec.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .packages 3 | .pub/ 4 | build/ 5 | packages 6 | # Remove the following pattern if you wish to check in your lock file 7 | pubspec.lock 8 | 9 | # Files created by dart2js 10 | *.dart.js 11 | *.part.js 12 | *.js.deps 13 | *.js.map 14 | *.info.json 15 | 16 | # Directory created by dartdoc 17 | doc/api/ 18 | 19 | # JetBrains IDEs 20 | .idea/ 21 | *.iml 22 | *.ipr 23 | *.iws 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, John Ryan 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Signature Pad Logo 3 |

4 | 5 | A Pure Dart implementation of [Signature Pad][signature-pad] by Szymon Nowak. 6 | Supports Flutter and browsers. 7 | 8 |

9 | Signature Pad Demo 10 | Signature Pad Demo IOS 11 |

12 | 13 | ## Example 14 | 15 | see the `example/` directory for a complete example. (e.g. `webdev serve example`) 16 | 17 | ## Demo 18 | 19 | The `example/` directory contains a Dart version of the [JS demo][demo] 20 | 21 | [signature-pad]: https://github.com/szimek/signature_pad 22 | [demo]: http://szimek.github.io/signature_pad/ 23 | [image]: https://raw.githubusercontent.com/johnpryan/signature-pad-dart/master/doc/signature_pad.png 24 | [flutter-image]: https://github.com/apptreesoftware/signature-pad-dart/raw/master/doc/signature_pad_ios.png 25 | -------------------------------------------------------------------------------- /doc/logo/Version1_hdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_hdpi.png -------------------------------------------------------------------------------- /doc/logo/Version1_ldpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_ldpi.png -------------------------------------------------------------------------------- /doc/logo/Version1_mdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_mdpi.png -------------------------------------------------------------------------------- /doc/logo/Version1_xhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_xhdpi.png -------------------------------------------------------------------------------- /doc/logo/Version1_xxhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_xxhdpi.png -------------------------------------------------------------------------------- /doc/logo/Version1_xxxhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version1_xxxhdpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_hdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_hdpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_ldpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_ldpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_mdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_mdpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_xhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_xhdpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_xxhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_xxhdpi.png -------------------------------------------------------------------------------- /doc/logo/Version2_xxxhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/logo/Version2_xxxhdpi.png -------------------------------------------------------------------------------- /doc/signature_pad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/signature_pad.png -------------------------------------------------------------------------------- /doc/signature_pad_ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/doc/signature_pad_ios.png -------------------------------------------------------------------------------- /example/css/signature-pad.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAb1UlEQVR4nHXdy3Xj2BJE0TuGCXSDdtAN2kE3aAfcgB10g2+gOtBWNt5AS1USeD/5iYwIsqvX+/3ens/ndr/ft/v9vh3Hse37vt1ut23f9+31em33+3273W7b4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II83z4oudLYYHAyLrtYUVhR6nU5L0uqH1JwaLuunTStEgVuBbhq36q+yxWwLlD3OLB7jS07Kaqisd9P3i7UVbkd0jP0/PxYj8LPmTGD1Zka+GoACYkmYr9XzXuHztvrZpeGHBWf1pJk5RTIXbBMeXi1QslQnc5Ocv7I668UuzZNh5bbq/rF2qlN5sCtirUlmj+t5WBXJ7XupOAyL8Vk9/OOQVlFJqmRmak9WvM4/v33ITIcLYcOKC9XwbdhVVPFhY+TLqoZpMqSBf0fBWgXl3JLRhRdwVn36jVXtlCF4YwoBsHo9OlKrtBlkYoodreiVY2isFxWeMEoy23mBwpauE7xwMGOA9KWNLAyqypNDVGAZERXdLX15oBUeHrW1vE54cpurCt8b2VaISawewufQmhrtl/r1dHf7/fXfg8DtTZ6UYf08gZQhdzPNB6tQCFDNqSAE/unkakVYVdWLCZ8GotdXqEr6yuYQrGzcFox2k12RcUgiREVphPS8/u+//67vZOadREv7PvHvs6Bq84Q7qTO7XVy7/X7b6RMJaw14UB1Hk0NVcdZ3eJ2AbIzTGrfpa8OZoeyRTjhVRng28VaNhVNhbcULg6nNncI93vfaFGMdfAu6gC2gmz9qkUR1kVP5rH+/r8Efabhb8fIWpwxQqLWjmq6eMz55lB3Fsy5IgTGIO1SZ7D0vXj/D1qZ7VFrqtW0AAAAAElFTkSuQmCC") repeat scroll center center rgb(179, 179, 179); 3 | font-family: Helvetica, Sans-Serif; 4 | 5 | -moz-user-select: none; 6 | -webkit-user-select: none; 7 | -ms-user-select: none; 8 | } 9 | 10 | .m-signature-pad { 11 | position: absolute; 12 | font-size: 10px; 13 | width: 700px; 14 | height: 400px; 15 | top: 50%; 16 | left: 50%; 17 | margin-left: -350px; 18 | margin-top: -200px; 19 | border: 1px solid #e8e8e8; 20 | background-color: #fff; 21 | box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.08) inset; 22 | border-radius: 4px; 23 | } 24 | 25 | .m-signature-pad:before, .m-signature-pad:after { 26 | position: absolute; 27 | z-index: -1; 28 | content: ""; 29 | width: 40%; 30 | height: 10px; 31 | left: 20px; 32 | bottom: 10px; 33 | background: transparent; 34 | -webkit-transform: skew(-3deg) rotate(-3deg); 35 | -moz-transform: skew(-3deg) rotate(-3deg); 36 | -ms-transform: skew(-3deg) rotate(-3deg); 37 | -o-transform: skew(-3deg) rotate(-3deg); 38 | transform: skew(-3deg) rotate(-3deg); 39 | box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4); 40 | } 41 | 42 | .m-signature-pad:after { 43 | left: auto; 44 | right: 20px; 45 | -webkit-transform: skew(3deg) rotate(3deg); 46 | -moz-transform: skew(3deg) rotate(3deg); 47 | -ms-transform: skew(3deg) rotate(3deg); 48 | -o-transform: skew(3deg) rotate(3deg); 49 | transform: skew(3deg) rotate(3deg); 50 | } 51 | 52 | .m-signature-pad--body { 53 | position: absolute; 54 | left: 20px; 55 | right: 20px; 56 | top: 20px; 57 | bottom: 80px; 58 | border: 1px solid #f4f4f4; 59 | } 60 | 61 | .m-signature-pad--body 62 | canvas { 63 | position: absolute; 64 | left: 0; 65 | top: 0; 66 | width: 100%; 67 | height: 100%; 68 | border-radius: 4px; 69 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.02) inset; 70 | } 71 | 72 | .m-signature-pad--footer { 73 | position: absolute; 74 | left: 20px; 75 | right: 20px; 76 | bottom: 20px; 77 | height: 60px; 78 | } 79 | 80 | .m-signature-pad--footer 81 | .description { 82 | color: #C3C3C3; 83 | text-align: center; 84 | font-size: 1.2em; 85 | margin-top: 1em; 86 | } 87 | 88 | .m-signature-pad--footer 89 | .left, .right { 90 | position: absolute; 91 | bottom: 0; 92 | } 93 | 94 | .m-signature-pad--footer 95 | .left { 96 | left: 0; 97 | } 98 | 99 | .m-signature-pad--footer 100 | .right { 101 | right: 0; 102 | } 103 | 104 | @media screen and (max-width: 1024px) { 105 | .m-signature-pad { 106 | top: 0; 107 | left: 0; 108 | right: 0; 109 | bottom: 0; 110 | width: auto; 111 | height: auto; 112 | min-width: 250px; 113 | min-height: 140px; 114 | margin: 5%; 115 | } 116 | #github { 117 | display: none; 118 | } 119 | } 120 | 121 | @media screen and (min-device-width: 768px) and (max-device-width: 1024px) { 122 | .m-signature-pad { 123 | margin: 10%; 124 | } 125 | } 126 | 127 | @media screen and (max-height: 320px) { 128 | .m-signature-pad--body { 129 | left: 0; 130 | right: 0; 131 | top: 0; 132 | bottom: 32px; 133 | } 134 | .m-signature-pad--footer { 135 | left: 20px; 136 | right: 20px; 137 | bottom: 4px; 138 | height: 28px; 139 | } 140 | .m-signature-pad--footer 141 | .description { 142 | font-size: 1em; 143 | margin-top: 1em; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Signature Pad demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 20 |
21 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /example/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | import 'dart:math'; 3 | import 'dart:typed_data'; 4 | 5 | import 'package:signature_pad/signature_pad.dart'; 6 | import 'package:signature_pad/signature_pad_html.dart'; 7 | 8 | void main() { 9 | var clearButton = querySelector("[data-action=clear]"); 10 | var savePngButton = querySelector("#save-png-button"); 11 | var saveSvgButton = querySelector("#save-svg-button"); 12 | var canvas = querySelector("canvas"); 13 | var opts = new SignaturePadOptions(minWidth: 1.5, maxWidth: 4.0); 14 | var signaturePad = new SignaturePadHtml(canvas, opts); 15 | clearButton.onClick.listen((e) => signaturePad.clear()); 16 | 17 | savePngButton.onClick.listen((e) { 18 | download(signaturePad.toDataUrl(), "signature.png"); 19 | }); 20 | saveSvgButton.onClick.listen((e) { 21 | download(signaturePad.toDataUrl('image/svg+xml'), "signature.svg"); 22 | }); 23 | 24 | window.onResize.listen((e) => resizeCanvas(canvas)); 25 | resizeCanvas(canvas); 26 | } 27 | 28 | void download(String dataUrl, String filename) { 29 | var blob = dataUrlToBlob(dataUrl); 30 | var url = Url.createObjectUrl(blob); 31 | 32 | var a = document.createElement("a"); 33 | a.setAttribute("style", "display: none"); 34 | a.setAttribute("href", url); 35 | a.setAttribute("download", filename); 36 | 37 | document.body.append(a); 38 | a.click(); 39 | 40 | Url.revokeObjectUrl(url); 41 | } 42 | 43 | Blob dataUrlToBlob(String dataUri) { 44 | const String base64Marker = ';base64,'; 45 | var parts = dataUri.split(base64Marker); 46 | var contentType = parts[0].split(":")[1]; 47 | var raw = window.atob(parts[1]); 48 | var rawLength = raw.length; 49 | var list = Uint8List(rawLength); 50 | for (var i = 0; i < rawLength; i++) { 51 | list[i] = raw.codeUnitAt(i); 52 | } 53 | return new Blob([list], contentType); 54 | } 55 | 56 | // Adjust canvas coordinate space taking into account pixel ratio, 57 | // to make it look crisp on mobile devices. 58 | // This also causes canvas to be cleared. 59 | void resizeCanvas(CanvasElement canvas) { 60 | // When zoomed out to less than 100%, for some very strange reason, 61 | // some browsers report devicePixelRatio as less than 1 62 | // and only part of the canvas is cleared then. 63 | var ratio = max(window.devicePixelRatio ?? 1.0, 1); 64 | canvas.width = canvas.offsetWidth * ratio; 65 | canvas.height = canvas.offsetHeight * ratio; 66 | (canvas.getContext("2d") as CanvasRenderingContext2D).scale(ratio, ratio); 67 | } 68 | -------------------------------------------------------------------------------- /lib/bezier.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:signature_pad/mark.dart'; 4 | 5 | class Bezier { 6 | final Mark startPoint; 7 | final Point control1; 8 | final Point control2; 9 | final Mark endPoint; 10 | Bezier(this.startPoint, this.control1, this.control2, this.endPoint); 11 | 12 | double length() { 13 | var steps = 10; 14 | var length = 0.0; 15 | var px; 16 | var py; 17 | 18 | for (var i = 0.0; i <= steps; i += 1) { 19 | var t = i / steps; 20 | var cx = this._point( 21 | t, 22 | this.startPoint.x, 23 | this.control1.x, 24 | this.control2.x, 25 | this.endPoint.x, 26 | ); 27 | var cy = _point( 28 | t, 29 | this.startPoint.y, 30 | this.control1.y, 31 | this.control2.y, 32 | this.endPoint.y, 33 | ); 34 | if (i > 0) { 35 | var xdiff = cx - px; 36 | var ydiff = cy - py; 37 | length += sqrt((xdiff * xdiff) + (ydiff * ydiff)); 38 | } 39 | px = cx; 40 | py = cy; 41 | } 42 | 43 | return length; 44 | } 45 | 46 | double _point(double t, double start, double c1, double c2, double end) { 47 | return (start * (1.0 - t) * (1.0 - t) * (1.0 - t)) + 48 | (3.0 * c1 * (1.0 - t) * (1.0 - t) * t) + 49 | (3.0 * c2 * (1.0 - t) * t * t) + 50 | (end * t * t * t); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/mark.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class Mark extends Point { 4 | final DateTime time; 5 | 6 | Mark(double x, double y, this.time) : super(x, y); 7 | 8 | int get timeMs => time.millisecondsSinceEpoch; 9 | 10 | double velocityFrom(Mark start) { 11 | if (this.timeMs == start.timeMs) { 12 | return 1.0; 13 | } 14 | var result = this.distanceTo(start) / (this.timeMs - start.timeMs); 15 | return result; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/signature_pad.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:signature_pad/bezier.dart'; 4 | import 'package:signature_pad/mark.dart'; 5 | 6 | class SignaturePadOptions { 7 | final String penColor; 8 | final String backgroundColor; 9 | final double minWidth; 10 | final double maxWidth; 11 | final int throttle; // ms 12 | final double velocityFilterWeight; 13 | final double dotSize; 14 | 15 | /// Grey text rendered in the bottom-right corner of the resulting image. 16 | final String signatureText; 17 | 18 | const SignaturePadOptions( 19 | {this.penColor = 'black', 20 | this.backgroundColor = 'rgba(0,0,0,0)', 21 | this.minWidth = 0.5, 22 | this.maxWidth = 2.5, 23 | this.throttle = 16, 24 | this.velocityFilterWeight = 0.7, 25 | this.dotSize, 26 | this.signatureText}); 27 | } 28 | 29 | abstract class SignaturePadBase { 30 | SignaturePadOptions opts; 31 | final List _data = []; 32 | 33 | List points = []; 34 | double _lastVelocity; 35 | double _lastWidth; 36 | bool isEmpty; 37 | 38 | String get penColor => opts.penColor; 39 | double get velocityFilterWeight => opts.velocityFilterWeight; 40 | double get minWidth => opts.minWidth; 41 | double get maxWidth => opts.maxWidth; 42 | Duration get throttleDuration => new Duration(milliseconds: opts.throttle); 43 | double get dotSize => opts.dotSize ?? minWidth + maxWidth / 2; 44 | 45 | void clear() { 46 | _data.clear(); 47 | reset(); 48 | isEmpty = true; 49 | } 50 | 51 | void on() {} 52 | 53 | void off() {} 54 | 55 | void strokeBegin(Point p) { 56 | reset(); 57 | strokeUpdate(p); 58 | } 59 | 60 | void strokeUpdate(Point p) { 61 | var point = createMark(p.x, p.y); 62 | var cw = _addMark(point); 63 | if (cw != null) { 64 | drawCurve(cw.curve, cw.widths.t1, cw.widths.t2); 65 | } 66 | } 67 | 68 | void strokeEnd() { 69 | var canDrawCurve = this.points.length > 2; 70 | var point = this.points[0]; 71 | if (!canDrawCurve && point != null) { 72 | drawDot(point); 73 | } 74 | } 75 | 76 | void reset() { 77 | points.clear(); 78 | _lastVelocity = 0.0; 79 | _lastWidth = (minWidth + maxWidth) / 2; 80 | } 81 | 82 | Mark createMark(double x, double y, [DateTime time]); 83 | 84 | _CurveWidth _addMark(Mark p) { 85 | points.add(p); 86 | if (points.length > 2) { 87 | // To reduce the initial lag make it work with 3 points 88 | // by copying the first point to the beginning. 89 | if (points.length == 3) { 90 | points.insert(0, points[0]); 91 | } 92 | var tmp = _calculateCurveControlPoints(points[0], points[1], points[2]); 93 | var c2 = tmp.t2; 94 | tmp = _calculateCurveControlPoints(points[1], points[2], points[3]); 95 | var c3 = tmp.t1; 96 | var curve = new Bezier(points[1], c2, c3, points[2]); 97 | var widths = _calculateCurveWidths(curve); 98 | 99 | // Remove the first element from the list, 100 | // so that we always have no more than 4 points in points array. 101 | points.removeAt(0); 102 | return new _CurveWidth(curve, widths); 103 | } 104 | return null; 105 | } 106 | 107 | _Tuple> _calculateCurveControlPoints( 108 | Mark s1, Mark s2, Mark s3) { 109 | var dx1 = s1.x - s2.x; 110 | var dy1 = s1.y - s2.y; 111 | var dx2 = s2.x - s3.x; 112 | var dy2 = s2.y - s3.y; 113 | 114 | assert(s1.x is double); 115 | assert(s1.y is double); 116 | assert(s2.x is double); 117 | assert(s2.y is double); 118 | if (s1.x is! double) { 119 | print('s1.x is not double'); 120 | } 121 | if (s1.y is! double) { 122 | print('s1.y is not double'); 123 | } 124 | if (s2.x is! double) { 125 | print('s2.x is not double'); 126 | } 127 | if (s2.y is! double) { 128 | print('s2.y is not double'); 129 | } 130 | var m1 = new Point((s1.x + s2.x) / 2.0, (s1.y + s2.y) / 2.0); 131 | var m2 = new Point((s2.x + s3.x) / 2.0, (s2.y + s3.y) / 2.0); 132 | 133 | var l1 = sqrt((dx1 * dx1) + (dy1 * dy1)); 134 | var l2 = sqrt((dx2 * dx2) + (dy2 * dy2)); 135 | 136 | var dxm = (m1.x - m2.x); 137 | var dym = (m1.y - m2.y); 138 | 139 | assert(l2 is double); 140 | var k = l2 / (l1 + l2); 141 | var cm = new Point(m2.x + (dxm * k), m2.y + (dym * k)); 142 | 143 | var tx = s2.x - cm.x; 144 | var ty = s2.y - cm.y; 145 | 146 | return new _Tuple>( 147 | new Point(m1.x + tx, m1.y + ty), new Point(m2.x + tx, m2.y + ty)); 148 | } 149 | 150 | _Tuple _calculateCurveWidths(Bezier curve) { 151 | var startPoint = curve.startPoint; 152 | var endPoint = curve.endPoint; 153 | 154 | var velocity = 155 | (this.velocityFilterWeight * endPoint.velocityFrom(startPoint)) + 156 | ((1 - this.velocityFilterWeight) * this._lastVelocity); 157 | 158 | var newWidth = this._strokeWidth(velocity); 159 | 160 | var widths = new _Tuple(_lastWidth, newWidth); 161 | 162 | this._lastVelocity = velocity; 163 | this._lastWidth = newWidth; 164 | 165 | return widths; 166 | } 167 | 168 | double _strokeWidth(double velocity) { 169 | return max(maxWidth / (velocity + 1.0), minWidth); 170 | } 171 | 172 | void drawPoint(double x, double y, double size); 173 | 174 | void drawCurve(Bezier curve, double startWidth, double endWidth) { 175 | if (startWidth.isNaN) { 176 | print('startWidth is NaN'); 177 | } 178 | var widthDelta = endWidth - startWidth; 179 | if (widthDelta.isNaN) { 180 | print('widthDelta is NaN'); 181 | } 182 | var drawSteps = curve.length(); 183 | for (var i = 0.0; i < drawSteps; i += 1) { 184 | // Calculate the Bezier (x, y) coordinate for this step. 185 | var t = i / drawSteps; 186 | var tt = t * t; 187 | var ttt = tt * t; 188 | var u = 1 - t; 189 | var uu = u * u; 190 | var uuu = uu * u; 191 | 192 | var x = uuu * curve.startPoint.x; 193 | x += 3 * uu * t * curve.control1.x; 194 | x += 3 * u * tt * curve.control2.x; 195 | x += ttt * curve.endPoint.x; 196 | 197 | var y = uuu * curve.startPoint.y; 198 | y += 3 * uu * t * curve.control1.y; 199 | y += 3 * u * tt * curve.control2.y; 200 | y += ttt * curve.endPoint.y; 201 | 202 | var width = startWidth + (ttt * widthDelta); 203 | if (ttt.isNaN) { 204 | print('ttt is NaN'); 205 | } 206 | if (width.isNaN) { 207 | print('width is NaN'); 208 | } 209 | this.drawPoint(x, y, width); 210 | } 211 | } 212 | 213 | void drawDot(Mark point) { 214 | var width = this.dotSize; 215 | this.drawPoint(point.x, point.y, width); 216 | } 217 | 218 | String toDataUrl([String type = 'image/png']); 219 | } 220 | 221 | class _Tuple { 222 | final T t1; 223 | final T t2; 224 | _Tuple(this.t1, this.t2); 225 | } 226 | 227 | class _CurveWidth { 228 | final Bezier curve; 229 | final _Tuple widths; 230 | _CurveWidth(this.curve, this.widths); 231 | } 232 | -------------------------------------------------------------------------------- /lib/signature_pad_html.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:html'; 3 | import 'dart:math'; 4 | import 'package:stream_transform/stream_transform.dart'; 5 | import 'package:signature_pad/bezier.dart'; 6 | import 'package:signature_pad/mark.dart'; 7 | import 'package:signature_pad/signature_pad.dart'; 8 | 9 | class SignaturePadHtml extends SignaturePadBase { 10 | final CanvasElement canvas; 11 | CanvasRenderingContext2D context; 12 | 13 | bool _mouseButtonDown; 14 | List _subscriptions = []; 15 | 16 | SignaturePadHtml(this.canvas, 17 | [SignaturePadOptions opts = const SignaturePadOptions()]) { 18 | this.opts = opts; 19 | context = canvas.getContext('2d'); 20 | _mouseButtonDown = false; 21 | clear(); 22 | on(); 23 | } 24 | 25 | void clear() { 26 | context.fillStyle = opts.backgroundColor; 27 | context.clearRect(0, 0, canvas.width, canvas.height); 28 | context.fillRect(0, 0, canvas.width, canvas.height); 29 | super.clear(); 30 | } 31 | 32 | void on() { 33 | this._handleMouseEvents(); 34 | this._handleTouchEvents(); 35 | } 36 | 37 | void off() { 38 | _subscriptions.forEach((s) => s.cancel()); 39 | } 40 | 41 | void _handleMouseEvents() { 42 | _mouseButtonDown = false; 43 | 44 | _subscriptions.addAll([ 45 | canvas.onMouseDown.listen(handleMouseDown), 46 | canvas.onMouseMove 47 | .transform(throttle(this.throttleDuration)) 48 | .listen(handleMouseMove), 49 | canvas.onMouseUp.listen(handleMouseUp), 50 | ]); 51 | } 52 | 53 | void _handleTouchEvents() { 54 | canvas.style.touchAction = 'none'; 55 | canvas.style.setProperty('msTouchAction', 'none'); 56 | 57 | _subscriptions.addAll([ 58 | canvas.onTouchStart.listen(handleTouchStart), 59 | canvas.onTouchMove 60 | .transform(throttle(this.throttleDuration)) 61 | .listen(handleTouchMove), 62 | canvas.onTouchEnd.listen(handleTouchEnd), 63 | ]); 64 | } 65 | 66 | void handleMouseDown(MouseEvent e) { 67 | _mouseButtonDown = true; 68 | strokeBegin(doublePoint(e.client)); 69 | } 70 | 71 | void handleMouseMove(MouseEvent e) { 72 | if (_mouseButtonDown) { 73 | strokeUpdate(doublePoint(e.client)); 74 | } 75 | } 76 | 77 | void handleMouseUp(MouseEvent e) { 78 | _mouseButtonDown = false; 79 | strokeEnd(); 80 | } 81 | 82 | void handleTouchStart(TouchEvent e) { 83 | var touch = e.changedTouches[0]; 84 | e.preventDefault(); 85 | strokeBegin(doublePoint(touch.client)); 86 | } 87 | 88 | void handleTouchMove(TouchEvent e) { 89 | var touch = e.changedTouches[0]; 90 | e.preventDefault(); 91 | strokeUpdate(doublePoint(touch.client)); 92 | } 93 | 94 | void handleTouchEnd(TouchEvent e) { 95 | var wasCanvasTouched = e.target == canvas; 96 | if (wasCanvasTouched) { 97 | e.preventDefault(); 98 | strokeEnd(); 99 | } 100 | } 101 | 102 | void reset() { 103 | super.reset(); 104 | context.fillStyle = penColor; 105 | } 106 | 107 | Mark createMark(double x, double y, [DateTime time]) { 108 | var rect = canvas.getBoundingClientRect(); 109 | return new Mark(x - rect.left, y - rect.top, time ?? new DateTime.now()); 110 | } 111 | 112 | String toDataUrl([String type = 'image/png']) { 113 | return canvas.toDataUrl(type); 114 | } 115 | 116 | void drawPoint(double x, double y, double size) { 117 | context.moveTo(x, y); 118 | context.arc(x, y, size, 0, 2 * pi); 119 | isEmpty = false; 120 | } 121 | 122 | void drawCurve(Bezier curve, double startWidth, double endWidth) { 123 | var ctx = context; 124 | ctx.beginPath(); 125 | 126 | super.drawCurve(curve, startWidth, endWidth); 127 | 128 | ctx.closePath(); 129 | ctx.fill(); 130 | } 131 | 132 | void drawDot(Mark point) { 133 | var ctx = this.context; 134 | 135 | ctx.beginPath(); 136 | 137 | super.drawDot(point); 138 | 139 | ctx.closePath(); 140 | ctx.fill(); 141 | } 142 | } 143 | 144 | Point doublePoint(Point p) { 145 | return new Point(p.x + 0.0, p.y + 0.0); 146 | } 147 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: signature_pad 2 | author: John Ryan 3 | description: A flutter and HTML 5 canvas signature library 4 | version: 2.1.1 5 | homepage: https://github.com/johnpryan/signature-pad-dart 6 | dependencies: 7 | stream_transform: ^0.0.9 8 | dev_dependencies: 9 | build_runner: any 10 | build_web_compilers: any 11 | environment: 12 | sdk: '>=1.24.3 <3.0.0' 13 | -------------------------------------------------------------------------------- /signature_pad_flutter/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | packages 7 | pubspec.lock 8 | -------------------------------------------------------------------------------- /signature_pad_flutter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.0] - 7/5/2018. 2 | 3 | * Dart 2 support 4 | * API support for flutter 5 | -------------------------------------------------------------------------------- /signature_pad_flutter/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /signature_pad_flutter/README.md: -------------------------------------------------------------------------------- 1 | # signature_pad_flutter 2 | 3 | Flutter package for signature_pad 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online [documentation](http://flutter.io/). 8 | 9 | For help on editing package code, view the [documentation](https://flutter.io/developing-packages/). 10 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .atom/ 3 | .idea 4 | .packages 5 | .pub/ 6 | build/ 7 | ios/.generated/ 8 | packages 9 | pubspec.lock 10 | .flutter-plugins 11 | -------------------------------------------------------------------------------- /signature_pad_flutter/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: 8f65fec5f5f7d7afbb0965f4a44bdb330a28fb19 8 | channel: alpha 9 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | signature_pad example 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](http://flutter.io/). 9 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | GeneratedPluginRegistrant.java 10 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withInputStream { stream -> 5 | localProperties.load(stream) 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 | apply plugin: 'com.android.application' 15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 16 | 17 | android { 18 | compileSdkVersion 25 19 | buildToolsVersion '25.0.3' 20 | 21 | lintOptions { 22 | disable 'InvalidPackage' 23 | } 24 | 25 | defaultConfig { 26 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 27 | applicationId "com.yourcompany.example" 28 | minSdkVersion 16 29 | targetSdkVersion 25 30 | versionCode 1 31 | versionName "1.0" 32 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 33 | } 34 | 35 | buildTypes { 36 | release { 37 | // TODO: Add your own signing config for the release build. 38 | // Signing with the debug keys for now, so `flutter run --release` works. 39 | signingConfig signingConfigs.debug 40 | } 41 | } 42 | } 43 | 44 | flutter { 45 | source '../..' 46 | } 47 | 48 | dependencies { 49 | androidTestCompile 'com.android.support:support-annotations:25.4.0' 50 | androidTestCompile 'com.android.support.test:runner:0.5' 51 | androidTestCompile 'com.android.support.test:rules:0.5' 52 | } 53 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 15 | 19 | 26 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/java/com/yourcompany/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.yourcompany.example; 2 | 3 | import android.os.Bundle; 4 | 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | GeneratedPluginRegistrant.registerWith(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | maven { 5 | url "https://maven.google.com" 6 | } 7 | } 8 | 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:2.3.3' 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | jcenter() 17 | maven { 18 | url "https://maven.google.com" 19 | } 20 | } 21 | } 22 | 23 | rootProject.buildDir = '../build' 24 | subprojects { 25 | project.buildDir = "${rootProject.buildDir}/${project.name}" 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /signature_pad_flutter/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-3.3-all.zip 7 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/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.withInputStream { stream -> plugins.load(stream) } 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 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | *.pbxuser 16 | *.mode1v3 17 | *.mode2v3 18 | *.perspectivev3 19 | 20 | !default.pbxuser 21 | !default.mode1v3 22 | !default.mode2v3 23 | !default.perspectivev3 24 | 25 | xcuserdata 26 | 27 | *.moved-aside 28 | 29 | *.pyc 30 | *sync/ 31 | Icon? 32 | .tags* 33 | 34 | /Flutter/app.flx 35 | /Flutter/app.zip 36 | /Flutter/App.framework 37 | /Flutter/Flutter.framework 38 | /Flutter/Generated.xcconfig 39 | /ServiceDefinitions.json 40 | 41 | Pods/ 42 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | UIRequiredDeviceCapabilities 24 | 25 | arm64 26 | 27 | MinimumOSVersion 28 | 8.0 29 | 30 | 31 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 18 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 19 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 20 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 21 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 22 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 23 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 2147483647; 30 | dstPath = ""; 31 | dstSubfolderSpec = 10; 32 | files = ( 33 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 34 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 35 | ); 36 | name = "Embed Frameworks"; 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXCopyFilesBuildPhase section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 43 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 45 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 46 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 47 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 48 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 49 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 50 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 51 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 52 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 53 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 56 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 57 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 58 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59 | /* End PBXFileReference section */ 60 | 61 | /* Begin PBXFrameworksBuildPhase section */ 62 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 67 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | /* End PBXFrameworksBuildPhase section */ 72 | 73 | /* Begin PBXGroup section */ 74 | 9740EEB11CF90186004384FC /* Flutter */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 3B80C3931E831B6300D905FE /* App.framework */, 78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 79 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 80 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 81 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 82 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 83 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 84 | ); 85 | name = Flutter; 86 | sourceTree = ""; 87 | }; 88 | 97C146E51CF9000F007C117D = { 89 | isa = PBXGroup; 90 | children = ( 91 | 9740EEB11CF90186004384FC /* Flutter */, 92 | 97C146F01CF9000F007C117D /* Runner */, 93 | 97C146EF1CF9000F007C117D /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 97C146EF1CF9000F007C117D /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 97C146EE1CF9000F007C117D /* Runner.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 97C146F01CF9000F007C117D /* Runner */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 109 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 110 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 113 | 97C147021CF9000F007C117D /* Info.plist */, 114 | 97C146F11CF9000F007C117D /* Supporting Files */, 115 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 116 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 117 | ); 118 | path = Runner; 119 | sourceTree = ""; 120 | }; 121 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 97C146F21CF9000F007C117D /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | 97C146ED1CF9000F007C117D /* Runner */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 135 | buildPhases = ( 136 | 9740EEB61CF901F6004384FC /* Run Script */, 137 | 97C146EA1CF9000F007C117D /* Sources */, 138 | 97C146EB1CF9000F007C117D /* Frameworks */, 139 | 97C146EC1CF9000F007C117D /* Resources */, 140 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 0910; 159 | ORGANIZATIONNAME = "The Chromium Authors"; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | DevelopmentTeam = 36QNC2BPVK; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */, 192 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 193 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 194 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 195 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 196 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 197 | ); 198 | runOnlyForDeploymentPostprocessing = 0; 199 | }; 200 | /* End PBXResourcesBuildPhase section */ 201 | 202 | /* Begin PBXShellScriptBuildPhase section */ 203 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 204 | isa = PBXShellScriptBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | inputPaths = ( 209 | ); 210 | name = "Thin Binary"; 211 | outputPaths = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | shellPath = /bin/sh; 215 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 216 | }; 217 | 9740EEB61CF901F6004384FC /* Run Script */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | name = "Run Script"; 225 | outputPaths = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 230 | }; 231 | /* End PBXShellScriptBuildPhase section */ 232 | 233 | /* Begin PBXSourcesBuildPhase section */ 234 | 97C146EA1CF9000F007C117D /* Sources */ = { 235 | isa = PBXSourcesBuildPhase; 236 | buildActionMask = 2147483647; 237 | files = ( 238 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 239 | 97C146F31CF9000F007C117D /* main.m in Sources */, 240 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | /* End PBXSourcesBuildPhase section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 97C146FB1CF9000F007C117D /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 97C147001CF9000F007C117D /* Base */, 259 | ); 260 | name = LaunchScreen.storyboard; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 97C147031CF9000F007C117D /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 269 | buildSettings = { 270 | ALWAYS_SEARCH_USER_PATHS = NO; 271 | CLANG_ANALYZER_NONNULL = YES; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_COMMA = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 281 | CLANG_WARN_EMPTY_BODY = YES; 282 | CLANG_WARN_ENUM_CONVERSION = YES; 283 | CLANG_WARN_INFINITE_RECURSION = YES; 284 | CLANG_WARN_INT_CONVERSION = YES; 285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 286 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 287 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 288 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 289 | CLANG_WARN_STRICT_PROTOTYPES = YES; 290 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 291 | CLANG_WARN_UNREACHABLE_CODE = YES; 292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 293 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 294 | COPY_PHASE_STRIP = NO; 295 | DEBUG_INFORMATION_FORMAT = dwarf; 296 | ENABLE_STRICT_OBJC_MSGSEND = YES; 297 | ENABLE_TESTABILITY = YES; 298 | GCC_C_LANGUAGE_STANDARD = gnu99; 299 | GCC_DYNAMIC_NO_PIC = NO; 300 | GCC_NO_COMMON_BLOCKS = YES; 301 | GCC_OPTIMIZATION_LEVEL = 0; 302 | GCC_PREPROCESSOR_DEFINITIONS = ( 303 | "DEBUG=1", 304 | "$(inherited)", 305 | ); 306 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 307 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 308 | GCC_WARN_UNDECLARED_SELECTOR = YES; 309 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 310 | GCC_WARN_UNUSED_FUNCTION = YES; 311 | GCC_WARN_UNUSED_VARIABLE = YES; 312 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 313 | MTL_ENABLE_DEBUG_INFO = YES; 314 | ONLY_ACTIVE_ARCH = YES; 315 | SDKROOT = iphoneos; 316 | TARGETED_DEVICE_FAMILY = "1,2"; 317 | }; 318 | name = Debug; 319 | }; 320 | 97C147041CF9000F007C117D /* Release */ = { 321 | isa = XCBuildConfiguration; 322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 323 | buildSettings = { 324 | ALWAYS_SEARCH_USER_PATHS = NO; 325 | CLANG_ANALYZER_NONNULL = YES; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 327 | CLANG_CXX_LIBRARY = "libc++"; 328 | CLANG_ENABLE_MODULES = YES; 329 | CLANG_ENABLE_OBJC_ARC = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INFINITE_RECURSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 350 | ENABLE_NS_ASSERTIONS = NO; 351 | ENABLE_STRICT_OBJC_MSGSEND = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_NO_COMMON_BLOCKS = YES; 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 361 | MTL_ENABLE_DEBUG_INFO = NO; 362 | SDKROOT = iphoneos; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | VALIDATE_PRODUCT = YES; 365 | }; 366 | name = Release; 367 | }; 368 | 97C147061CF9000F007C117D /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 371 | buildSettings = { 372 | ARCHS = arm64; 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | DEVELOPMENT_TEAM = 36QNC2BPVK; 375 | ENABLE_BITCODE = NO; 376 | FRAMEWORK_SEARCH_PATHS = ( 377 | "$(inherited)", 378 | "$(PROJECT_DIR)/Flutter", 379 | ); 380 | INFOPLIST_FILE = Runner/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 382 | LIBRARY_SEARCH_PATHS = ( 383 | "$(inherited)", 384 | "$(PROJECT_DIR)/Flutter", 385 | ); 386 | PRODUCT_BUNDLE_IDENTIFIER = com.johnpryan; 387 | PRODUCT_NAME = "$(TARGET_NAME)"; 388 | }; 389 | name = Debug; 390 | }; 391 | 97C147071CF9000F007C117D /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 394 | buildSettings = { 395 | ARCHS = arm64; 396 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 397 | DEVELOPMENT_TEAM = 36QNC2BPVK; 398 | ENABLE_BITCODE = NO; 399 | FRAMEWORK_SEARCH_PATHS = ( 400 | "$(inherited)", 401 | "$(PROJECT_DIR)/Flutter", 402 | ); 403 | INFOPLIST_FILE = Runner/Info.plist; 404 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 405 | LIBRARY_SEARCH_PATHS = ( 406 | "$(inherited)", 407 | "$(PROJECT_DIR)/Flutter", 408 | ); 409 | PRODUCT_BUNDLE_IDENTIFIER = com.johnpryan; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | }; 412 | name = Release; 413 | }; 414 | /* End XCBuildConfiguration section */ 415 | 416 | /* Begin XCConfigurationList section */ 417 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 418 | isa = XCConfigurationList; 419 | buildConfigurations = ( 420 | 97C147031CF9000F007C117D /* Debug */, 421 | 97C147041CF9000F007C117D /* Release */, 422 | ); 423 | defaultConfigurationIsVisible = 0; 424 | defaultConfigurationName = Release; 425 | }; 426 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | 97C147061CF9000F007C117D /* Debug */, 430 | 97C147071CF9000F007C117D /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | defaultConfigurationName = Release; 434 | }; 435 | /* End XCConfigurationList section */ 436 | }; 437 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 438 | } 439 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 7 | [GeneratedPluginRegistrant registerWithRegistry:self]; 8 | // Override point for customization after application launch. 9 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 10 | } 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apptreesoftware/signature-pad-dart/253d5052a1010281cd4327997b7b8e779c272d89/signature_pad_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /signature_pad_flutter/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. -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | -------------------------------------------------------------------------------- /signature_pad_flutter/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 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | arm64 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:signature_pad/signature_pad.dart'; 5 | import 'package:signature_pad_flutter/signature_pad_flutter.dart'; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | class MyApp extends StatelessWidget { 10 | Widget build(BuildContext context) { 11 | return new MaterialApp( 12 | home: new Scaffold( 13 | body: new Container( 14 | color: Colors.grey[300], 15 | child: new SafeArea( 16 | child: Padding( 17 | padding: const EdgeInsets.all(8.0), 18 | child: new SignaturePadExample(), 19 | ), 20 | ), 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class SignaturePadExample extends StatefulWidget { 28 | State createState() { 29 | return new SignaturePadExampleState(); 30 | } 31 | } 32 | 33 | class SignaturePadExampleState extends State { 34 | SignaturePadController _padController; 35 | 36 | void initState() { 37 | super.initState(); 38 | _padController = new SignaturePadController(); 39 | } 40 | 41 | Widget build(BuildContext context) { 42 | var signaturePad = new SignaturePadWidget( 43 | _padController, 44 | new SignaturePadOptions( 45 | dotSize: 5.0, 46 | minWidth: 1.0, 47 | maxWidth: 4.0, 48 | penColor: "#000000", 49 | signatureText: "Signed by Ringo Starr on Jan 1, 1962"), 50 | ); 51 | return new Container( 52 | child: new Column( 53 | mainAxisAlignment: MainAxisAlignment.center, 54 | children: [ 55 | new Row( 56 | mainAxisAlignment: MainAxisAlignment.center, 57 | children: [ 58 | new Expanded( 59 | child: new Container( 60 | height: 200.0, 61 | child: new Center( 62 | child: new AspectRatio( 63 | aspectRatio: 3.0 / 1.0, 64 | child: new Container( 65 | decoration: new BoxDecoration( 66 | color: Colors.white, 67 | border: new Border.all(), 68 | ), 69 | child: signaturePad, 70 | ), 71 | ), 72 | ), 73 | ), 74 | ), 75 | ], 76 | ), 77 | Padding( 78 | padding: const EdgeInsets.only(top: 8.0), 79 | child: new Row( 80 | mainAxisAlignment: MainAxisAlignment.spaceAround, 81 | children: [ 82 | new RaisedButton( 83 | onPressed: _handleClear, 84 | child: new Text("Clear"), 85 | color: Colors.white, 86 | textColor: Colors.black, 87 | ), 88 | new RaisedButton( 89 | onPressed: _handleSavePng, 90 | child: new Text("Save as PNG"), 91 | color: Colors.white, 92 | textColor: Colors.black, 93 | ), 94 | ], 95 | ), 96 | ), 97 | ], 98 | ), 99 | ); 100 | } 101 | 102 | void _handleClear() { 103 | _padController.clear(); 104 | } 105 | 106 | Future _handleSavePng() async { 107 | var result = await _padController.toPng(); 108 | Navigator.of(context).push( 109 | new MaterialPageRoute( 110 | builder: (BuildContext context) { 111 | return new Scaffold( 112 | appBar: new AppBar( 113 | backgroundColor: Colors.grey[700], 114 | ), 115 | backgroundColor: Colors.grey[300], 116 | body: new Center( 117 | child: new Container( 118 | decoration: new BoxDecoration( 119 | border: new Border.all(), 120 | color: Colors.white, 121 | ), 122 | padding: new EdgeInsets.all(4.0), 123 | margin: new EdgeInsets.all(4.0), 124 | child: new Image.memory(result), 125 | ), 126 | ), 127 | ); 128 | }, 129 | fullscreenDialog: true, 130 | ), 131 | ); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /signature_pad_flutter/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: signature_pad example 3 | dependencies: 4 | flutter: 5 | sdk: flutter 6 | signature_pad_flutter: 7 | path: ../ 8 | cupertino_icons: ^0.1.0 9 | dev_dependencies: 10 | flutter_test: 11 | sdk: flutter 12 | flutter: 13 | uses-material-design: true 14 | -------------------------------------------------------------------------------- /signature_pad_flutter/lib/signature_pad_flutter.dart: -------------------------------------------------------------------------------- 1 | library signature_pad_flutter; 2 | 3 | import 'dart:async'; 4 | import 'dart:math'; 5 | import 'dart:ui'; 6 | 7 | import 'package:flutter/material.dart'; 8 | import 'package:signature_pad/mark.dart'; 9 | import 'package:signature_pad/signature_pad.dart'; 10 | import 'package:signature_pad_flutter/src/painter.dart'; 11 | import 'package:signature_pad_flutter/src/point.dart'; 12 | 13 | class SignaturePadController { 14 | _SignaturePadDelegate _delegate; 15 | void clear() => _delegate?.clear(); 16 | Future> toPng() => _delegate?.getPng(); 17 | bool get hasSignature => _delegate.hasSignature; 18 | } 19 | 20 | abstract class _SignaturePadDelegate { 21 | void clear(); 22 | Future> getPng(); 23 | bool get hasSignature; 24 | } 25 | 26 | class SignaturePadWidget extends StatefulWidget { 27 | final SignaturePadOptions opts; 28 | final SignaturePadController controller; 29 | SignaturePadWidget(this.controller, this.opts); 30 | 31 | State createState() { 32 | return new SignaturePadState(controller, opts); 33 | } 34 | } 35 | 36 | class SignaturePadState extends State 37 | with SignaturePadBase 38 | implements _SignaturePadDelegate { 39 | SignaturePadController _controller; 40 | List allPoints = []; 41 | 42 | SignaturePadState(this._controller, SignaturePadOptions opts) { 43 | this.opts = opts; 44 | clear(); 45 | on(); 46 | } 47 | 48 | SignaturePadPainter _currentPainter; 49 | 50 | StreamController _updateSink = 51 | new StreamController.broadcast(); 52 | Stream get _updates => _updateSink.stream; 53 | 54 | void initState() { 55 | super.initState(); 56 | _controller._delegate = this; 57 | 58 | _updates.listen(handleDragUpdate); 59 | } 60 | 61 | Widget build(BuildContext context) { 62 | _currentPainter = new SignaturePadPainter(allPoints, opts); 63 | return new ClipRect( 64 | child: new CustomPaint( 65 | painter: _currentPainter, 66 | child: new GestureDetector( 67 | onTapDown: handleTap, 68 | onHorizontalDragUpdate: (d) => _updateSink.add(d), 69 | onVerticalDragUpdate: (d) => _updateSink.add(d), 70 | onHorizontalDragEnd: handleDragEnd, 71 | onVerticalDragEnd: handleDragEnd, 72 | onHorizontalDragStart: handleDragStart, 73 | onVerticalDragStart: handleDragStart, 74 | behavior: HitTestBehavior.opaque, 75 | ), 76 | ), 77 | ); 78 | } 79 | 80 | void handleTap(TapDownDetails details) { 81 | var x = details.globalPosition.dx; 82 | var y = details.globalPosition.dy; 83 | var offs = new Offset(x, y); 84 | RenderBox refBox = context.findRenderObject(); 85 | offs = refBox.globalToLocal(offs); 86 | strokeBegin(new Point(offs.dx, offs.dy)); 87 | strokeEnd(); 88 | } 89 | 90 | void handleDragUpdate(DragUpdateDetails details) { 91 | var x = details.globalPosition.dx; 92 | var y = details.globalPosition.dy; 93 | var offs = new Offset(x, y); 94 | RenderBox refBox = context.findRenderObject(); 95 | offs = refBox.globalToLocal(offs); 96 | strokeUpdate(new Point(offs.dx, offs.dy)); 97 | } 98 | 99 | void handleDragEnd(DragEndDetails details) { 100 | strokeEnd(); 101 | } 102 | 103 | void handleDragStart(DragStartDetails details) { 104 | var x = details.globalPosition.dx; 105 | var y = details.globalPosition.dy; 106 | var offs = new Offset(x, y); 107 | RenderBox refBox = context.findRenderObject(); 108 | offs = refBox.globalToLocal(offs); 109 | strokeBegin(new Point(offs.dx, offs.dy)); 110 | } 111 | 112 | Mark createMark(double x, double y, [DateTime time]) { 113 | return new Mark(x, y, time ?? new DateTime.now()); 114 | } 115 | 116 | void drawPoint(double x, double y, num size) { 117 | if (!_inBounds(x, y)) { 118 | return; 119 | } 120 | var point = new Point(x, y); 121 | setState(() { 122 | allPoints.add(new SPPoint(point, size)); 123 | }); 124 | } 125 | 126 | String toDataUrl([String type = 'image/png']) { 127 | return null; 128 | } 129 | 130 | void clear() { 131 | super.clear(); 132 | if (mounted) { 133 | setState(() { 134 | allPoints = []; 135 | }); 136 | } 137 | } 138 | 139 | Future> getPng() { 140 | return _currentPainter.getPng(); 141 | } 142 | 143 | bool get hasSignature => _currentPainter.allPoints.isNotEmpty; 144 | 145 | bool _inBounds(double x, double y) { 146 | var size = this._currentPainter.lastSize; 147 | return x >= 0 && x < size.width && y >= 0 && y < size.height; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /signature_pad_flutter/lib/src/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/rendering.dart'; 2 | 3 | Color colorFromColorString(String s) => 4 | new _ColorFormatter()._convertColorFromHex(s); 5 | 6 | class _ColorFormatter { 7 | Color _convertColorFromHex(String hexVal) { 8 | String r = (int.parse(hexVal.substring(1, 3), radix: 16)).toRadixString(10); 9 | String g = (int.parse(hexVal.substring(3, 5), radix: 16)).toRadixString(10); 10 | String b = (int.parse(hexVal.substring(5), radix: 16)).toRadixString(10); 11 | 12 | return new Color.fromRGBO(int.parse(r), int.parse(g), int.parse(b), 1.0); 13 | } 14 | 15 | Color flutterColor(String hexColor) { 16 | return _convertColorFromHex(hexColor); 17 | } 18 | } -------------------------------------------------------------------------------- /signature_pad_flutter/lib/src/painter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:ui' as ui; 3 | import 'dart:typed_data'; 4 | 5 | import 'package:flutter/widgets.dart' hide TextStyle; 6 | import 'package:signature_pad/signature_pad.dart'; 7 | import 'package:signature_pad_flutter/src/colors.dart'; 8 | import 'package:signature_pad_flutter/src/point.dart'; 9 | 10 | class SignaturePadPainter extends CustomPainter { 11 | final List allPoints; 12 | final SignaturePadOptions opts; 13 | Size lastSize; 14 | 15 | SignaturePadPainter(this.allPoints, this.opts); 16 | 17 | Future getPng() async { 18 | if (lastSize == null) { 19 | return null; 20 | } 21 | var recorder = new ui.PictureRecorder(); 22 | var origin = new Offset(0.0, 0.0); 23 | var paintBounds = new Rect.fromPoints( 24 | lastSize.topLeft(origin), lastSize.bottomRight(origin)); 25 | var canvas = new Canvas(recorder, paintBounds); 26 | 27 | _paintPoints(canvas, lastSize, 0); 28 | 29 | // Add grey text in the bottom-right corner 30 | if (opts.signatureText != null) { 31 | var paragraphBuilder = new ui.ParagraphBuilder( 32 | new ui.ParagraphStyle( 33 | textDirection: ui.TextDirection.ltr, 34 | ), 35 | ); 36 | var style = 37 | new ui.TextStyle(color: new Color.fromRGBO(100, 100, 100, 1.0)); 38 | paragraphBuilder.pushStyle(style); 39 | paragraphBuilder.addText(opts.signatureText); 40 | paragraphBuilder.pop(); 41 | var paragraph = paragraphBuilder.build(); 42 | paragraph.layout(new ui.ParagraphConstraints(width: lastSize.width)); 43 | canvas.drawParagraph( 44 | paragraph, 45 | new Offset( 46 | lastSize.width - paragraph.maxIntrinsicWidth, 47 | lastSize.height - paragraph.height, 48 | ), 49 | ); 50 | } 51 | 52 | var picture = recorder.endRecording(); 53 | var image = await 54 | picture.toImage(lastSize.width.round(), lastSize.height.round()); 55 | ByteData data = await image.toByteData(format: ui.ImageByteFormat.png); 56 | return data.buffer.asUint8List(); 57 | } 58 | 59 | void paint(Canvas canvas, Size size) { 60 | lastSize = size; 61 | _paintPoints(canvas, size, 0); 62 | } 63 | 64 | void _paintPoints(Canvas canvas, Size size, int startIdx) { 65 | for (var i = startIdx; i < allPoints.length; i++) { 66 | var point = this.allPoints[i]; 67 | var paint = new Paint()..color = colorFromColorString(opts.penColor); 68 | paint.strokeWidth = 5.0; 69 | var path = new Path(); 70 | var offset = new Offset(point.point.x, point.point.y); 71 | path.moveTo(point.point.x, point.point.y); 72 | var pointSize = point.size; 73 | if (pointSize == null || pointSize.isNaN) { 74 | pointSize = opts.dotSize; 75 | } 76 | 77 | canvas.drawCircle(offset, pointSize, paint); 78 | 79 | paint.style = PaintingStyle.stroke; 80 | canvas.drawPath(path, paint); 81 | } 82 | } 83 | 84 | bool shouldRepaint(SignaturePadPainter oldDelegate) { 85 | return true; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /signature_pad_flutter/lib/src/point.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | class SPPoint { 4 | final Point point; 5 | final double size; 6 | SPPoint(this.point, this.size); 7 | String toString() => "SPPoint $point $size"; 8 | } -------------------------------------------------------------------------------- /signature_pad_flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: signature_pad_flutter 2 | description: Flutter package for signature_pad 3 | version: 1.2.0 4 | author: John Ryan 5 | homepage: https://github.com/johnpryan/signature-pad-dart 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | signature_pad: ^2.0.0 11 | stream_transform: ^0.0.9 12 | 13 | dev_dependencies: 14 | test: ^1.3.0 15 | 16 | environment: 17 | sdk: '>=2.0.0 <3.0.0' 18 | 19 | flutter: 20 | --------------------------------------------------------------------------------