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
4 changes: 4 additions & 0 deletions quill_native_bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 11.0.1

- Adds `isAppleSafari` method to check whether the current web app is running on Safari browser.

## 11.0.0

- Improves `README.md`. Adds more details to `README.md`.
Expand Down
7 changes: 7 additions & 0 deletions quill_native_bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ For details about the plugin architecture, refer to the [README of the repo](../
| **openGalleryApp** | ✅ | ✅ | ✅ | ✅ | ⚪ | ⚪ |
| **saveImageToGallery** | ✅ | ✅ | ✅ | ❌ | ⚪ | ⚪ |
| **saveImage** | ⚪ | ⚪ | ✅ | ✅ | ✅ | ✅ |
| **isAppleSafari** | ⚪ | ⚪ | ⚪ | ⚪ | ⚪ | ✅ |

- `⚪`: Not applicable, not expected, or unsupported on this platform (e.g., checking **iOS simulator** on **Android**, saving images to the gallery on the web, or retrieving GIFs on desktop/web).
- `❌`: The plugin doesn't currently implement it.
Expand Down Expand Up @@ -110,6 +111,12 @@ final Uint8List imageBytes = ...; // Load the image bytes
await QuillNativeBridge().saveImage(imageBytes, options: ImageSaveOptions(name: 'ExampleImageName', fileExtension: 'png')); // Doesn't work on mobile platforms
```

**To check whether the current web app is running on a browser**:

```dart
await QuillNativeBridge().isAppleBrowser(); // Returns false on non-web platforms.
```

## 🔧 Setup

Certain functionalities require a platform-specific configuration.
Expand Down
20 changes: 20 additions & 0 deletions quill_native_bridge/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ class Buttons extends StatelessWidget {
label: const Text('Save image'),
icon: const Icon(Icons.image),
),
ElevatedButton.icon(
onPressed: () => _onButtonPressed(
QuillNativeBridgeFeature.isAppleSafari,
context: context,
),
label: const Text('Is Safari'),
icon: const Icon(Icons.apple),
),
],
);
}
Expand Down Expand Up @@ -370,6 +378,18 @@ Future<void> _onButtonPressed(
}
scaffoldMessenger.showText('The image has been saved at: $imagePath.');
break;
case QuillNativeBridgeFeature.isAppleSafari:
if (!kIsWeb) {
scaffoldMessenger.showText(
'Checking whether the browser is Safari is only supported on the web.');
return;
}
if (quillNativeBridge.isAppleSafari()) {
scaffoldMessenger.showText("You're running this app on Safari browser");
} else {
scaffoldMessenger
.showText("You're not running this app on Safari browser");
}
}
}

Expand Down
Loading
Loading