diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ef170c0..de87e3d8 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,7 +1,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -13,7 +22,70 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -25,6 +97,7 @@
+
@@ -32,11 +105,20 @@
+
+
+
+
+
+
+
+
+
+
-
@@ -81,44 +163,98 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/animeted_focus_light.dart b/lib/animeted_focus_light.dart
new file mode 100644
index 0000000..c590e23
--- /dev/null
+++ b/lib/animeted_focus_light.dart
@@ -0,0 +1,14 @@
+
+import 'package:flutter/widgets.dart';
+
+class AnimetedFocusLight extends StatefulWidget {
+ @override
+ _AnimetedFocusLightState createState() => _AnimetedFocusLightState();
+}
+
+class _AnimetedFocusLightState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Container();
+ }
+}
diff --git a/lib/content_target.dart b/lib/content_target.dart
new file mode 100644
index 0000000..e403569
--- /dev/null
+++ b/lib/content_target.dart
@@ -0,0 +1,17 @@
+
+import 'package:flutter/widgets.dart';
+
+enum AlignContent{
+ top,
+ bottom,
+ left,
+ right
+}
+
+class ContentTarget{
+
+ final AlignContent align;
+ final Widget child;
+
+ ContentTarget({this.align = AlignContent.bottom, this.child}):assert(child != null);
+}
\ No newline at end of file
diff --git a/lib/light_paint.dart b/lib/light_paint.dart
new file mode 100644
index 0000000..9a0f6d5
--- /dev/null
+++ b/lib/light_paint.dart
@@ -0,0 +1,43 @@
+ import 'dart:math';
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+
+class LightPaint extends CustomPainter {
+
+ final double progress;
+ final Offset positioned;
+ final double sizeCircle;
+
+ Paint _paintFocus;
+
+ LightPaint(this.progress, this.positioned, this.sizeCircle){
+ _paintFocus = Paint()
+ ..color = Colors.transparent
+ ..blendMode = BlendMode.clear;
+ }
+
+ @override
+ void paint(Canvas canvas, Size size) {
+
+ canvas.saveLayer(Offset.zero & size, Paint());
+ canvas.drawColor(Colors.black.withOpacity(0.8), BlendMode.dstATop);
+
+ double sizeFocus = (size.height * 1.4) * (1-progress) + sizeCircle;
+ double radius = min(sizeFocus,sizeFocus);
+
+ canvas.drawCircle(
+ positioned,
+ radius,
+ _paintFocus
+ );
+ canvas.restore();
+
+ }
+
+ @override
+ bool shouldRepaint(LightPaint oldDelegate) {
+ return oldDelegate.progress != progress;
+ }
+
+ }
\ No newline at end of file
diff --git a/lib/target_focus.dart b/lib/target_focus.dart
new file mode 100644
index 0000000..36c1d1e
--- /dev/null
+++ b/lib/target_focus.dart
@@ -0,0 +1,13 @@
+import 'package:flutter/widgets.dart';
+import 'package:tutorial_coach_mark/content_target.dart';
+import 'package:tutorial_coach_mark/target_position.dart';
+
+class TargetFocus{
+
+ final GlobalKey keyTarget;
+ final TargetPosition targetPosition;
+ final List contents;
+
+ TargetFocus({this.keyTarget, this.targetPosition, this.contents}):assert(keyTarget != null || targetPosition != null);
+
+}
\ No newline at end of file
diff --git a/lib/target_position.dart b/lib/target_position.dart
new file mode 100644
index 0000000..d7e75b3
--- /dev/null
+++ b/lib/target_position.dart
@@ -0,0 +1,9 @@
+
+import 'dart:ui';
+
+class TargetPosition{
+ final Size size;
+ final Offset offset;
+
+ TargetPosition(this.size, this.offset);
+}
\ No newline at end of file
diff --git a/lib/tutorial_coach_mark.dart b/lib/tutorial_coach_mark.dart
index 80285b2..694cdd4 100644
--- a/lib/tutorial_coach_mark.dart
+++ b/lib/tutorial_coach_mark.dart
@@ -1,7 +1,30 @@
library tutorial_coach_mark;
+import 'package:flutter/material.dart';
+import 'package:tutorial_coach_mark/tutorial_coach_mark_widget.dart';
-/// A Calculator.
-class Calculator {
- /// Returns [value] plus 1.
- int addOne(int value) => value + 1;
+class TutorialCoachMark {
+ final BuildContext _context;
+
+ OverlayEntry _overlayEntry;
+
+ TutorialCoachMark(
+ this._context,);
+
+ OverlayEntry _buildOverlay() {
+ return OverlayEntry(builder: (context) {
+ return TutorialCoachMarkWidget();
+ });
+ }
+
+ void show() {
+ if (_overlayEntry == null) {
+ _overlayEntry = _buildOverlay();
+ Overlay.of(_context).insert(_overlayEntry);
+ }
+ }
+
+ void _hide() {
+ _overlayEntry?.remove();
+ _overlayEntry = null;
+ }
}
diff --git a/lib/tutorial_coach_mark_widget.dart b/lib/tutorial_coach_mark_widget.dart
new file mode 100644
index 0000000..3774a0d
--- /dev/null
+++ b/lib/tutorial_coach_mark_widget.dart
@@ -0,0 +1,19 @@
+import 'package:flutter/material.dart';
+import 'package:tutorial_coach_mark/target_focus.dart';
+
+class TutorialCoachMarkWidget extends StatefulWidget {
+
+ final List targets;
+
+ const TutorialCoachMarkWidget({Key key, this.targets}) : super(key: key);
+
+ @override
+ _TutorialCoachMarkWidgetState createState() => _TutorialCoachMarkWidgetState();
+}
+
+class _TutorialCoachMarkWidgetState extends State {
+ @override
+ Widget build(BuildContext context) {
+ return Container();
+ }
+}
diff --git a/test/tutorial_coach_mark_test.dart b/test/tutorial_coach_mark_test.dart
index e020d97..34ec5e3 100644
--- a/test/tutorial_coach_mark_test.dart
+++ b/test/tutorial_coach_mark_test.dart
@@ -3,11 +3,4 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
void main() {
- test('adds one to input values', () {
- final calculator = Calculator();
- expect(calculator.addOne(2), 3);
- expect(calculator.addOne(-7), -6);
- expect(calculator.addOne(0), 1);
- expect(() => calculator.addOne(null), throwsNoSuchMethodError);
- });
}
diff --git a/tutorial_coach_mark.iml b/tutorial_coach_mark.iml
index 28de00e..3843a3a 100644
--- a/tutorial_coach_mark.iml
+++ b/tutorial_coach_mark.iml
@@ -9,14 +9,17 @@
+
+
+
-
+
\ No newline at end of file