Skip to content

Commit

Permalink
[breaking change]PageVisibility不再提供create和destroy方法,删除无用example_swift (
Browse files Browse the repository at this point in the history
…#1177)

* [breaking]PageVisibility不再提供create和destroy方法,业务将在initState和dispose,复用Widget原有能力,删除无用example_swift

* 更改全局路由监听器函数名称,使其更符合flutter内部语义
  • Loading branch information
luckysmg authored Jun 3, 2021
1 parent 82d640a commit e2f15b2
Show file tree
Hide file tree
Showing 74 changed files with 65 additions and 2,226 deletions.
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void main() {

class AppGlobalPageVisibilityObserver extends GlobalPageVisibilityObserver {
@override
void onPageCreate(Route<dynamic> route) {
void onPagePush(Route<dynamic> route) {
Logger.log(
'boost_lifecycle: AppGlobalPageVisibilityObserver.onPageCreate route:${route.settings.name}');
}
Expand All @@ -39,7 +39,7 @@ class AppGlobalPageVisibilityObserver extends GlobalPageVisibilityObserver {
}

@override
void onPageDestroy(Route<dynamic> route) {
void onPagePop(Route<dynamic> route) {
Logger.log(
'boost_lifecycle: AppGlobalPageVisibilityObserver.onPageDestroy route:${route.settings.name}');
}
Expand Down
24 changes: 6 additions & 18 deletions example3.0/lib/pages/lifecycle_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ class AppLifecycleObserver with GlobalPageVisibilityObserver {
}

@override
void onPageCreate(Route route) {
super.onPageCreate(route);
print("AppLifecycleObserver - onPageCreate");
void onPagePush(Route route) {
super.onPagePush(route);
print("AppLifecycleObserver - onPagePush");
}

@override
void onPageDestroy(Route route) {
super.onPageDestroy(route);
print("AppLifecycleObserver - onPageDestroy");
void onPagePop(Route route) {
super.onPagePop(route);
print("AppLifecycleObserver - onPagePop");
}

@override
Expand Down Expand Up @@ -63,18 +63,6 @@ class _LifecycleTestPageState extends State<LifecycleTestPage>
print("LifecycleTestPage - onForeground");
}

@override
void onPageCreate() {
super.onPageCreate();
print("LifecycleTestPage - onPageCreate");
}

@override
void onPageDestroy() {
super.onPageDestroy();
print("LifecycleTestPage - onPageDestroy");
}

@override
void onPageHide() {
super.onPageHide();
Expand Down
70 changes: 0 additions & 70 deletions example_swift/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions example_swift/.metadata

This file was deleted.

16 changes: 0 additions & 16 deletions example_swift/README.md

This file was deleted.

67 changes: 0 additions & 67 deletions example_swift/android/app/build.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions example_swift/android/app/src/debug/AndroidManifest.xml

This file was deleted.

33 changes: 0 additions & 33 deletions example_swift/android/app/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions example_swift/android/app/src/main/res/values/styles.xml

This file was deleted.

7 changes: 0 additions & 7 deletions example_swift/android/app/src/profile/AndroidManifest.xml

This file was deleted.

31 changes: 0 additions & 31 deletions example_swift/android/build.gradle

This file was deleted.

1 change: 0 additions & 1 deletion example_swift/android/gradle.properties

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions example_swift/android/settings.gradle

This file was deleted.

26 changes: 0 additions & 26 deletions example_swift/ios/Flutter/AppFrameworkInfo.plist

This file was deleted.

2 changes: 0 additions & 2 deletions example_swift/ios/Flutter/Debug.xcconfig

This file was deleted.

2 changes: 0 additions & 2 deletions example_swift/ios/Flutter/Release.xcconfig

This file was deleted.

Loading

0 comments on commit e2f15b2

Please sign in to comment.