pop_route.dart 549 B

1234567891011121314151617181920212223242526
  1. import 'package:flutter/material.dart';
  2. class PopRoute extends PopupRoute {
  3. final Duration _duration = Duration(milliseconds: 300);
  4. Widget child;
  5. PopRoute({required this.child});
  6. @override
  7. Color? get barrierColor => null;
  8. @override
  9. bool get barrierDismissible => true;
  10. @override
  11. String? get barrierLabel => null;
  12. @override
  13. Widget buildPage(BuildContext context, Animation<double> animation,
  14. Animation<double> secondaryAnimation) {
  15. return child;
  16. }
  17. @override
  18. Duration get transitionDuration => _duration;
  19. }