We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import 'package:circular_reveal_animation/circular_reveal_animation.dart'; import 'package:flutter/material.dart'; class HiveTubeSliverAppBar extends StatefulWidget { final Function _onTap; const HiveTubeSliverAppBar({@required Function onTap}) : _onTap = onTap; @override _HiveTubeSliverAppBarState createState() => _HiveTubeSliverAppBarState(); } class _HiveTubeSliverAppBarState extends State<HiveTubeSliverAppBar> with TickerProviderStateMixin { AnimationController _animationController; Animation<double> _animation; AnimationController _circularAnimationController; Animation<double> _circularAnimation; @override void initState() { super.initState(); _animationController = AnimationController(vsync: this, duration: const Duration(milliseconds: 250)); _animation = Tween<double>(begin: 0.0, end: 1.0).animate(_animationController); _circularAnimationController = AnimationController( vsync: this, duration: const Duration(milliseconds: 1000), ); _circularAnimation = CurvedAnimation( parent: _circularAnimationController, curve: Curves.easeIn, ); } @override Widget build(BuildContext context) { return SliverPersistentHeader( pinned: false, floating: true, delegate: CustomAutoHideAppBarDelegate( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: Row( children: <Widget>[ IconButton(icon: const Icon(Icons.more_vert_rounded), onPressed: () => _showOverlayHomeMenu(context, _animationController,_circularAnimation)) ], ), ), ), ); } Future<void> _showOverlayHomeMenu(BuildContext context, AnimationController animationController, Animation<double> circularAnimation) async { final OverlayState _overlayState = Overlay.of(context); final OverlayEntry _overlayEntry = OverlayEntry(builder: (context) { return CircularRevealAnimation( animation: circularAnimation, centerOffset: const Offset(10, 10), child: Positioned( top: kToolbarHeight - 20, right: 20.0, child: Opacity( opacity: _animationController.value, child: Card( elevation: 8.0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)), color: const Color(0xFF32313C), child: Container( width: 200.0, height: 250.0, child: const ListTile( title: Text( 'aaaaaaa', style: TextStyle(color: Colors.white), ), leading: Icon( Icons.assessment, color: Colors.white, ), ), ), ), ), ), ); }); _animationController.addListener(() { _overlayState.setState(() {}); }); _overlayState.insert(_overlayEntry); _animationController.forward(); await Future.delayed(const Duration(milliseconds: 3500)); _animationController.reverse(); _overlayEntry.remove(); } }
The text was updated successfully, but these errors were encountered:
Hello! Any description and expected/actual behavior would be useful.
Sorry, something went wrong.
@qwert2603 simply when i try to use then library Animation, Overlay doesn't work
Overlay
@MahdiPishguy sorry for late response. I looked throug your code and found some subtle bug in circularAnimation usage.
circularAnimation
circularAnimation is backed by _circularAnimationController, but in method _showOverlayHomeMenu another controller (_animationController) is used.
_circularAnimationController
_showOverlayHomeMenu
_animationController
It will work fine, if _circularAnimationController.forward() will be called together with _animationController.forward();.
_circularAnimationController.forward()
_animationController.forward();
No branches or pull requests
The text was updated successfully, but these errors were encountered: