dartlangeditorflutterflutter-appsflutter-examplesflutter-packageflutter-widgetquillquill-deltaquilljsreactquillrich-textrich-text-editorwysiwygwysiwyg-editor
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.0 KiB
27 lines
1.0 KiB
1 year ago
|
import 'package:flutter/widgets.dart' show BuildContext;
|
||
|
|
||
1 year ago
|
import '../generated/quill_localizations.dart' as generated;
|
||
1 year ago
|
|
||
|
typedef FlutterQuillLocalizations = generated.FlutterQuillLocalizations;
|
||
|
|
||
10 months ago
|
class MissingFlutterQuillLocalizationException extends UnimplementedError {
|
||
|
MissingFlutterQuillLocalizationException();
|
||
|
@override
|
||
|
String? get message =>
|
||
|
'FlutterQuillLocalizations instance is required and could not found. '
|
||
|
'Ensure that you are wrapping the current widget with '
|
||
|
'FlutterQuillLocalizationsWidget or add '
|
||
|
'FlutterQuillLocalizations.delegate to the localizationsDelegates '
|
||
|
'in your App widget (e.,g WidgetsApp, MaterialApp). If you believe this is a bug, consider reporting it.';
|
||
|
}
|
||
|
|
||
1 year ago
|
extension LocalizationsExt on BuildContext {
|
||
|
/// Require the [FlutterQuillLocalizations] instance
|
||
|
///
|
||
1 year ago
|
/// `loc` is short for `localizations`
|
||
1 year ago
|
FlutterQuillLocalizations get loc {
|
||
|
return FlutterQuillLocalizations.of(this) ??
|
||
10 months ago
|
(throw MissingFlutterQuillLocalizationException());
|
||
1 year ago
|
}
|
||
|
}
|