Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nateshmbhat committed Aug 26, 2020
1 parent d963808 commit ac09581
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### [0.2.0] - Aug 26 2020
Fixed minor bugs. Updated readme.

#### [0.1.7] - July 17 2020
Fixed a minor bug : #6

Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@



#### `touchable` library gives you the ability to add various **gestures** to each **Shape** you draw on your canvas in the CustomPainter
#### `touchable` library gives you the ability to add various **gestures** and animations to each **Shape** you draw on your canvas in the CustomPainter
<br />

<p align="center">
Expand All @@ -41,16 +41,18 @@
## Why Use **Touchable** ?
- The CustomPainter lets you **only draw** shapes on the canvas. But most would want to let user interact with the drawings.

- With touchable , you get what the normal canvas always missed : **touchability** 😉
- With this , its possible to add all kinds of **gesture callbacks to each drawing** and thus interaction capability to each Shape you draw on the canvas.
- Animating individual shapes becomes so much easier than ever before.
- Handles the painting style (`filled ▮` , `stroke ▯`) and detects touch accordingly.
- Takes the painting **stroke width** also into account. So if your shapes are painted thick , we still got it covered ✓
- Supports **clipping** and different **clipping modes**. So, You can have any kind of complex clipping and drawing combinations while getting full interactive capability.
- Add all kinds of **gesture callbacks to each drawing** to give interaction capability to the shapes you draw on the canvas.
- Animating individual shapes has never been this easy.
- Auto Handles the painting style (`filled ▮` , `stroke ▯`) and detects touch accordingly.
- Handles Painting **stroke width**. So if your shapes are painted thick , we still got it covered ✓
- Supports **clipping** and different **clipping modes** for the drawings.
- Supports HitTestBehavior for each shape.
- Simple and Easy API. Just wrap your `CustomPaint` with `CanvasTouchDetector` and use the `TouchyCanvas` in your painter.


> With touchable , you get what the normal canvas always missed : **touchability** 😉

## Installation
Add the `touchable` package as dependency in your `pubspec.yaml`
```dart
Expand Down Expand Up @@ -83,7 +85,7 @@ myCanvas.drawRect( rect , Paint() , onTapDown: (tapDetail){
});
```

### MyPainter example :
### **MyPainter example :**

```dart
class MyPainter extends CustomPainter {
Expand Down Expand Up @@ -121,7 +123,7 @@ class MyPainter extends CustomPainter {
<br />

## How Touchable Works :
When you draw shapes on the canvas (`TouchyCanvas`) , it keeps track of the dimensions of each shape you draw and their painting style , stroke etc.
When you draw shapes on the canvas (`TouchyCanvas`) , it keeps track of the dimensions of each shape you draw and their painting style , stroke , order , clippings etc.

When user performs any gesture on the screen , based on the location of the gesture , the appropriate shape is selected from the lot taking clipping regions , paint , hitTest behaviour etc into account in an optimized way. Callbacks of the corresponding shapes (one or more depending on the hitTest behavior) are executed.

Expand All @@ -147,7 +149,7 @@ When user performs any gesture on the screen , based on the location of the gest
- [x] Stroke Width
- [ ] Stroke Cap
- [x] StrokeCap to draw Points
- [ ] `StrokeCap.round` for lines with large width
- [ ] `StrokeCap.round` for lines with huge width.
- [x] Support Clipping and clipping modes
- [x] ClipRect
- [x] intersect mode [Touch detection enabled only inside the clipped region]
Expand Down
38 changes: 19 additions & 19 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,49 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.5.0-nullsafety"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0-nullsafety.2"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
version: "1.2.0-nullsafety"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0-nullsafety"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.13"
version: "1.15.0-nullsafety.2"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.0-nullsafety"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -66,21 +66,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.8"
version: "0.12.10-nullsafety"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety.2"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -92,55 +92,55 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.10.0-nullsafety"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.17"
version: "0.2.19-nullsafety"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0-nullsafety.2"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety.2"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.10.0-0.0.dev <2.10.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: touchable
description: Flutter library to add various gesture callbacks to each Shape you draw on your canvas in your CustomPainter
version: 0.1.8
version: 0.2.0
repository: https://github.com/nateshmbhat/touchable
homepage: https://github.com/nateshmbhat/touchable

Expand Down

0 comments on commit ac09581

Please sign in to comment.