pin73 / cupertino_back_gesture Goto Github PK
View Code? Open in Web Editor NEWFlutter package to set custom width of iOS back swipe gesture area
License: BSD 3-Clause "New" or "Revised" License
Flutter package to set custom width of iOS back swipe gesture area
License: BSD 3-Clause "New" or "Revised" License
Hi Author.
With TargetPlatform.android:
CupertinoPageTransitionsBuilderCustomBackGestureWidth()
In OtherPage, I use WillPopScope to catch back event of Android then this library is not working.
Thank you.
Does there will be added support for null-safety?
Can it use with onGenerateRoute
?
It is conflict with TabBar&TabBarView。
It is conflict with ListView( scrollDirection : Axis.horizontal)。
hello
I use carousel slide
https://github.com/serenader2014/flutter_carousel_slider
I just wanted swipe the carousel, but the page also move...
Do you have any way to not page moving?
class AnimationPageRoute<T> extends MaterialPageRoute<T> {
AnimationPageRoute({
WidgetBuilder builder,
RouteSettings settings,
this.isExitPageAffectedOrNot = true,
this.animationType = AnimationType.SlideRL,
this.maintainState = true,
}) : super(builder: builder, settings: settings);
// AnimationPageRoute({
// @required this.builder,
// this.isExitPageAffectedOrNot = true,
// this.animationType = AnimationType.SlideRL,
// RouteSettings settings,
// this.maintainState = true,
// bool fullscreenDialog = false,
// }) : assert(builder != null),
// assert(isExitPageAffectedOrNot != null),
// assert(animationType != null),
// assert(maintainState != null),
// assert(fullscreenDialog != null);
// final WidgetBuilder builder;
/// 该参数只针对当[AnimationType]为[SlideLR]或[SlideRL]新页面及当前页面动画均有效
final bool isExitPageAffectedOrNot;
final AnimationType animationType;
@override
final bool maintainState;
@override
Duration get transitionDuration => const Duration(milliseconds: 1000);
@override
Color get barrierColor => null;
@override
String get barrierLabel => null;
@override
bool canTransitionTo(TransitionRoute<dynamic> nextRoute) =>
nextRoute is AnimationPageRoute && !nextRoute.fullscreenDialog;
@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
final Widget result = builder(context);
assert(() {
if (result == null) {
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary(
'The builder for route "${settings.name}" returned null.'),
ErrorDescription('Route builders must never return null.')
]);
}
return true;
}());
return Semantics(
scopesRoute: true, explicitChildNodes: true, child: result);
}
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
if (animationType == AnimationType.Fade)
FadeTransition(
opacity: CurvedAnimation(
parent: animation,
curve: Curves.linearToEaseOut,
reverseCurve: Curves.easeInToLinear,
).drive(_tweenFade),
child: child);
final TextDirection textDirection = Directionality.of(context);
Tween<Offset> primaryTween = _primaryTweenSlideFromRightToLeft,
secondTween = _secondaryTweenSlideFromRightToLeft;
Cubic curve = Curves.linearToEaseOut, reverseCurve = Curves.easeInToLinear;
if (animationType == AnimationType.SlideBT) {
primaryTween = _primaryTweenSlideFromBottomToTop;
} else if (animationType == AnimationType.SlideTB) {
primaryTween = _primaryTweenSlideFromTopToBottom;
} else if (animationType == AnimationType.SlideLR) {
primaryTween = _primaryTweenSlideFromLeftToRight;
secondTween = _secondaryTweenSlideFromLeftToRight;
curve = Curves.fastOutSlowIn;
reverseCurve = Curves.easeOutCubic;
}
Widget enterAnimWidget = SlideTransition(
position: CurvedAnimation(
parent: animation,
curve: curve,
reverseCurve: reverseCurve,
).drive(primaryTween),
textDirection: textDirection,
child: child);
if (isExitPageAffectedOrNot != true ||
([AnimationType.SlideTB, AnimationType.SlideBT]
.contains(animationType))) return enterAnimWidget;
return SlideTransition(
position: CurvedAnimation(
parent: secondaryAnimation,
curve: curve,
reverseCurve: reverseCurve,
).drive(secondTween),
textDirection: textDirection,
child: enterAnimWidget);
}
@override
String get debugLabel => '${super.debugLabel}(${settings.name})';
}
I got this issue
`../../../../documents/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_back_gesture-0.0.3/lib/src/cupertino_page_route.dart:120:15: Error: Getter not found: 'opaque'.
assert(opaque),
^^^^^^
FAILURE: Build failed with an exception.
Where:
Script '/Users/uogforceone/documents/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command '/Users/uogforceone/documents/flutter/bin/flutter'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
`
Thanks for your plugin. I tried to add it, but looks like it's only for MaterialApp, because I can't set pageTransitionsTheme in CupertinoApp.
Is there a way to use it with CupertinoApp?
Title says it all...
Does it work with GetX? Or is there equivalent for GetX?
thanks
Wrapping BackGestureWidthTheme with MaterialApp.router does not make the library works.
Hi, could you please clarify the license of this code? Can it be used in commercial products?
Basically I have a bunch of dismissible views, but when I use this plugin with the whole page set as the swipe back gesture, I am unable to dismiss my views in the other direction. Would it be possible to make it so that the gesture does not override these (meaning the right to left gesture) and only the left to right gesture?
Thank you! Love the plugin btw
I want to pop the current route
by dragging down. So the current route
should move along with the finger towards the bottom of the page while fading out and shrinking.
Basically I would like to know if there is an easy way, without forking the package, to customize the dismiss animation and gesture.
My objective is to have a similar UX to a Instagram Story route pop.
Thank you very much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.