Skip to content

Commit

Permalink
inicia separação dos componentes
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelBarbosatec committed Apr 27, 2019
1 parent 3ab2c2a commit a9c2bdc
Show file tree
Hide file tree
Showing 11 changed files with 316 additions and 40 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

192 changes: 164 additions & 28 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions lib/animeted_focus_light.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

import 'package:flutter/widgets.dart';

class AnimetedFocusLight extends StatefulWidget {
@override
_AnimetedFocusLightState createState() => _AnimetedFocusLightState();
}

class _AnimetedFocusLightState extends State<AnimetedFocusLight> {
@override
Widget build(BuildContext context) {
return Container();
}
}
17 changes: 17 additions & 0 deletions lib/content_target.dart
Original file line number Diff line number Diff line change
@@ -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);
}
43 changes: 43 additions & 0 deletions lib/light_paint.dart
Original file line number Diff line number Diff line change
@@ -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;
}

}
13 changes: 13 additions & 0 deletions lib/target_focus.dart
Original file line number Diff line number Diff line change
@@ -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<ContentTarget> contents;

TargetFocus({this.keyTarget, this.targetPosition, this.contents}):assert(keyTarget != null || targetPosition != null);

}
9 changes: 9 additions & 0 deletions lib/target_position.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

import 'dart:ui';

class TargetPosition{
final Size size;
final Offset offset;

TargetPosition(this.size, this.offset);
}
31 changes: 27 additions & 4 deletions lib/tutorial_coach_mark.dart
Original file line number Diff line number Diff line change
@@ -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;
}
}
Loading

0 comments on commit a9c2bdc

Please sign in to comment.