Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[android_intent] Add action_application_details_settings #2045

Merged
merged 2 commits into from
Sep 5, 2019
Merged
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
4 changes: 4 additions & 0 deletions packages/android_intent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.3+1

* Added "action_application_details_settings" action to open application info settings .

## 0.3.3

* Added "flags" option to call intent.addFlags(int) in native.
Expand Down
13 changes: 13 additions & 0 deletions packages/android_intent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ for it in the plugin and use an action constant to refer to it. For instance:

`'action_location_source_settings'` translates to `android.settings.LOCATION_SOURCE_SETTINGS`

`'action_application_details_settings'` translates to `android.settings.ACTION_APPLICATION_DETAILS_SETTINGS`

```dart
if (platform.isAndroid) {
final AndroidIntent intent = AndroidIntent(
action: 'action_application_details_settings',
data: 'package:com.example.app', // replace com.example.app with your applicationId
);
await intent.launch();
}

```

Feel free to add support for additional Android intents.

The Dart values supported for the arguments parameter, and their corresponding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ private String convertAction(String action) {
return Settings.ACTION_SETTINGS;
case "action_location_source_settings":
return Settings.ACTION_LOCATION_SOURCE_SETTINGS;
case "action_application_details_settings":
return Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
default:
return action;
}
Expand Down
14 changes: 14 additions & 0 deletions packages/android_intent/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ class ExplicitIntentsWidget extends StatelessWidget {
intent.launch();
}

void _openApplicationDetails() {
final AndroidIntent intent = const AndroidIntent(
action: 'action_application_details_settings',
data: 'package:io.flutter.plugins.androidintentexample',
);
intent.launch();
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down Expand Up @@ -186,6 +194,12 @@ class ExplicitIntentsWidget extends StatelessWidget {
'Tap here to open Location Settings Configuration',
),
onPressed: _openLocationSettingsConfiguration,
),
RaisedButton(
child: const Text(
'Tap here to open Application Details',
),
onPressed: _openApplicationDetails,
)
],
),
Expand Down
2 changes: 1 addition & 1 deletion packages/android_intent/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: android_intent
description: Flutter plugin for launching Android Intents. Not supported on iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/android_intent
version: 0.3.3
version: 0.3.3+1

flutter:
plugin:
Expand Down