Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A Flutter plugin enabling the user to detect edges of a given image. It returns
## Demo

<p align="center">
<img src="https://www.flutterclutter.dev/wp-content/uploads/2020/09/flutter-edge-detection-animation.gif" height=600>
<img src="https://www.flutterclutter.dev/wp-content/uploads/2020/09/flutter-edge-detection-drag-animation.gif" height=600>
</p>

## Try out
Expand Down
149 changes: 0 additions & 149 deletions example/lib/edge_detection_preview.dart

This file was deleted.

85 changes: 85 additions & 0 deletions example/lib/edge_detection_shape/animated_touch_bubble_part.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import 'package:flutter/material.dart';

class AnimatedTouchBubblePart extends StatefulWidget {
AnimatedTouchBubblePart({this.dragging, this.size});

final bool dragging;
final double size;

@override
_AnimatedTouchBubblePartState createState() => _AnimatedTouchBubblePartState();
}

class _AnimatedTouchBubblePartState extends State<AnimatedTouchBubblePart> with SingleTickerProviderStateMixin {
AnimationController _controller;
Animation<Color> _colorAnimation;
Animation<double> _sizeAnimation;

@override
void didChangeDependencies() {
_controller = new AnimationController(
duration: const Duration(milliseconds: 1000),
vsync: this,
);

_sizeAnimation = Tween<double>(
begin: 0.5,
end: 1.0
).animate(_controller);

_colorAnimation = ColorTween(
begin: Theme.of(context).accentColor.withOpacity(0.5),
end: Theme.of(context).accentColor.withOpacity(0.0)
).animate(
CurvedAnimation(
parent: _controller,
curve: Interval(0.5, 1.0)
)
);

_controller.repeat();
super.didChangeDependencies();
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Stack(
children: [
Center(
child: Container(
width: widget.dragging ? widget.size : widget.size / 2,
height: widget.dragging ? widget.size : widget.size / 2,
decoration: BoxDecoration(
color: Theme.of(context).accentColor.withOpacity(0.5),
borderRadius: widget.dragging ? BorderRadius.circular(widget.size) : BorderRadius.circular(widget.size / 4)
)
)
),
AnimatedBuilder(
builder: (BuildContext context, Widget child) {
return Center(
child: Container(
width: widget.dragging ? 0 : widget.size * _sizeAnimation.value,
height: widget.dragging ? 0 : widget.size * _sizeAnimation.value,
decoration: BoxDecoration(
border: Border.all(
color: _colorAnimation.value,
width: widget.size / 20
),
borderRadius: widget.dragging ? BorderRadius.zero : BorderRadius.circular(widget.size * _sizeAnimation.value / 2)
)
)
);
},
animation: _controller
)
],
);
}
}
Loading