salby / morpheus Goto Github PK
View Code? Open in Web Editor NEWA Flutter package for easily implementing Material Design navigation transitions.
Home Page: https://pub.dev/packages/morpheus
License: MIT License
A Flutter package for easily implementing Material Design navigation transitions.
Home Page: https://pub.dev/packages/morpheus
License: MIT License
Hey, tnx for amazing plugin. Just one issue, I've tested on Android 9.0 and 8.0, on 9.0 everything is working as expected while on 8.0 there is no transition at all, or maybe the speed of transition is too fast(thats my opinion). I'm talking about parent-child transition. Tabview transition on 8.0 is working but its to fast.. What could be the cause? Tnx in advance
Hello,
I have been following the examples, but i would like to know if it's possible to have lower pages under the navigator in MorpheusTabView.
If each of the pages in the tab view have a separate stack and persist the state, it's possible to have a page pushed only in that tab? Let's say that one of the MorpheusTabView tabs is settings. And I would like to push a names route /settings/locale
only to the settings tab.
This pushed route would have a back button in the top bar?
After going to Profile and returning to settings, the navigated page would be there?
It could be possible to add a custom animation to that named route? for example a slide-right?
All this while keeping the bottom navigation bar, and also accepting params from the router.
thanks
Error (Xcode): ../../../.pub-cache/hosted/pub.dev/morpheus-1.2.3/lib/page_routes/morpheus_page_transition.dart:191:48: Error: The argument type 'BorderRadius?' can't be assigned to the parameter type 'BorderRadiusGeometry' because 'BorderRadius?' is nullable and 'BorderRadiusGeometry' isn't.
Getting this if I use flutter 3.13.0, not with Flutter 3.10.6.
I'm using it with auto_route to generate routes
here is the function I created to use with auto_route package:
Widget morpheusTransition(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) { final transitionSettings = MorpheusRouteArguments( // parentKey: parentKey, scrimColor: Colors.black45, borderRadius: BorderRadius.circular(20), transitionColor: context.theme.bottomAppBarColor, transitionToChild: true, scaleChild: true, ); return MorpheusPageTransition(context: context, animation: animation, secondaryAnimation: secondaryAnimation, child: child, settings: transitionSettings); }
And this is how I'm using it:
@CustomAutoRouter(transitionsBuilder: morpheusTransition) class $Router { @initial StartUpView startUpViewRoute; LoginView loginViewRoute; ..... }
Hi there,
Whenever I try to use your package with the parent-child transition on a ListTile that opens up another page, the transition seems to start but whenever it finishes I'm getting a red screen and the following console log:
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building AnimatedBuilder(animation: Listenable.merge([AnimationController#d144d(⏭ 1.000; paused; for MorpheusPageRoute<dynamic>)➩ProxyAnimation, kAlwaysDismissedAnimation➩ProxyAnimation➩ProxyAnimation]), dirty, dependencies: [MediaQuery], state: _AnimatedState#243c9):
'package:flutter/src/rendering/object.dart': Failed assertion: line 2259 pos 12: 'attached': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md
User-created ancestor of the error-causing widget was
MaterialApp
lib/main.dart:12
When the exception was thrown, this was the stack
#2 RenderObject.getTransformTo
package:flutter/…/rendering/object.dart:2259
#3 RenderBox.localToGlobal
package:flutter/…/rendering/box.dart:2257
#4 MorpheusPageRoute._findRenderBox
package:morpheus/page_routes/morpheus_page_route.dart:86
#5 MorpheusPageRoute.buildTransitions
package:morpheus/page_routes/morpheus_page_route.dart:150
#6 _ModalScopeState.build.<anonymous closure>
package:flutter/…/widgets/routes.dart:652
Any idea what could be wrong here?
I am using the following code:
class LocationActivityInformationPage extends StatelessWidget {
final List<Location> locations;
final String scroll;
LocationActivityInformationPage(this.locations, this.scroll);
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding:EdgeInsets.all(8.0),
child: Column(
children: <Widget>[
Card(
elevation: 3.0,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
key: PageStorageKey(this.scroll),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: this.locations.length,
itemBuilder: (context, index) {
final _parentKey = GlobalKey();
return _renderlocation(context, this.locations, index, _parentKey);
}
)
)
]
)
);
}
Widget _renderlocation(BuildContext context, List<Location> locations, int index, GlobalKey key) {
var result;
result = ListTile(
key: key,
leading: _locationIcon(locations[index].image),
title: _locationName(locations[index].name),
subtitle: _locationCity(locations[index].city.name),
onTap: ()=> _handleTap(context, key)
);
return result;
}
void _handleTap(BuildContext context, GlobalKey parentkey) {
Navigator.of(context).push(MorpheusPageRoute(
builder: (context) => LocationDetailsPage(),
parentKey: parentkey,
));
}
I've been told this problem has to do with the following property:
https://api.flutter.dev/flutter/foundation/AbstractNode/attached.html
Could you please take a look at it?
EDIT:
Apparently this issue happens when you animate to a screen from a screen that has been pushed through navigation. So for example I have a screen that pushes a screen on top of it, and then I click on the ListTile inside that screen to navigate to the child screen of the ListTile.
I'm trying to find a solution for it but can't figure out what I should be doing so far.
Is there a way to maintain state on MorpheusPageRoute, because I need this functionality for IOS, user can't navigate back with a back swipe..
There's a method to build Morpheus transition and routing with routes already written and the Navigator.pushNamed?
Hi.
Is there any way to persist the child's state? Every time I make the child switch, it is rebuilt again.
I'm working with Statefull widgets and switching in a bottomNavigationBar. I even tried with the AutomaticKeepAliveClientMixin.
Thanks (btw, I really like transitions, great work).
Currently the MorpheusPageRoute only supports ListViews, with only 1 item for each Row.
It should also support GridViews, with multiple items per Row, having the animation first expand the item horizontally and then vertically.
Thanks for the great work btw^^
Currently this library cannot be used on newer versions of Dart due to null safety improvements:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:morpheus
2
For solutions, see https://dart.dev/go/unsound-null-safety
Hi how to use MorpheusPageRoute to create a radial expansion from a floating action button to the new screen?
This feature is implemented in the package animations, but I prefer using your plugin.
Thanks
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.