pull/1489/head^2
Ellet 1 year ago
parent bd78a9b215
commit d80634007c
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 3
      CHANGELOG.md
  2. 2
      example/lib/main.dart
  3. 17
      lib/src/widgets/toolbar/buttons/color/color.dart
  4. 21
      lib/src/widgets/toolbar/buttons/link_style.dart
  5. 15
      lib/src/widgets/toolbar/buttons/search/search.dart

@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
## 8.5.5
* Now you when opening dialogs by `QuillToolbar` you will not get an exception when you don't use `FlutterQuillLocalizations.delegate` in your `WidgetsApp`, `MaterialApp` or `CupertinoApp`. The fix is for `QuillToolbarSearchButton`, `QuillToolbarLinkStyleButton` and `QuillToolbarColorButton` buttons
## 8.5.4
* The `mobileWidth`, `mobileHeight`, `mobileMargin` and `mobileAlignment` is now deprecated in `flutter_quill`, they are are now defined in `flutter_quill_extensions`
* Deprecate `replaceStyleStringWithSize` function which is in `string.dart`

@ -55,7 +55,7 @@ class MyApp extends StatelessWidget {
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
FlutterQuillLocalizations.delegate,
// FlutterQuillLocalizations.delegate,
],
supportedLocales: FlutterQuillLocalizations.supportedLocales,
routes: {

@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
import '../../../../extensions/quill_provider.dart';
import '../../../../l10n/extensions/localizations.dart';
import '../../../../l10n/widgets/localizations.dart';
import '../../../../models/documents/attribute.dart';
import '../../../../models/documents/style.dart';
import '../../../../models/themes/quill_icon_theme.dart';
import '../../../../utils/color.dart';
import '../../../controller.dart';
import '../../../utils/provider.dart';
import '../../base_toolbar.dart';
import 'dialog.dart';
@ -225,11 +227,16 @@ class QuillToolbarColorButtonState extends State<QuillToolbarColorButton> {
context: context,
barrierColor: options.dialogBarrierColor ??
context.requireQuillSharedConfigurations.dialogBarrierColor,
builder: (context) => ColorPickerDialog(
isBackground: widget.isBackground,
onRequestChangeColor: _changeColor,
isToggledColor: _isToggledColor,
selectionStyle: _selectionStyle,
builder: (_) => QuillProvider.value(
value: context.requireQuillProvider,
child: FlutterQuillLocalizationsWidget(
child: ColorPickerDialog(
isBackground: widget.isBackground,
onRequestChangeColor: _changeColor,
isToggledColor: _isToggledColor,
selectionStyle: _selectionStyle,
),
),
),
);
}

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import '../../../extensions/quill_provider.dart';
import '../../../l10n/extensions/localizations.dart';
import '../../../l10n/widgets/localizations.dart';
import '../../../models/documents/attribute.dart';
import '../../../models/rules/insert.dart';
import '../../../models/structs/link_dialog_action.dart';
@ -9,6 +10,7 @@ import '../../../models/themes/quill_dialog_theme.dart';
import '../../../models/themes/quill_icon_theme.dart';
import '../../controller.dart';
import '../../link.dart';
import '../../utils/provider.dart';
import '../base_toolbar.dart';
class QuillToolbarLinkStyleButton extends StatefulWidget {
@ -164,7 +166,7 @@ class QuillToolbarLinkStyleButtonState
final value = await showDialog<_TextLink>(
context: context,
barrierColor: dialogBarrierColor,
builder: (ctx) {
builder: (_) {
final link = _getLinkAttributeValue();
final index = controller.selection.start;
@ -179,12 +181,17 @@ class QuillToolbarLinkStyleButtonState
final len = controller.selection.end - index;
text ??= len == 0 ? '' : controller.document.getPlainText(index, len);
return _LinkDialog(
dialogTheme: options.dialogTheme,
link: link,
text: text,
linkRegExp: linkRegExp,
action: options.linkDialogAction,
return QuillProvider.value(
value: context.requireQuillProvider,
child: FlutterQuillLocalizationsWidget(
child: _LinkDialog(
dialogTheme: options.dialogTheme,
link: link,
text: text,
linkRegExp: linkRegExp,
action: options.linkDialogAction,
),
),
);
},
);

@ -2,9 +2,11 @@ import 'package:flutter/material.dart';
import '../../../../extensions/quill_provider.dart';
import '../../../../l10n/extensions/localizations.dart';
import '../../../../l10n/widgets/localizations.dart';
import '../../../../models/themes/quill_dialog_theme.dart';
import '../../../../models/themes/quill_icon_theme.dart';
import '../../../controller.dart';
import '../../../utils/provider.dart';
import '../../base_toolbar.dart';
class QuillToolbarSearchButton extends StatelessWidget {
@ -140,10 +142,15 @@ class QuillToolbarSearchButton extends StatelessWidget {
await showDialog<String>(
barrierColor: _dialogBarrierColor(context),
context: context,
builder: (_) => QuillToolbarSearchDialog(
controller: controller,
dialogTheme: _dialogTheme(context),
text: '',
builder: (_) => QuillProvider.value(
value: context.requireQuillProvider,
child: FlutterQuillLocalizationsWidget(
child: QuillToolbarSearchDialog(
controller: controller,
dialogTheme: _dialogTheme(context),
text: '',
),
),
),
);
}

Loading…
Cancel
Save