Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit c906fd05
authored
2025-12-25 11:57:39 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ios手势测试
1 parent
5de5f855
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
85 deletions
lib/config/routes.dart
lib/config/routes.dart
View file @
c906fd0
import
'dart:io'
;
import
'package:appframe/ui/pages/adv_page.dart'
;
import
'package:appframe/ui/pages/adv_page.dart'
;
import
'package:appframe/ui/pages/im_page.dart'
;
import
'package:appframe/ui/pages/im_page.dart'
;
import
'package:appframe/ui/pages/link_page.dart'
;
import
'package:appframe/ui/pages/link_page.dart'
;
...
@@ -8,130 +6,65 @@ import 'package:appframe/ui/pages/login_phone_page.dart';
...
@@ -8,130 +6,65 @@ import 'package:appframe/ui/pages/login_phone_page.dart';
import
'package:appframe/ui/pages/login_qr_page.dart'
;
import
'package:appframe/ui/pages/login_qr_page.dart'
;
import
'package:appframe/ui/pages/reload_page.dart'
;
import
'package:appframe/ui/pages/reload_page.dart'
;
import
'package:appframe/ui/pages/scan_code_page.dart'
;
import
'package:appframe/ui/pages/scan_code_page.dart'
;
import
'package:appframe/ui/pages/setting/account_page.dart'
;
import
'package:appframe/ui/pages/setting/account_phone_page.dart'
;
import
'package:appframe/ui/pages/web_page.dart'
;
import
'package:appframe/ui/pages/web_page.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:go_router/go_router.dart'
;
// iOS平台使用Cupertino转场动画以支持侧滑返回手势
Page
<
dynamic
>
_buildPageWithTransition
({
required
Widget
child
,
required
GoRouterState
state
,
})
{
if
(
Platform
.
isIOS
)
{
return
CupertinoPage
(
key:
state
.
pageKey
,
child:
child
,
);
}
return
MaterialPage
(
key:
state
.
pageKey
,
child:
child
,
);
}
final
GoRouter
router
=
GoRouter
(
final
GoRouter
router
=
GoRouter
(
initialLocation:
'/web'
,
initialLocation:
'/web'
,
routes:
<
RouteBase
>[
routes:
<
RouteBase
>[
GoRoute
(
GoRoute
(
path:
'/web'
,
path:
'/web'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
WebPage
();
child:
const
WebPage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/scanCode'
,
path:
'/scanCode'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
ScanCodePage
();
child:
const
ScanCodePage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/link'
,
path:
'/link'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
LinkPage
();
child:
const
LinkPage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/loginMain'
,
path:
'/loginMain'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
LoginMainPage
();
child:
const
LoginMainPage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/loginPhone'
,
path:
'/loginPhone'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
LoginPhonePage
();
child:
const
LoginPhonePage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/loginQr'
,
path:
'/loginQr'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
LoginQrPage
();
child:
const
LoginQrPage
(),
state:
state
,
);
},
),
GoRoute
(
path:
'/account'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
child:
const
AccountPage
(),
state:
state
,
);
},
),
GoRoute
(
path:
'/account/phone'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
child:
const
AccountPhonePage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/adv'
,
path:
'/adv'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
AdvPage
();
child:
const
AdvPage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/im'
,
path:
'/im'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
ImPage
();
child:
const
ImPage
(),
state:
state
,
);
},
},
),
),
GoRoute
(
GoRoute
(
path:
'/reload'
,
path:
'/reload'
,
pageBuilder:
(
BuildContext
context
,
GoRouterState
state
)
{
builder:
(
BuildContext
context
,
GoRouterState
state
)
{
return
_buildPageWithTransition
(
return
const
ReloadPage
();
child:
const
ReloadPage
(),
state:
state
,
);
},
},
),
),
],
],
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment