Skip to content

Commit

Permalink
Merge branch 'development' into feat/merge-dev-to-main
Browse files Browse the repository at this point in the history
  • Loading branch information
yosemiteyss committed Oct 17, 2023
2 parents 4b0e99d + 6dce88d commit 426b067
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 288 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish package

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1

- name: Install dependencies
run: dart pub get

- name: Run tests
run: dart test

- name: Setup pub.dev credentials
run: |
mkdir -p ${{ runner.workspace }}/.config/dart
echo "$CREDENTIAL_JSON" > ${{ runner.workspace }}/.config/dart/pub-credentials.json
if [ -n "$XDG_CONFIG_HOME" ]; then
mkdir -p $XDG_CONFIG_HOME/dart
cp ${{ runner.workspace }}/.config/dart/pub-credentials.json $XDG_CONFIG_HOME/dart/pub-credentials.json
else
mkdir -p $HOME/.config/dart
cp ${{ runner.workspace }}/.config/dart/pub-credentials.json $HOME/.config/dart/pub-credentials.json
fi
env:
CREDENTIAL_JSON: ${{ secrets.CREDENTIAL_JSON }}
XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }}

- name: Publish to pub.dev
run: dart pub publish -f

- name: Create release branch
uses: peterjgrainger/[email protected]
with:
branch: release/${{ github.event.release.tag_name }}
sha: '${{ github.event.pull_request.head.sha }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '3.10.2'
FLUTTER_VERSION: '3.13.4'

jobs:
build_example_android:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.0
* iOS: fix volume slider not shown when pressing physical buttons after `showSystemUI` is reset.
* Deprecated: `showSystemUI` setter is deprecated and migrated to `updateShowSystemUI`.

## 1.2.7
* Fixed audio session not activated with ambient state on iOS.

Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ A Flutter plugin to control system volume and listen for volume changes on diffe

#### Control System UI Visibility
- Set to `true` to display system volume slider when changing volume.
- This settings only works on Android and iOS.
- This setting only works on Android and iOS.
- Note: this setting doesn't control the volume slider invoked by physical buttons on Android.
```dart
FlutterVolumeController.showSystemUI = true;
await FlutterVolumeController.updateShowSystemUI(true);
```

#### Get Volume
Expand Down Expand Up @@ -153,9 +154,13 @@ void dispose() {
a rounded off value.

#### Audio devices without volume control
- On desktop platforms like Windows and Linux, you may encounter PlatformExceptions if the default
- On desktop platforms like Windows and Linux, you may encounter `PlatformException` if the default
audio device doesn't support volume control, like an external monitor.

#### Controlling Android volume slider UI
- Currently there is no trivial way to control the volume slider invoked by physical buttons on
Android in plugin level. You may override `FlutterActivity::onKeyDown` to customize the buttons action.

## Having Bugs?
- This package is under active development. If you find any bug, please create an issue on Github.

Expand Down
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ migrate_working_dir/
.pub-cache/
.pub/
/build/
pubspec.lock

# Web related
lib/generated_plugin_registrant.dart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -24,6 +26,8 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -43,9 +47,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class _HomeState extends State<Home> {
child: ElevatedButton(
child: const Text('Show or hide system ui'),
onPressed: () {
FlutterVolumeController.showSystemUI =
!FlutterVolumeController.showSystemUI;
FlutterVolumeController.updateShowSystemUI(
!FlutterVolumeController.showSystemUI);
_showSnackBar(
'Show system ui: ${FlutterVolumeController.showSystemUI}',
);
Expand Down
Loading

0 comments on commit 426b067

Please sign in to comment.