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 cbfc018f
authored
2025-12-27 11:13:53 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ios手势测试
1 parent
fc562c9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
lib/config/routes.dart
lib/ui/pages/link_page.dart
lib/ui/pages/web_page.dart
lib/config/routes.dart
View file @
cbfc018
...
...
@@ -98,7 +98,7 @@ class AppRouteObserver extends NavigatorObserver {
super
.
didPush
(
route
,
previousRoute
);
debugPrint
(
"前一个路由:
${previousRoute?.settings.name}
新路由:
${route.settings.name}
"
);
debugPrint
(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
);
debugPrint
(
"
push
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
);
if
(
previousRoute
?.
settings
.
name
==
'/web'
)
{
// 前一个路由是web,代表是从web路由中push到此路由
...
...
@@ -113,16 +113,20 @@ class AppRouteObserver extends NavigatorObserver {
super
.
didPop
(
route
,
previousRoute
);
debugPrint
(
"前一个路由:
${previousRoute?.settings.name}
新路由:
${route.settings.name}
"
);
debugPrint
(
"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
);
debugPrint
(
"
pop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
);
if
(
previousRoute
?.
settings
.
name
==
'/web'
)
{
// 前一个路由是web,代表
会
到web
// 前一个路由是web,代表
回
到web
WebCubitHolder
.
instance
?.
test
();
if
(
WebCubitHolder
.
instance
!=
null
)
{
// 设置手势监听回调
debugPrint
(
"设置监听--------"
);
IosEdgeSwipeDetector
.
onEdgeSwipe
(
WebCubitHolder
.
instance
!.
handleBack
);
Future
.
delayed
(
const
Duration
(
milliseconds:
400
),
()
{
if
(
WebCubitHolder
.
instance
!=
null
)
{
IosEdgeSwipeDetector
.
onEdgeSwipe
(
WebCubitHolder
.
instance
!.
handleBack
);
}
});
}
}
}
...
...
lib/ui/pages/link_page.dart
View file @
cbfc018
...
...
@@ -43,10 +43,10 @@ class LinkPage extends StatelessWidget {
return
PopScope
(
canPop:
false
,
onPopInvokedWithResult:
(
didPop
,
result
)
async
{
if
(
didPop
)
return
;
debugPrint
(
""
);
debugPrint
(
"^^^^^^^^^^^^^^ Link page PopScope ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
${DateTime.now().toString()}
"
);
debugPrint
(
"^^^^^^^^^^^^^^ Link page PopScope
$didPop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
${DateTime.now().toString()}
"
);
debugPrint
(
""
);
if
(
didPop
)
return
;
await
ctx
.
read
<
LinkCubit
>().
handleBack
(
ctx
);
},
child:
scaffold
,
...
...
lib/ui/pages/web_page.dart
View file @
cbfc018
...
...
@@ -115,10 +115,10 @@ class WebPage extends StatelessWidget {
return
PopScope
(
canPop:
false
,
onPopInvokedWithResult:
(
didPop
,
result
)
async
{
//if (didPop) return;
debugPrint
(
""
);
debugPrint
(
"^^^^^^^^^^^^^^ Web page PopScope ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
${DateTime.now().toString()}
"
);
debugPrint
(
"^^^^^^^^^^^^^^ Web page PopScope
$didPop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
${DateTime.now().toString()}
"
);
debugPrint
(
""
);
//if (didPop) return;
await
ctx
.
read
<
WebCubit
>().
handleBack
();
},
child:
scaffold
,
...
...
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