Skip to content

Commit

Permalink
Update the example
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellet committed Nov 15, 2023
1 parent 8520717 commit bd78a9b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<!-- The camera and gps features will be used -->
Expand Down
5 changes: 4 additions & 1 deletion example/lib/presentation/quill/quill_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ class _QuillScreenState extends State<QuillScreen> {
),
child: Column(
children: [
if (!_isReadOnly) const MyQuillToolbar(),
if (!_isReadOnly)
MyQuillToolbar(
focusNode: _editorFocusNode,
),
Builder(
builder: (context) {
return Expanded(
Expand Down
14 changes: 13 additions & 1 deletion example/lib/presentation/quill/quill_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import '../settings/cubit/settings_cubit.dart';
import 'embeds/timestamp_embed.dart';

class MyQuillToolbar extends StatelessWidget {
const MyQuillToolbar({super.key});
const MyQuillToolbar({
required this.focusNode,
super.key,
});

final FocusNode focusNode;

Future<void> onImageInsertWithCropping(
String image,
Expand Down Expand Up @@ -211,6 +216,13 @@ class MyQuillToolbar extends StatelessWidget {
}
return QuillToolbar(
configurations: QuillToolbarConfigurations(
showAlignmentButtons: true,
buttonOptions: QuillToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed
afterButtonPressed: focusNode.requestFocus,
),
),
customButtons: [
QuillToolbarCustomButtonOptions(
icon: const Icon(Icons.add_alarm_rounded),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/models/config/toolbar/configurations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class QuillToolbarConfigurations extends Equatable {
/// 'Nunito': 'nunito',
/// 'Pacifico': 'pacifico',
/// 'Roboto Mono': 'roboto-mono',
/// 'Clear'.i18n: 'Clear'
/// 'Clear'.loc: 'Clear'
/// };
/// ```
final Map<String, String>? fontFamilyValues;
Expand All @@ -165,7 +165,7 @@ class QuillToolbarConfigurations extends Equatable {
/// 'Small'.i18n: 'small',
/// 'Large'.i18n: 'large',
/// 'Huge'.i18n: 'huge',
/// 'Clear'.i18n: '0'
/// 'Clear'.loc: '0'
/// }
/// ```
final Map<String, String>? fontSizesValues;
Expand Down
3 changes: 2 additions & 1 deletion lib/src/utils/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/foundation.dart'
show TargetPlatform, defaultTargetPlatform, kIsWeb, visibleForTesting;

/// If you want to override the [kIsWeb] use [overrideIsWeb]
/// If you want to override the [kIsWeb] use [overrideIsWeb] but it's only
/// for testing
bool isWeb({
@visibleForTesting bool? overrideIsWeb,
}) {
Expand Down

0 comments on commit bd78a9b

Please sign in to comment.