-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdbcfc1
commit ad844b2
Showing
8 changed files
with
121 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
/// Custom clipper for circular page reveal. | ||
/// Copied from IntroViews.See Credits in Readme.md | ||
class CircularWave extends CustomClipper<Path> { | ||
final double revealPercent; | ||
final double iconPosition; | ||
|
||
CircularWave(this.iconPosition, {this.revealPercent}); | ||
|
||
@override | ||
Path getClip(Size size) { | ||
final center = new Offset(size.width, size.height * (iconPosition + 1) / 2); | ||
final radius = 1000 * revealPercent; | ||
final diameter = 2 * radius; | ||
final path = Path(); | ||
|
||
path.lineTo(size.width, 0); | ||
path.lineTo(size.width, size.height); | ||
path.lineTo(0, size.height); | ||
|
||
final rect = Rect.fromLTWH( | ||
center.dx - radius, center.dy - radius, diameter, diameter); | ||
|
||
///Adding Oval with path.addOval() Makes the clipper totally inverse | ||
///So have to use addArc().It took me 3 hours to make this workaround, lol. | ||
///try to use addOval instead, and u will find the issue | ||
path.addArc(rect, 90, -270); | ||
return path; | ||
} | ||
|
||
@override | ||
bool shouldReclip(CustomClipper<Path> oldClipper) { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,8 @@ enum TransitionGoal { | |
open, | ||
close, | ||
} | ||
|
||
enum WaveType { | ||
circularReveal, | ||
liquidReveal | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters