Skip to content

Commit 4bf7ae7

Browse files
author
Ellet
committed
fix: A bug in quill extensions
1 parent 125b349 commit 4bf7ae7

File tree

11 files changed

+72
-14
lines changed

11 files changed

+72
-14
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build the example
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: subosito/flutter-action@v2
14+
with:
15+
channel: 'stable'
16+
cache: true
17+
18+
- name: Check flutter version
19+
run: flutter --version
20+
21+
- name: Install dependencies
22+
run: flutter pub get
23+
24+
- name: Flutter build Web
25+
run: flutter build web --release --verbose --dart-define=CI=true
26+
working-directory: ./example
27+
28+
- name: Install flutter Linux prerequisites
29+
run: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y
30+
31+
- name: Flutter build Linux
32+
run: flutter build linux --release --verbose --dart-define=CI=true
33+
working-directory: ./example

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
- name: Run flutter tests
4848
run: flutter test
4949

50-
- name: Flutter build Web
51-
run: flutter build web --release --verbose --dart-define=CI=true
52-
working-directory: ./example
50+
# - name: Flutter build Web
51+
# run: flutter build web --release --verbose --dart-define=CI=true
52+
# working-directory: ./example
5353

5454
# - name: Install flutter Linux prerequisites
5555
# run: sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y

.pubignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pubspec_overrides.yaml.disabled
99
example/.fvm/
1010
example/build/
1111
example/.dart_tool/
12+
example/assets/images/
1213

1314
scripts/
1415
<!-- flutter_quill_extensions/

flutter_quill_extensions/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
## 0.7.2
6+
* Fix a bug when opening the link dialog for both video and image buttons
7+
* Update `README.md`
8+
59
## 0.7.1
610
* Update the minimum flutter version to `3.16.0`
711

flutter_quill_extensions/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ OnDragDoneCallback get _onDragDone {
246246
- Handle different errors
247247
```
248248

249+
Please notice that the saving image functionality is not supported on Linux yet.
250+
249251
## Contributing
250252

251253
We welcome contributions!

flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/image_button.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,15 @@ class QuillToolbarImageButton extends StatelessWidget {
172172
Future<String?> _typeLink(BuildContext context) async {
173173
final value = await showDialog<String>(
174174
context: context,
175-
builder: (_) => TypeLinkDialog(
176-
dialogTheme: options.dialogTheme,
177-
linkRegExp: options.linkRegExp,
178-
linkType: LinkType.image,
175+
builder: (_) => QuillProvider.value(
176+
value: context.requireQuillProvider,
177+
child: FlutterQuillLocalizationsWidget(
178+
child: TypeLinkDialog(
179+
dialogTheme: options.dialogTheme,
180+
linkRegExp: options.linkRegExp,
181+
linkType: LinkType.image,
182+
),
183+
),
179184
),
180185
);
181186
return value;

flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/select_image_source.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class SelectImageSourceDialog extends StatelessWidget {
1414
child: SingleChildScrollView(
1515
child: Column(
1616
children: [
17+
// TODO: Needs to be translated
1718
ListTile(
1819
title: const Text('Gallery'),
1920
subtitle: const Text(
@@ -53,7 +54,7 @@ Future<InsertImageSource?> showSelectImageSourceDialog({
5354
showDragHandle: true,
5455
context: context,
5556
constraints: const BoxConstraints(maxWidth: 640),
56-
builder: (context) => const SelectImageSourceDialog(),
57+
builder: (_) => const SelectImageSourceDialog(),
5758
);
5859
return imageSource;
5960
}

flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/select_video_source.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class SelectVideoSourceDialog extends StatelessWidget {
1414
child: SingleChildScrollView(
1515
child: Column(
1616
children: [
17+
// TODO: Needs to be translated
1718
ListTile(
1819
title: const Text('Gallery'),
1920
subtitle: const Text(

flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/video_button.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,14 @@ class QuillToolbarVideoButton extends StatelessWidget {
164164
Future<String?> _typeLink(BuildContext context) async {
165165
final value = await showDialog<String>(
166166
context: context,
167-
builder: (_) => TypeLinkDialog(
168-
dialogTheme: options.dialogTheme,
169-
linkType: LinkType.video,
167+
builder: (_) => QuillProvider.value(
168+
value: context.requireQuillProvider,
169+
child: FlutterQuillLocalizationsWidget(
170+
child: TypeLinkDialog(
171+
dialogTheme: options.dialogTheme,
172+
linkType: LinkType.video,
173+
),
174+
),
170175
),
171176
);
172177
return value;

flutter_quill_extensions/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_quill_extensions
22
description: Embed extensions for flutter_quill including image, video, formula and etc.
3-
version: 0.7.1
3+
version: 0.7.2
44
homepage: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions
55
repository: https://github.com/singerdmx/flutter-quill/tree/master/flutter_quill_extensions
66

@@ -13,7 +13,7 @@ topics:
1313
platforms:
1414
android:
1515
ios:
16-
# linux:
16+
linux:
1717
macos:
1818
web:
1919
windows:

scripts/before-push.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ echo "Running 'dart format .'"
2121
dart format .
2222

2323
# Check dart code formatting
24-
echo "Running `dart format --set-exit-if-changed .`"
24+
echo "Running 'dart format --set-exit-if-changed .'"
2525
dart format --set-exit-if-changed .
2626

27+
# Check flutter web example
28+
echo "Running flutter build web --release --dart-define=CI=true."
29+
(cd example && flutter build web --release --dart-define=CI=true)
30+
31+
echo ""
32+
2733
echo "Script completed."

0 commit comments

Comments
 (0)