Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix navigator popping screen #4

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 70 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,75 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
*.g.dart
.DS_Store
.dart_tool/
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
.env
# Visual Studio Code related
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
test/test.jpg

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/flutter_export_environment.sh
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
example/ios/Flutter/flutter_export_environment.sh

build/
ios/.generated/
ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
11 changes: 0 additions & 11 deletions example/ios/Flutter/flutter_export_environment.sh

This file was deleted.

1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
new RaisedButton(
onPressed: () async {
var arr = ['a', 'b', 'c'];
try {
String ret = await Alert.select(context,
options: [
Expand Down
52 changes: 26 additions & 26 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,65 @@ packages:
dependency: transitive
description:
name: archive
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
args:
dependency: transitive
description:
name: args
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
version: "0.1.3"
easy_alert:
dependency: "direct main"
description:
Expand All @@ -85,49 +85,49 @@ packages:
dependency: transitive
description:
name: image
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
sky_engine:
Expand All @@ -139,63 +139,63 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.11"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "3.5.0"
sdks:
Expand Down
22 changes: 12 additions & 10 deletions lib/src/alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class Alert {
child: Text(cancel),
onPressed: () {
completer.complete(Alert.CANCEL);
Navigator.pop(context);
Navigator.of(context, rootNavigator: true).pop();
},
),
CupertinoDialogAction(
child: Text(ok),
onPressed: () {
completer.complete(Alert.OK);
Navigator.pop(context);
Navigator.of(context, rootNavigator: true).pop();
},
),
],
Expand All @@ -76,14 +76,14 @@ class Alert {
child: new Text(cancel),
onPressed: () {
completer.complete(Alert.CANCEL);
Navigator.of(context).pop();
Navigator.of(context, rootNavigator: true).pop();
},
),
new FlatButton(
child: new Text(ok),
onPressed: () {
completer.complete(Alert.OK);
Navigator.of(context).pop();
Navigator.of(context, rootNavigator: true).pop();
},
),
],
Expand Down Expand Up @@ -122,7 +122,8 @@ class Alert {
CupertinoDialogAction(
child: Text(ok),
onPressed: () {
Navigator.pop(context, controller.text);
Navigator.of(context, rootNavigator: true)
.pop(controller.text);
},
),
],
Expand All @@ -138,7 +139,8 @@ class Alert {
new FlatButton(
child: new Text(ok),
onPressed: () {
Navigator.pop(context, controller.text);
Navigator.of(context, rootNavigator: true)
.pop(controller.text);
},
),
],
Expand Down Expand Up @@ -187,7 +189,7 @@ class Alert {
CupertinoDialogAction(
child: Text(ok),
onPressed: () {
Navigator.pop(context, Alert.OK);
Navigator.of(context, rootNavigator: true).pop(Alert.OK);
},
),
],
Expand All @@ -200,7 +202,7 @@ class Alert {
new FlatButton(
child: new Text(ok),
onPressed: () {
Navigator.pop(context, Alert.OK);
Navigator.of(context, rootNavigator: true).pop(Alert.OK);
},
),
],
Expand All @@ -226,11 +228,11 @@ class Alert {
values: values,
index: index,
onSelectedItemChanged: (int index) {
Navigator.pop(context, index);
Navigator.of(context).pop(index);
completer.complete(index);
},
onCancel: () {
Navigator.pop(context, null);
Navigator.of(context).pop(null);
},
);
}).then((var value) {
Expand Down
Loading