| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- import 'package:flutter/foundation.dart';
- import 'package:get/get.dart';
- class RouteName{
- static const start = '/start';
- static const init = '/init';
- static const test = '/test';
- static const home = '/home';
- static const signIn = '/signIn';
- static const gameLoading = '/gameLoading';
- static const providerDetail = '/providerDetail';
- static const needUpdate = '/needUpdate';
- static const settlement = '/settlement';
- static const homeSaveUserInfo = '/homeSaveUserInfo';
- static const mapsList = '/mapsList'; // 地图列表
- static const mapTO = '/mapTO'; // 地图场控
- static const userAdmin = '/userAdmin'; // 用户管理
- static const personRank = '/personRank';// 个人排名
- static const groupRank = '/groupRank'; // 分组排名
- static const sportData = '/sportData'; // 数据详情
- static const setting = '/setting'; // 设置
- }
- class Route{
- static Future<bool> toLogin({
- bool canBack=true,
- bool thenBack=false,
- VoidCallback? thenToPageCall,
- }) async{
- dynamic arguments = thenToPageCall;
- if (thenBack){
- arguments = (){
- Get.back(closeOverlays:true);
- };
- }
- Future<dynamic>? r;
- if(canBack){
- r = Get.toNamed(RouteName.signIn, arguments: arguments);
- }else{
- r = Get.offAllNamed(RouteName.signIn, arguments: arguments);
- }
- if (r!= null){
- final r2 = await r;
- if(r2 is bool){
- return r2;
- }
- }
- return false;
- }
- }
|