diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 384942f..f035de7 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,10 +1,11 @@ - - - - + + + + + @@ -24,23 +25,11 @@ - - - - - - - - - - - - - + - - + + @@ -51,8 +40,8 @@ - - + + @@ -60,23 +49,23 @@ - - + + - - + + - + - + - - + + @@ -84,8 +73,8 @@ - - + + @@ -93,18 +82,6 @@ - - - - - - - - - - - - @@ -131,17 +108,17 @@ @@ -156,8 +133,8 @@ - + @@ -165,6 +142,17 @@ + + + + + + + + + + + @@ -230,7 +218,7 @@ - + 1569569138043 - + - + @@ -280,10 +268,10 @@ - + - + @@ -344,13 +332,6 @@ - - - - - - - @@ -382,69 +363,83 @@ - + - - + + - + - - + + - + - + - - + + - + - + - - + + + + + + + + + - + - - + + - + + + + + + + + - - + + - + - - + + - + diff --git a/example/lib/main.dart b/example/lib/main.dart index 19a9e5b..34322f8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -2,7 +2,9 @@ import 'package:flutter/material.dart'; import 'package:liquid_swipe/Constants/Helpers.dart'; import 'package:liquid_swipe/liquid_swipe.dart'; +import 'secondExample.dart'; +final GlobalKey navigatorKey = new GlobalKey(); void main() { runApp( new MyApp(), @@ -212,12 +214,62 @@ class MyApp extends StatelessWidget { ], ), ), + Container( + color: Colors.redAccent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Image.asset( + 'assets/1.png', + fit: BoxFit.cover, + ), + Padding(padding: const EdgeInsets.all(20.0)), + Column( + children: [ + new Text( + "Lets ", + style: TextStyle( + fontSize: 30, + fontFamily: "Billy", + fontWeight: FontWeight.w600), + ), + new Text( + "Try Another Example", + style: TextStyle( + fontSize: 30, + fontFamily: "Billy", + fontWeight: FontWeight.w600), + ), + FlatButton( + disabledColor: Colors.deepPurpleAccent, + onPressed: () { + Navigator.push( + navigatorKey.currentContext, + MaterialPageRoute(builder: (context) => SecondExample()), + ); + }, + child: Text( + "Click Here", + style: TextStyle( + fontSize: 30, + fontFamily: "Billy", + fontWeight: FontWeight.w600), + ), + ), + ], + ) + ], + ), + ), ]; int page = 0; UpdateType updateType; @override Widget build(BuildContext context) { return new MaterialApp( + navigatorKey: navigatorKey, home: new Scaffold( body: LiquidSwipe( pages: pages, diff --git a/lib/Animation_Gesture/page_reveal.dart b/lib/Animation_Gesture/page_reveal.dart index 8f28144..e88d39b 100644 --- a/lib/Animation_Gesture/page_reveal.dart +++ b/lib/Animation_Gesture/page_reveal.dart @@ -40,9 +40,10 @@ class PageReveal extends StatelessWidget { case WaveType.circularReveal: return ClipPath( clipper: CircularWave(iconPosition, - revealPercent: slideDirection == SlideDirection.leftToRight + slideDirection == SlideDirection.leftToRight ? 1.0 - revealPercent - : revealPercent), + : revealPercent, vertReveal), + child: child, ); break; diff --git a/lib/Clippers/CircularWave.dart b/lib/Clippers/CircularWave.dart index 8defdea..25c1e64 100644 --- a/lib/Clippers/CircularWave.dart +++ b/lib/Clippers/CircularWave.dart @@ -6,12 +6,14 @@ import 'package:flutter/material.dart'; class CircularWave extends CustomClipper { final double revealPercent; final double iconPosition; + final double verReveal; - CircularWave(this.iconPosition, {this.revealPercent}); + CircularWave(this.iconPosition, this.revealPercent, this.verReveal); @override Path getClip(Size size) { - final center = new Offset(size.width, size.height * (iconPosition + 1) / 2); + print(verReveal); + final center = new Offset(size.width, size.height * (2 * verReveal / 3)); final radius = 1000 * revealPercent; final diameter = 2 * radius; final path = Path(); diff --git a/lib/Clippers/WaveLayer.dart b/lib/Clippers/WaveLayer.dart index df83ab8..76877ba 100644 --- a/lib/Clippers/WaveLayer.dart +++ b/lib/Clippers/WaveLayer.dart @@ -27,6 +27,7 @@ class WaveLayer extends CustomClipper { waveVertRadius = waveVertRadiusF(size); waveCenterY = size.height * (2 * verReveal / 3); + if (slideDirection == SlideDirection.leftToRight) { waveHorRadius = waveHorRadiusFBack(size); } else {