common_util.dart 479 B

1234567891011121314151617
  1. import 'package:flutter/material.dart';
  2. class Util {
  3. /// 页面跳转
  4. static void gotoPage(BuildContext context, Widget widget) {
  5. Navigator.push(
  6. context,
  7. PageRouteBuilder(
  8. transitionDuration: const Duration(milliseconds: 400),
  9. pageBuilder: ((context, animation, secondaryAnimation) {
  10. return FadeTransition(
  11. opacity: animation,
  12. child: widget,
  13. );
  14. })));
  15. }
  16. }