Skip to content

Commit 5d82077

Browse files
author
caven775
committed
flutter的dialog进栈
1 parent 3aab956 commit 5d82077

File tree

7 files changed

+143
-67
lines changed

7 files changed

+143
-67
lines changed

example/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ SPEC CHECKSUMS:
1919

2020
PODFILE CHECKSUM: 9d0ac94d3d11f2290fe3fb976f070609fc82675b
2121

22-
COCOAPODS: 1.9.3
22+
COCOAPODS: 1.10.0

example/ios/Runner/AppDelegate.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,18 @@ - (BOOL)application:(UIApplication *)application
5050
self.window.backgroundColor = [UIColor whiteColor];
5151
self.window.rootViewController = rootVC;
5252
[self.window makeKeyAndVisible];
53+
[self testChannel];
5354
return YES;
5455
}
5556

57+
58+
- (void)testChannel
59+
{
60+
FlutterMethodChannel *channel = [DStack sharedInstance].engine.navigationChannel;
61+
62+
}
63+
64+
5665
/// 当项目中tabBarController的viewControllers里面有DFlutterViewController
5766
/// 或者NavigationViewController的rootViewController是DFlutterViewController作为入口时
5867
/// 项目中必须实现tabBarController的delegate的,

example/lib/page_widgets.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Student {
1717
String address;
1818
}
1919

20-
Widget _caseWidget(List<Map> items) {
20+
Widget _caseWidget(List<Map> items, {BuildContext context}) {
2121
return Center(
2222
child: ListView.builder(
2323
itemExtent: 60,
@@ -33,7 +33,9 @@ Widget _caseWidget(List<Map> items) {
3333
Border(bottom: BorderSide(color: Colors.grey, width: 0.5))),
3434
child: Text(caseMap["text"]),
3535
),
36-
onTap: caseMap["clicked"],
36+
onTap: () {
37+
caseMap["clicked"](context);
38+
},
3739
);
3840
},
3941
),
@@ -75,7 +77,7 @@ class Page2 extends StatelessWidget {
7577
DStack.pop();
7678
},
7779
)),
78-
body: _caseWidget(TestCase.closeFlutterPage),
80+
body: _caseWidget(TestCase.closeFlutterPage, context: context),
7981
);
8082
}
8183
}

0 commit comments

Comments
 (0)