| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- 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 userRank = '/userRank'; // 个人排名
- 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;
- }
- }
|