123456789101112131415161718192021222324252627 |
- import 'package:flutter/material.dart';
- import 'package:flutter/foundation.dart';
- class Util {
- /// 页面跳转
- static void gotoPage(BuildContext context, Widget widget) {
- Navigator.push(
- context,
- PageRouteBuilder(
- transitionDuration: const Duration(milliseconds: 400),
- pageBuilder: ((context, animation, secondaryAnimation) {
- return FadeTransition(
- opacity: animation,
- child: widget,
- );
- })));
- }
- static bool isWeb(){
- if (defaultTargetPlatform == TargetPlatform.android ||
- defaultTargetPlatform == TargetPlatform.iOS) {
- return false;
- } else {
- return true;
- }
- }
- }
|