Remove Unused plugins in the example, update README.md, add more exports in flutter_quill_extensions

pull/1507/head
Ellet 1 year ago
parent ae7c0c9bb3
commit 4869edbf87
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 3
      CHANGELOG.md
  2. 34
      README.md
  3. 18
      example/README.md
  4. 21
      example/lib/pages/home_page.dart
  5. 19
      example/lib/widgets/demo_scaffold.dart
  6. 6
      example/pubspec.yaml
  7. 3
      flutter_quill_extensions/CHANGELOG.md
  8. 5
      flutter_quill_extensions/lib/flutter_quill_extensions.dart
  9. 0
      flutter_quill_extensions/lib/logic/models/config/shared_configurations.dart
  10. 3
      flutter_quill_extensions/lib/presentation/embeds/toolbar/camera_button/camera_button.dart
  11. 2
      flutter_quill_extensions/lib/presentation/embeds/toolbar/image_button/image_button.dart
  12. 2
      flutter_quill_extensions/lib/presentation/embeds/toolbar/video_button/video_button.dart
  13. 2
      flutter_quill_extensions/lib/presentation/embeds/utils.dart
  14. 2
      flutter_quill_extensions/pubspec.yaml
  15. 2
      pubspec.yaml

@ -1,3 +1,6 @@
## [8.2.1]
- Update `README.md`
## [8.2.0]
- Add the option to add configurations for `flutter_quill_extensions` using `extraConfigurations`

@ -150,10 +150,6 @@ The `QuillToolbar` class lets you customize which formatting options are availab
For **web development**, use `flutter config --enable-web` for flutter or use [ReactQuill] for React.
It is required to provide `EmbedBuilder`, e.g. [defaultEmbedBuildersWeb](https://github.com/singerdmx/flutter-quill/blob/master/example/lib/universal_ui/universal_ui.dart#L99).
Also it is required to provide `webImagePickImpl`, e.g. [Sample Page](https://github.com/singerdmx/flutter-quill/blob/master/example/lib/pages/home_page.dart#L317).
For **desktop platforms** It is required to provide `filePickImpl` for toolbar image button, e.g. [Sample Page](https://github.com/singerdmx/flutter-quill/blob/master/example/lib/pages/home_page.dart#L297).
### Using Custom App Widget
@ -262,35 +258,7 @@ Provide a list of embed
### Using the embed blocks from `flutter_quill_extensions`
```dart
QuillToolbar(
configurations: QuillToolbarConfigurations(
embedButtons: FlutterQuillEmbeds.toolbarButtons(
imageButtonOptions: QuillToolbarImageButtonOptions(
onImagePickCallback: (file) async {
return file.path;
},
),
),
),
),
```
```dart
Expanded(
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(
readOnly: true,
embedBuilders: FlutterQuillEmbeds.editorBuilders(
imageEmbedConfigurations:
const QuillEditorImageEmbedConfigurations(
forceUseMobileOptionMenuForImageClick: true,
),
),
),
),
)
```
Too see how to use the extensions package, please take a look at the [README](./flutter_quill_extensions/README.md) of [FlutterQuill Extensions]
### Custom Size Image for Mobile

@ -1,16 +1,14 @@
# app
# Demo
demo app
This is just a demo of Flutter Quill
## Getting Started
This project is a starting point for a Flutter application.
## Screenshots
A few resources to get you started if this is your first Flutter project:
![Screenshot 1](./assets/images/1.png)
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
![Screenshot 2](./assets/images/2.png)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
![Screenshot 3](./assets/images/3.png)
![Screenshot 4](./assets/images/4.png)

@ -5,16 +5,12 @@ import 'dart:convert';
import 'dart:io' show File, Platform;
import 'dart:ui';
import 'package:filesystem_picker/filesystem_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
import 'package:flutter_quill_extensions/presentation/embeds/embed_types/image.dart';
import 'package:flutter_quill_extensions/presentation/embeds/embed_types/video.dart';
import 'package:flutter_quill_extensions/presentation/models/config/toolbar/buttons/video.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
@ -407,14 +403,15 @@ class _HomePageState extends State<HomePage> {
bool _isDesktop() => !kIsWeb && !Platform.isAndroid && !Platform.isIOS;
Future<String?> openFileSystemPickerForDesktop(BuildContext context) async {
return await FilesystemPicker.open(
context: context,
rootDirectory: await getApplicationDocumentsDirectory(),
fsType: FilesystemType.file,
fileTileSelectMode: FileTileSelectMode.wholeTile,
);
}
// Future<String?> _openFileSystemPickerForDesktop(BuildContext context)
// async {
// return await FilesystemPicker.open(
// context: context,
// rootDirectory: await getApplicationDocumentsDirectory(),
// fsType: FilesystemType.file,
// fileTileSelectMode: FileTileSelectMode.wholeTile,
// );
// }
// Renders the image picked by imagePicker from local file storage
// You can also upload the picked image to any server (eg : AWS s3

@ -1,13 +1,11 @@
import 'dart:convert';
import 'dart:io' show Platform;
import 'package:filesystem_picker/filesystem_picker.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
import 'package:path_provider/path_provider.dart';
typedef DemoContentBuilder = Widget Function(
BuildContext context, QuillController? controller);
@ -75,14 +73,15 @@ class _DemoScaffoldState extends State<DemoScaffold> {
}
}
Future<String?> openFileSystemPickerForDesktop(BuildContext context) async {
return await FilesystemPicker.open(
context: context,
rootDirectory: await getApplicationDocumentsDirectory(),
fsType: FilesystemType.file,
fileTileSelectMode: FileTileSelectMode.wholeTile,
);
}
// Future<String?> _openFileSystemPickerForDesktop(BuildContext context)
//async {
// return await FilesystemPicker.open(
// context: context,
// rootDirectory: await getApplicationDocumentsDirectory(),
// fsType: FilesystemType.file,
// fileTileSelectMode: FileTileSelectMode.wholeTile,
// );
// }
QuillToolbar get quillToolbar {
if (_isDesktop()) {

@ -4,7 +4,7 @@ publish_to: 'none'
version: 1.0.0+1
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=3.1.3 <4.0.0'
dependencies:
flutter:
@ -13,8 +13,8 @@ dependencies:
cupertino_icons: ^1.0.6
path_provider: ^2.1.1
filesystem_picker: ^4.0.0
file_picker: ^6.1.1
# filesystem_picker: ^4.0.0
# file_picker: ^6.1.1
flutter_quill: ^8.2.0
flutter_quill_extensions: ^0.6.0-dev.2

@ -1,3 +1,6 @@
## 0.6.0-dev.4
- Add more exports
## 0.6.0-dev.3
- Disable the camera option by default on desktop

@ -4,7 +4,7 @@ import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter_quill/flutter_quill.dart';
import 'package:meta/meta.dart' show immutable;
import 'logic/models/config/configurations.dart';
import 'logic/models/config/shared_configurations.dart';
import 'presentation/embeds/editor/image/image.dart';
import 'presentation/embeds/editor/image/image_web.dart';
import 'presentation/embeds/editor/video.dart';
@ -29,6 +29,8 @@ export '/presentation/models/config/editor/webview.dart';
export './logic/extensions/controller.dart';
export 'presentation/embeds/editor/unknown.dart';
export 'presentation/embeds/embed_types.dart';
export 'presentation/embeds/embed_types/image.dart';
export 'presentation/embeds/embed_types/video.dart';
export 'presentation/embeds/toolbar/camera_button/camera_button.dart';
export 'presentation/embeds/toolbar/formula_button.dart';
export 'presentation/embeds/toolbar/image_button/image_button.dart';
@ -38,6 +40,7 @@ export 'presentation/embeds/toolbar/video_button/video_button.dart';
export 'presentation/embeds/utils.dart';
export 'presentation/models/config/editor/image.dart';
export 'presentation/models/config/toolbar/buttons/image.dart';
export 'presentation/models/config/toolbar/buttons/video.dart';
@immutable
class FlutterQuillEmbeds {

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flutter_quill/translations.dart';
import '../../../../logic/models/config/configurations.dart';
import '../../../../logic/models/config/shared_configurations.dart';
import '../../../../logic/services/image_picker/image_options.dart';
import '../../../models/config/toolbar/buttons/camera.dart';
import '../../embed_types/camera.dart';
@ -151,7 +151,6 @@ class QuillToolbarCameraButton extends StatelessWidget {
if (videoFile == null) {
return;
}
// TODO: Implement this
case CameraAction.image:
final imageFile = await imagePickerService.pickImage(
source: ImageSource.camera,

@ -3,7 +3,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';
import '../../../../logic/models/config/configurations.dart';
import '../../../../logic/models/config/shared_configurations.dart';
import '../../../../logic/services/image_picker/image_picker.dart';
import '../../../models/config/toolbar/buttons/image.dart';
import '../../embed_types/image.dart';

@ -3,7 +3,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/flutter_quill.dart';
import '../../../../logic/models/config/configurations.dart';
import '../../../../logic/models/config/shared_configurations.dart';
import '../../../../logic/services/image_picker/image_options.dart';
import '../../../models/config/toolbar/buttons/video.dart';
import '../../embed_types/video.dart';

@ -2,7 +2,7 @@ import 'dart:io' show File;
import 'package:flutter/foundation.dart' show immutable;
import 'package:flutter/widgets.dart' show BuildContext;
import '../../logic/models/config/configurations.dart';
import '../../logic/models/config/shared_configurations.dart';
// I would like to orgnize the project structure and the code more
// but here I don't want to change too much since that is a community project

@ -1,6 +1,6 @@
name: flutter_quill_extensions
description: Embed extensions for flutter_quill including image, video, formula and etc.
version: 0.6.0-dev.3
version: 0.6.0-dev.4
homepage: https://github.com/singerdmx/flutter-quill
repository: https://github.com/singerdmx/flutter-quill

@ -1,6 +1,6 @@
name: flutter_quill
description: A rich text editor built for the modern Android, iOS, web and desktop platforms. It is the WYSIWYG editor and a Quill component for Flutter.
version: 8.2.0
version: 8.2.1
homepage: https://1o24bbs.com/c/bulletjournal/108
repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save