Skip to content
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
38 changes: 28 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
name: Publish to pub.dev
name: Validate and publish

on:
push:
branches:
- 'main'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- 'main'

jobs:
publish:
strategy:
matrix:
flutter-version:
- "3.13.0"
validate-and-publish:
permissions:
id-token: write
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4

- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: stable
cache: true

- name: 🔎 Show tool versions
run: |
flutter --version
dart --version
xcodebuild -version
pod --version

- name: 📦 Install Dependencies
run: flutter pub get

- name: ✨ Check Formatting
run: dart format --set-exit-if-changed .

- name: 🕵️ Analyze
run: dart analyze --fatal-infos --fatal-warnings .

- name: 🧪 Test
run: flutter test

- name: 🍎 Validate iOS example with Swift Package Manager
run: |
flutter config --enable-swift-package-manager
flutter pub get
flutter build ios --no-codesign --verbose
working-directory: example

- name: 🚀 Publish
run: dart pub publish --force
if: startsWith(github.ref, 'refs/tags/v')
run: dart pub publish --force
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ migrate_working_dir/
.dart_tool/
.packages
build/
.build/
.swiftpm/
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.5.0

### 💡 Technical Improvements
- Added iOS Swift Package Manager support while keeping CocoaPods compatibility.
- Moved the iOS Swift plugin source into the SwiftPM target layout and updated the podspec source path.
- Raised the Flutter/Dart lower bounds required by Flutter's current SPM plugin integration.
- Updated the example app to opt into Swift Package Manager and added macOS CI validation for `flutter build ios --no-codesign`.

## 0.4.2

### 🚀 New Features
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ We are aware that the shortcuts in open_settings_plus are not functioning proper

A fix is being actively worked on and will be released as soon as possible.

## 📦 Installation

Add `open_settings_plus` to your `pubspec.yaml` as usual. On iOS, the plugin supports both CocoaPods and Swift Package Manager (SPM). CocoaPods remains supported for existing Flutter projects, while SPM is available when using Flutter `3.41.0` or newer with Flutter's Swift Package Manager integration enabled. The iOS deployment target is `12.0`.

## 🚀 Usage

To integrate `open_settings_plus` into your project, add it as a dependency in your `pubspec.yaml` file.
Expand Down
10 changes: 2 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,15 @@ class MyApp extends StatelessWidget {
const SliverAppBar(
pinned: true,
backgroundColor: Colors.blue,
flexibleSpace: FlexibleSpaceBar(
title: Text("Open settings +"),
),
flexibleSpace: FlexibleSpaceBar(title: Text("Open settings +")),
centerTitle: true,
expandedHeight: 220,
),
],
body: switch (OpenSettingsPlus.shared) {
OpenSettingsPlusAndroid settings => _buildAndroidList(settings),
OpenSettingsPlusIOS settings => _buildIOSList(settings),
_ => const Center(
child: Text(
"Unsupported platform.",
),
),
_ => const Center(child: Text("Unsupported platform.")),
},
),
),
Expand Down
4 changes: 3 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish_to: "none"
version: 1.0.0+1

environment:
sdk: ">=3.1.0"
sdk: ^3.11.0

dependencies:
flutter:
Expand All @@ -25,3 +25,5 @@ dev_dependencies:

flutter:
uses-material-design: true
config:
enable-swift-package-manager: true
Empty file removed ios/Assets/.gitkeep
Empty file.
6 changes: 3 additions & 3 deletions ios/open_settings_plus.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'open_settings_plus'
s.version = '0.0.1'
s.version = '0.5.0'
s.summary = 'Open settings easily.'
s.description = <<-DESC
The most complete flutter plugin packages for open various settings screen, covering newer versions of ios and android.
Expand All @@ -13,9 +13,9 @@ Pod::Spec.new do |s|
s.license = { :file => '../LICENSE' }
s.author = { 'Yann Cabral' => 'iamyanndias@gmail.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.source_files = 'open_settings_plus/Sources/open_settings_plus/**/*'
s.dependency 'Flutter'
s.platform = :ios, '11.0'
s.platform = :ios, '12.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
23 changes: 23 additions & 0 deletions ios/open_settings_plus/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
name: "open_settings_plus",
platforms: [
.iOS("12.0")
],
products: [
.library(name: "open-settings-plus", targets: ["open_settings_plus"])
],
dependencies: [
.package(name: "FlutterFramework", path: "../FlutterFramework")
],
targets: [
.target(
name: "open_settings_plus",
dependencies: [
.product(name: "FlutterFramework", package: "FlutterFramework")
]
)
]
)
9 changes: 3 additions & 6 deletions lib/bridge/open_settings_plus_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ class MethodChannelOpenSettingsPlus extends OpenSettingsPlusPlatform {

@override
Future<bool> sendMessageToNative(String message) async {
final success = await methodChannel.invokeMethod<bool>(
'openSettings',
{
'settingToOpen': message,
},
);
final success = await methodChannel.invokeMethod<bool>('openSettings', {
'settingToOpen': message,
});

return success ?? false;
}
Expand Down
Loading
Loading