Skip to content

Commit 2e341b7

Browse files
authored
Merge pull request #64 from yosemiteyss/feat/merge-dev-to-main
merge dev to main
2 parents 4b0e99d + 426b067 commit 2e341b7

File tree

16 files changed

+112
-288
lines changed

16 files changed

+112
-288
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Dart SDK
15+
uses: dart-lang/setup-dart@v1
16+
17+
- name: Install dependencies
18+
run: dart pub get
19+
20+
- name: Run tests
21+
run: dart test
22+
23+
- name: Setup pub.dev credentials
24+
run: |
25+
mkdir -p ${{ runner.workspace }}/.config/dart
26+
echo "$CREDENTIAL_JSON" > ${{ runner.workspace }}/.config/dart/pub-credentials.json
27+
if [ -n "$XDG_CONFIG_HOME" ]; then
28+
mkdir -p $XDG_CONFIG_HOME/dart
29+
cp ${{ runner.workspace }}/.config/dart/pub-credentials.json $XDG_CONFIG_HOME/dart/pub-credentials.json
30+
else
31+
mkdir -p $HOME/.config/dart
32+
cp ${{ runner.workspace }}/.config/dart/pub-credentials.json $HOME/.config/dart/pub-credentials.json
33+
fi
34+
env:
35+
CREDENTIAL_JSON: ${{ secrets.CREDENTIAL_JSON }}
36+
XDG_CONFIG_HOME: ${{ env.XDG_CONFIG_HOME }}
37+
38+
- name: Publish to pub.dev
39+
run: dart pub publish -f
40+
41+
- name: Create release branch
42+
uses: peterjgrainger/[email protected]
43+
with:
44+
branch: release/${{ github.event.release.tag_name }}
45+
sha: '${{ github.event.pull_request.head.sha }}'
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
FLUTTER_CHANNEL: 'stable'
15-
FLUTTER_VERSION: '3.10.2'
15+
FLUTTER_VERSION: '3.13.4'
1616

1717
jobs:
1818
build_example_android:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.3.0
2+
* iOS: fix volume slider not shown when pressing physical buttons after `showSystemUI` is reset.
3+
* Deprecated: `showSystemUI` setter is deprecated and migrated to `updateShowSystemUI`.
4+
15
## 1.2.7
26
* Fixed audio session not activated with ambient state on iOS.
37

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ A Flutter plugin to control system volume and listen for volume changes on diffe
2727

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

3536
#### Get Volume
@@ -153,9 +154,13 @@ void dispose() {
153154
a rounded off value.
154155

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

160+
#### Controlling Android volume slider UI
161+
- Currently there is no trivial way to control the volume slider invoked by physical buttons on
162+
Android in plugin level. You may override `FlutterActivity::onKeyDown` to customize the buttons action.
163+
159164
## Having Bugs?
160165
- This package is under active development. If you find any bug, please create an issue on Github.
161166

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ migrate_working_dir/
3131
.pub-cache/
3232
.pub/
3333
/build/
34+
pubspec.lock
3435

3536
# Web related
3637
lib/generated_plugin_registrant.dart

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1430"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/ios/Runner/Info.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleDisplayName</key>
@@ -24,6 +26,8 @@
2426
<string>$(FLUTTER_BUILD_NUMBER)</string>
2527
<key>LSRequiresIPhoneOS</key>
2628
<true/>
29+
<key>UIApplicationSupportsIndirectInputEvents</key>
30+
<true/>
2731
<key>UILaunchStoryboardName</key>
2832
<string>LaunchScreen</string>
2933
<key>UIMainStoryboardFile</key>
@@ -43,9 +47,5 @@
4347
</array>
4448
<key>UIViewControllerBasedStatusBarAppearance</key>
4549
<false/>
46-
<key>CADisableMinimumFrameDurationOnPhone</key>
47-
<true/>
48-
<key>UIApplicationSupportsIndirectInputEvents</key>
49-
<true/>
5050
</dict>
5151
</plist>

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class _HomeState extends State<Home> {
6868
child: ElevatedButton(
6969
child: const Text('Show or hide system ui'),
7070
onPressed: () {
71-
FlutterVolumeController.showSystemUI =
72-
!FlutterVolumeController.showSystemUI;
71+
FlutterVolumeController.updateShowSystemUI(
72+
!FlutterVolumeController.showSystemUI);
7373
_showSnackBar(
7474
'Show system ui: ${FlutterVolumeController.showSystemUI}',
7575
);

0 commit comments

Comments
 (0)