fix: A bug in quill extensions

pull/1564/head
Ellet 1 year ago
parent 125b349d7c
commit 4bf7ae7fd4
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 33
      .github/workflows/build.yml
  2. 6
      .github/workflows/main.yml
  3. 1
      .pubignore
  4. 4
      flutter_quill_extensions/CHANGELOG.md
  5. 2
      flutter_quill_extensions/README.md
  6. 13
      flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/image_button.dart
  7. 3
      flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart
  8. 1
      flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart
  9. 11
      flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/video_button.dart
  10. 4
      flutter_quill_extensions/pubspec.yaml
  11. 8
      scripts/before-push.sh

@ -0,0 +1,33 @@
name: Build the example
on:
pull_request:
branches: [master]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Check flutter version
run: flutter --version
- name: Install dependencies
run: flutter pub get
- name: Flutter build Web
run: flutter build web --release --verbose --dart-define=CI=true
working-directory: ./example
- name: Install flutter Linux prerequisites
run: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y
- name: Flutter build Linux
run: flutter build linux --release --verbose --dart-define=CI=true
working-directory: ./example

@ -47,9 +47,9 @@ jobs:
- name: Run flutter tests - name: Run flutter tests
run: flutter test run: flutter test
- name: Flutter build Web # - name: Flutter build Web
run: flutter build web --release --verbose --dart-define=CI=true # run: flutter build web --release --verbose --dart-define=CI=true
working-directory: ./example # working-directory: ./example
# - name: Install flutter Linux prerequisites # - name: Install flutter Linux prerequisites
# run: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y # run: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y

@ -9,6 +9,7 @@ pubspec_overrides.yaml.disabled
example/.fvm/ example/.fvm/
example/build/ example/build/
example/.dart_tool/ example/.dart_tool/
example/assets/images/
scripts/ scripts/
<!-- flutter_quill_extensions/ <!-- flutter_quill_extensions/

@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## 0.7.2
* Fix a bug when opening the link dialog for both video and image buttons
* Update `README.md`
## 0.7.1 ## 0.7.1
* Update the minimum flutter version to `3.16.0` * Update the minimum flutter version to `3.16.0`

@ -246,6 +246,8 @@ OnDragDoneCallback get _onDragDone {
- Handle different errors - Handle different errors
``` ```
Please notice that the saving image functionality is not supported on Linux yet.
## Contributing ## Contributing
We welcome contributions! We welcome contributions!

@ -172,10 +172,15 @@ class QuillToolbarImageButton extends StatelessWidget {
Future<String?> _typeLink(BuildContext context) async { Future<String?> _typeLink(BuildContext context) async {
final value = await showDialog<String>( final value = await showDialog<String>(
context: context, context: context,
builder: (_) => TypeLinkDialog( builder: (_) => QuillProvider.value(
dialogTheme: options.dialogTheme, value: context.requireQuillProvider,
linkRegExp: options.linkRegExp, child: FlutterQuillLocalizationsWidget(
linkType: LinkType.image, child: TypeLinkDialog(
dialogTheme: options.dialogTheme,
linkRegExp: options.linkRegExp,
linkType: LinkType.image,
),
),
), ),
); );
return value; return value;

@ -14,6 +14,7 @@ class SelectImageSourceDialog extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
// TODO: Needs to be translated
ListTile( ListTile(
title: const Text('Gallery'), title: const Text('Gallery'),
subtitle: const Text( subtitle: const Text(
@ -53,7 +54,7 @@ Future<InsertImageSource?> showSelectImageSourceDialog({
showDragHandle: true, showDragHandle: true,
context: context, context: context,
constraints: const BoxConstraints(maxWidth: 640), constraints: const BoxConstraints(maxWidth: 640),
builder: (context) => const SelectImageSourceDialog(), builder: (_) => const SelectImageSourceDialog(),
); );
return imageSource; return imageSource;
} }

@ -14,6 +14,7 @@ class SelectVideoSourceDialog extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
// TODO: Needs to be translated
ListTile( ListTile(
title: const Text('Gallery'), title: const Text('Gallery'),
subtitle: const Text( subtitle: const Text(

@ -164,9 +164,14 @@ class QuillToolbarVideoButton extends StatelessWidget {
Future<String?> _typeLink(BuildContext context) async { Future<String?> _typeLink(BuildContext context) async {
final value = await showDialog<String>( final value = await showDialog<String>(
context: context, context: context,
builder: (_) => TypeLinkDialog( builder: (_) => QuillProvider.value(
dialogTheme: options.dialogTheme, value: context.requireQuillProvider,
linkType: LinkType.video, child: FlutterQuillLocalizationsWidget(
child: TypeLinkDialog(
dialogTheme: options.dialogTheme,
linkType: LinkType.video,
),
),
), ),
); );
return value; return value;

@ -1,6 +1,6 @@
name: flutter_quill_extensions name: flutter_quill_extensions
description: Embed extensions for flutter_quill including image, video, formula and etc. description: Embed extensions for flutter_quill including image, video, formula and etc.
version: 0.7.1 version: 0.7.2
homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions
repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions
@ -13,7 +13,7 @@ topics:
platforms: platforms:
android: android:
ios: ios:
# linux: linux:
macos: macos:
web: web:
windows: windows:

@ -21,7 +21,13 @@ echo "Running 'dart format .'"
dart format . dart format .
# Check dart code formatting # Check dart code formatting
echo "Running `dart format --set-exit-if-changed .`" echo "Running 'dart format --set-exit-if-changed .'"
dart format --set-exit-if-changed . dart format --set-exit-if-changed .
# Check flutter web example
echo "Running flutter build web --release --dart-define=CI=true."
(cd example && flutter build web --release --dart-define=CI=true)
echo ""
echo "Script completed." echo "Script completed."

Loading…
Cancel
Save