pull/1566/head
Ellet 1 year ago
parent 0c4c6cd775
commit 9727fea996
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 6
      CHANGELOG.md
  2. 1
      example/lib/presentation/quill/quill_screen.dart
  3. 18
      example/lib/presentation/quill/quill_toolbar.dart
  4. 2
      example/pubspec.yaml
  5. 11
      flutter_quill_extensions/lib/embeds/others/camera_button/camera_button.dart
  6. 50
      flutter_quill_extensions/lib/embeds/others/camera_button/select_camera_action.dart
  7. 1
      flutter_quill_extensions/pubspec.yaml
  8. 26
      lib/src/models/config/toolbar/toolbar_configurations.dart
  9. 82
      lib/src/widgets/toolbar/base_toolbar.dart
  10. 197
      lib/src/widgets/toolbar/simple_toolbar.dart
  11. 2
      version.dart

@ -2,9 +2,15 @@
All notable changes to this project will be documented in this file.
## 9.0.0-dev-5
* The `QuillToolbar` is now accepting only `child` with no configurations so you can customize everything you wants, the `QuillToolbar.simple()` or `QuillSimpleToolbar` implements a simple toolbar that is based on `QuillToolbar`, you are free to use it but it just an example and not standard
* Flutter Quill Extensions:
* Improve the camera button
## 9.0.0-dev-4
* The options parameter in all of the buttons is no longer required which can be useful to create custom toolbar with minimal efforts
* Toolbar buttons fixes in both `flutter_quill` and `flutter_quill_extensions`
* The `QuillProvider` has been dropped and no longer used, the providers will be used only internally from now on and we will not using them as much as possible
## 9.0.0-dev-3
* Breaking Changes:

@ -106,7 +106,6 @@ class _QuillScreenState extends State<QuillScreen> {
MyQuillToolbar(
controller: _controller,
focusNode: _editorFocusNode,
sharedConfigurations: _sharedConfigurations,
),
Builder(
builder: (context) {

@ -17,14 +17,11 @@ class MyQuillToolbar extends StatelessWidget {
const MyQuillToolbar({
required this.controller,
required this.focusNode,
required this.sharedConfigurations,
super.key,
});
final QuillController controller;
final FocusNode focusNode;
// TODO: Use it
final QuillSharedConfigurations sharedConfigurations;
Future<void> onImageInsertWithCropping(
String image,
@ -104,16 +101,16 @@ class MyQuillToolbar extends StatelessWidget {
// https://github.com/singerdmx/flutter-quill/blob/master/doc/custom_toolbar.md
return QuillToolbar(
configurations: QuillToolbarConfigurations(
toolbarSize: 20 * 2,
multiRowsDisplay: false,
buttonOptions: const QuillToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
globalIconSize: 20,
globalIconButtonFactor: 1.4,
),
),
childrenBuilder: (context) {
return [
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
IconButton(
onPressed: () => context
.read<SettingsCubit>()
@ -177,7 +174,7 @@ class MyQuillToolbar extends StatelessWidget {
),
QuillToolbarToggleStyleButton(
controller: controller,
attribute: Attribute.list,
attribute: Attribute.ol,
),
QuillToolbarToggleStyleButton(
controller: controller,
@ -201,8 +198,9 @@ class MyQuillToolbar extends StatelessWidget {
),
const VerticalDivider(),
QuillToolbarLinkStyleButton(controller: controller),
];
},
],
),
),
),
);
}

@ -24,8 +24,6 @@ dependencies:
cross_file: ^0.3.3+6
cached_network_image: ^3.3.0
gal_linux: ^0.0.1-dev
# Bloc libraries
bloc: ^8.1.2
flutter_bloc: ^8.1.3

@ -120,10 +120,8 @@ class QuillToolbarCameraButton extends StatelessWidget {
if (customCallback != null) {
return await customCallback(context);
}
final cameraAction = await showDialog<CameraAction>(
final cameraAction = await showSelectCameraActionDialog(
context: context,
builder: (ctx) => const FlutterQuillLocalizationsWidget(
child: SelectCameraActionDialog()),
);
return cameraAction;
@ -171,12 +169,5 @@ class QuillToolbarCameraButton extends StatelessWidget {
await options.cameraConfigurations.onImageInsertedCallback
?.call(imageFile.path);
}
// final file = await switch (cameraAction) {
// CameraAction.image =>
// imagePickerService.pickImage(source: ImageSource.camera),
// CameraAction.video =>
// imagePickerService.pickVideo(source: ImageSource.camera),
// };
}
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_quill/extensions.dart';
import 'package:flutter_quill/translations.dart';
import 'camera_types.dart';
@ -8,27 +9,46 @@ class SelectCameraActionDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
contentPadding: EdgeInsets.zero,
content: Column(
mainAxisSize: MainAxisSize.min,
return SizedBox(
height: 150,
width: double.infinity,
child: SingleChildScrollView(
child: Column(
children: [
TextButton.icon(
icon: const Icon(
Icons.camera,
ListTile(
title: Text(context.loc.photo),
subtitle: Text(
context.loc.takeAPhotoUsingYourCamera,
),
label: Text(context.loc.photo),
onPressed: () => Navigator.pop(context, CameraAction.image),
leading: const Icon(Icons.photo_sharp),
enabled: !isDesktop(supportWeb: false),
onTap: () => Navigator.of(context).pop(CameraAction.image),
),
TextButton.icon(
icon: const Icon(
Icons.video_call,
ListTile(
title: Text(context.loc.video),
subtitle: Text(
context.loc.recordAVideoUsingYourCamera,
),
leading: const Icon(Icons.camera),
enabled: !isDesktop(supportWeb: false),
onTap: () => Navigator.of(context).pop(CameraAction.video),
),
label: Text(context.loc.video),
onPressed: () => Navigator.pop(context, CameraAction.video),
)
],
),
),
);
}
}
Future<CameraAction?> showSelectCameraActionDialog({
required BuildContext context,
}) async {
final imageSource = await showModalBottomSheet<CameraAction>(
showDragHandle: true,
context: context,
constraints: const BoxConstraints(maxWidth: 640),
builder: (context) => const FlutterQuillLocalizationsWidget(
child: SelectCameraActionDialog()),
);
return imageSource;
}

@ -44,6 +44,7 @@ dependencies:
url_launcher: ^6.2.1
super_clipboard: ^0.7.3
gal: ^2.1.3
gal_linux: ^0.0.1-dev-3
image_picker: ^1.0.4
dev_dependencies:

@ -1,6 +1,6 @@
// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:flutter/widgets.dart'
show Axis, WrapAlignment, WrapCrossAlignment, immutable;
show Axis, Widget, WrapAlignment, WrapCrossAlignment, immutable;
import '../../../widgets/toolbar/base_toolbar.dart';
import 'toolbar_shared_configurations.dart';
@ -8,34 +8,16 @@ import 'toolbar_shared_configurations.dart';
@immutable
class QuillToolbarConfigurations extends QuillSharedToolbarProperties {
const QuillToolbarConfigurations({
this.childrenBuilder,
super.axis = Axis.horizontal,
super.toolbarSize = kDefaultIconSize * 2,
super.toolbarSectionSpacing = kToolbarSectionSpacing,
super.toolbarIconAlignment = WrapAlignment.center,
super.toolbarIconCrossAlignment = WrapCrossAlignment.center,
super.color,
super.sectionDividerColor,
super.sectionDividerSpace,
super.linkDialogAction,
super.multiRowsDisplay = true,
super.decoration,
required this.child,
super.sharedConfigurations,
/// Note this only used when you using the quill toolbar buttons like
/// `QuillToolbarHistoryButton` inside it
super.buttonOptions = const QuillToolbarButtonOptions(),
});
final QuillBaseToolbarChildrenBuilder? childrenBuilder;
final Widget child;
@override
List<Object?> get props => [];
QuillToolbarConfigurations copyWith({
QuillBaseToolbarChildrenBuilder? childrenBuilder,
}) {
return QuillToolbarConfigurations(
childrenBuilder: childrenBuilder ?? this.childrenBuilder,
);
}
}

@ -5,7 +5,6 @@ import '../../../flutter_quill.dart'
import '../../l10n/widgets/localizations.dart';
import '../../models/config/toolbar/simple_toolbar_configurations.dart';
import '../../models/config/toolbar/toolbar_configurations.dart';
import 'buttons/arrow_indicated_list_button.dart';
import 'simple_toolbar.dart';
export '../../models/config/toolbar/buttons/base_configurations.dart';
@ -56,90 +55,11 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
@override
Widget build(BuildContext context) {
final toolbarSize = configurations.toolbarSize;
return FlutterQuillLocalizationsWidget(
child: QuillBaseToolbarProvider(
toolbarConfigurations: configurations,
child: Builder(
builder: (context) {
if (configurations.multiRowsDisplay) {
return Wrap(
direction: configurations.axis,
alignment: configurations.toolbarIconAlignment,
crossAxisAlignment: configurations.toolbarIconCrossAlignment,
runSpacing: 4,
spacing: configurations.toolbarSectionSpacing,
children: configurations.childrenBuilder?.call(context) ?? [],
);
}
return Container(
decoration: configurations.decoration ??
BoxDecoration(
color:
configurations.color ?? Theme.of(context).canvasColor,
),
constraints: BoxConstraints.tightFor(
height:
configurations.axis == Axis.horizontal ? toolbarSize : null,
width:
configurations.axis == Axis.vertical ? toolbarSize : null,
),
child: QuillToolbarArrowIndicatedButtonList(
axis: configurations.axis,
buttons: configurations.childrenBuilder?.call(context) ?? [],
),
);
},
child: configurations.child,
),
),
);
}
}
/// The divider which is used for separation of buttons in the toolbar.
///
/// It can be used outside of this package, for example when user does not use
/// [QuillToolbar.basic] and compose toolbar's children on its own.
class QuillToolbarDivider extends StatelessWidget {
const QuillToolbarDivider(
this.axis, {
super.key,
this.color,
this.space,
});
/// Provides a horizontal divider for vertical toolbar.
const QuillToolbarDivider.horizontal({Key? key, Color? color, double? space})
: this(Axis.horizontal, color: color, space: space, key: key);
/// Provides a horizontal divider for horizontal toolbar.
const QuillToolbarDivider.vertical({Key? key, Color? color, double? space})
: this(Axis.vertical, color: color, space: space, key: key);
/// The axis along which the toolbar is.
final Axis axis;
/// The color to use when painting this divider's line.
final Color? color;
/// The divider's space (width or height) depending of [axis].
final double? space;
@override
Widget build(BuildContext context) {
// Vertical toolbar requires horizontal divider, and vice versa
return axis == Axis.vertical
? Divider(
height: space,
color: color,
indent: 12,
endIndent: 12,
)
: VerticalDivider(
width: space,
color: color,
indent: 12,
endIndent: 12,
);
}
}

@ -6,6 +6,7 @@ import '../../models/config/toolbar/toolbar_configurations.dart';
import '../../models/documents/attribute.dart';
import '../utils/provider.dart';
import 'base_toolbar.dart';
import 'buttons/arrow_indicated_list_button.dart';
import 'buttons/select_alignment_buttons.dart';
import 'buttons/select_header_style_button.dart';
@ -50,22 +51,7 @@ class QuillSimpleToolbar extends StatelessWidget
configurations.showLink || configurations.showSearchButton
];
return QuillToolbarProvider(
toolbarConfigurations: configurations,
child: QuillToolbar(
configurations: QuillToolbarConfigurations(
color: configurations.color,
decoration: configurations.decoration,
toolbarSectionSpacing: configurations.toolbarSectionSpacing,
toolbarIconAlignment: configurations.toolbarIconAlignment,
toolbarIconCrossAlignment: configurations.toolbarIconCrossAlignment,
linkDialogAction: configurations.linkDialogAction,
multiRowsDisplay: configurations.multiRowsDisplay,
sectionDividerColor: configurations.sectionDividerColor,
axis: configurations.axis,
sectionDividerSpace: configurations.sectionDividerSpace,
toolbarSize: configurations.toolbarSize,
childrenBuilder: (context) {
List<Widget> childrenBuilder(context) {
final toolbarConfigurations =
context.requireQuillSimpleToolbarConfigurations;
@ -83,8 +69,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarHistoryButton(
isUndo: true,
options: toolbarConfigurations.buttonOptions.undoHistory,
controller: toolbarConfigurations
.buttonOptions.undoHistory.controller ??
controller:
toolbarConfigurations.buttonOptions.undoHistory.controller ??
globalController,
),
spacerWidget,
@ -93,8 +79,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarHistoryButton(
isUndo: false,
options: toolbarConfigurations.buttonOptions.redoHistory,
controller: toolbarConfigurations
.buttonOptions.redoHistory.controller ??
controller:
toolbarConfigurations.buttonOptions.redoHistory.controller ??
globalController,
),
spacerWidget,
@ -102,8 +88,8 @@ class QuillSimpleToolbar extends StatelessWidget
if (configurations.showFontFamily) ...[
QuillToolbarFontFamilyButton(
options: toolbarConfigurations.buttonOptions.fontFamily,
controller: toolbarConfigurations
.buttonOptions.fontFamily.controller ??
controller:
toolbarConfigurations.buttonOptions.fontFamily.controller ??
globalController,
defaultDispalyText: context.loc.font,
),
@ -112,8 +98,8 @@ class QuillSimpleToolbar extends StatelessWidget
if (configurations.showFontSize) ...[
QuillToolbarFontSizeButton(
options: toolbarConfigurations.buttonOptions.fontSize,
controller: toolbarConfigurations
.buttonOptions.fontFamily.controller ??
controller:
toolbarConfigurations.buttonOptions.fontFamily.controller ??
globalController,
defaultDisplayText: context.loc.fontSize,
),
@ -123,8 +109,7 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.bold,
options: toolbarConfigurations.buttonOptions.bold,
controller:
toolbarConfigurations.buttonOptions.bold.controller ??
controller: toolbarConfigurations.buttonOptions.bold.controller ??
globalController,
),
spacerWidget,
@ -133,8 +118,7 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.italic,
options: toolbarConfigurations.buttonOptions.italic,
controller:
toolbarConfigurations.buttonOptions.italic.controller ??
controller: toolbarConfigurations.buttonOptions.italic.controller ??
globalController,
),
spacerWidget,
@ -143,8 +127,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.underline,
options: toolbarConfigurations.buttonOptions.underLine,
controller: toolbarConfigurations
.buttonOptions.underLine.controller ??
controller:
toolbarConfigurations.buttonOptions.underLine.controller ??
globalController,
),
spacerWidget,
@ -153,8 +137,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.inlineCode,
options: toolbarConfigurations.buttonOptions.inlineCode,
controller: toolbarConfigurations
.buttonOptions.inlineCode.controller ??
controller:
toolbarConfigurations.buttonOptions.inlineCode.controller ??
globalController,
),
spacerWidget,
@ -163,8 +147,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.subscript,
options: toolbarConfigurations.buttonOptions.subscript,
controller: toolbarConfigurations
.buttonOptions.subscript.controller ??
controller:
toolbarConfigurations.buttonOptions.subscript.controller ??
globalController,
),
spacerWidget,
@ -173,8 +157,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.superscript,
options: toolbarConfigurations.buttonOptions.superscript,
controller: toolbarConfigurations
.buttonOptions.superscript.controller ??
controller:
toolbarConfigurations.buttonOptions.superscript.controller ??
globalController,
),
spacerWidget,
@ -183,8 +167,7 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.small,
options: toolbarConfigurations.buttonOptions.small,
controller:
toolbarConfigurations.buttonOptions.small.controller ??
controller: toolbarConfigurations.buttonOptions.small.controller ??
globalController,
),
spacerWidget,
@ -193,16 +176,15 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.strikeThrough,
options: toolbarConfigurations.buttonOptions.strikeThrough,
controller: toolbarConfigurations
.buttonOptions.strikeThrough.controller ??
controller:
toolbarConfigurations.buttonOptions.strikeThrough.controller ??
globalController,
),
spacerWidget,
],
if (configurations.showColorButton) ...[
QuillToolbarColorButton(
controller:
toolbarConfigurations.buttonOptions.color.controller ??
controller: toolbarConfigurations.buttonOptions.color.controller ??
globalController,
isBackground: false,
options: toolbarConfigurations.buttonOptions.color,
@ -212,8 +194,7 @@ class QuillSimpleToolbar extends StatelessWidget
if (configurations.showBackgroundColorButton) ...[
QuillToolbarColorButton(
options: toolbarConfigurations.buttonOptions.backgroundColor,
controller:
toolbarConfigurations.buttonOptions.color.controller ??
controller: toolbarConfigurations.buttonOptions.color.controller ??
globalController,
isBackground: true,
),
@ -221,8 +202,8 @@ class QuillSimpleToolbar extends StatelessWidget
],
if (configurations.showClearFormat) ...[
QuillToolbarClearFormatButton(
controller: toolbarConfigurations
.buttonOptions.clearFormat.controller ??
controller:
toolbarConfigurations.buttonOptions.clearFormat.controller ??
globalController,
options: toolbarConfigurations.buttonOptions.clearFormat,
),
@ -252,8 +233,7 @@ class QuillSimpleToolbar extends StatelessWidget
controller: toolbarConfigurations
.buttonOptions.selectAlignmentButtons.controller ??
globalController,
options: toolbarConfigurations
.buttonOptions.selectAlignmentButtons,
options: toolbarConfigurations.buttonOptions.selectAlignmentButtons,
showLeftAlignment: configurations.showLeftAlignment,
showCenterAlignment: configurations.showCenterAlignment,
showRightAlignment: configurations.showRightAlignment,
@ -265,8 +245,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.rtl,
options: toolbarConfigurations.buttonOptions.direction,
controller: toolbarConfigurations
.buttonOptions.direction.controller ??
controller:
toolbarConfigurations.buttonOptions.direction.controller ??
globalController,
),
spacerWidget,
@ -287,8 +267,8 @@ class QuillSimpleToolbar extends StatelessWidget
controller: toolbarConfigurations
.buttonOptions.selectHeaderStyleButtons.controller ??
globalController,
options: toolbarConfigurations
.buttonOptions.selectHeaderStyleButtons,
options:
toolbarConfigurations.buttonOptions.selectHeaderStyleButtons,
),
spacerWidget,
],
@ -307,8 +287,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.ol,
options: toolbarConfigurations.buttonOptions.listNumbers,
controller: toolbarConfigurations
.buttonOptions.listNumbers.controller ??
controller:
toolbarConfigurations.buttonOptions.listNumbers.controller ??
globalController,
),
spacerWidget,
@ -317,8 +297,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.ul,
options: toolbarConfigurations.buttonOptions.listBullets,
controller: toolbarConfigurations
.buttonOptions.listBullets.controller ??
controller:
toolbarConfigurations.buttonOptions.listBullets.controller ??
globalController,
),
spacerWidget,
@ -336,8 +316,8 @@ class QuillSimpleToolbar extends StatelessWidget
QuillToolbarToggleStyleButton(
attribute: Attribute.codeBlock,
options: toolbarConfigurations.buttonOptions.codeBlock,
controller: toolbarConfigurations
.buttonOptions.codeBlock.controller ??
controller:
toolbarConfigurations.buttonOptions.codeBlock.controller ??
globalController,
),
spacerWidget,
@ -354,8 +334,7 @@ class QuillSimpleToolbar extends StatelessWidget
if (configurations.showQuote) ...[
QuillToolbarToggleStyleButton(
options: toolbarConfigurations.buttonOptions.quote,
controller:
toolbarConfigurations.buttonOptions.quote.controller ??
controller: toolbarConfigurations.buttonOptions.quote.controller ??
globalController,
attribute: Attribute.blockQuote,
),
@ -363,8 +342,8 @@ class QuillSimpleToolbar extends StatelessWidget
],
if (configurations.showIndent) ...[
QuillToolbarIndentButton(
controller: toolbarConfigurations
.buttonOptions.indentIncrease.controller ??
controller:
toolbarConfigurations.buttonOptions.indentIncrease.controller ??
globalController,
isIncrease: true,
options: toolbarConfigurations.buttonOptions.indentIncrease,
@ -373,8 +352,8 @@ class QuillSimpleToolbar extends StatelessWidget
],
if (configurations.showIndent) ...[
QuillToolbarIndentButton(
controller: toolbarConfigurations
.buttonOptions.indentDecrease.controller ??
controller:
toolbarConfigurations.buttonOptions.indentDecrease.controller ??
globalController,
isIncrease: false,
options: toolbarConfigurations.buttonOptions.indentDecrease,
@ -407,8 +386,7 @@ class QuillSimpleToolbar extends StatelessWidget
],
if (configurations.showSearchButton) ...[
QuillToolbarSearchButton(
controller:
toolbarConfigurations.buttonOptions.search.controller ??
controller: toolbarConfigurations.buttonOptions.search.controller ??
globalController,
options: toolbarConfigurations.buttonOptions.search,
),
@ -443,9 +421,48 @@ class QuillSimpleToolbar extends StatelessWidget
spacerWidget,
],
];
}
return QuillToolbarProvider(
toolbarConfigurations: configurations,
child: QuillToolbar(
configurations: QuillToolbarConfigurations(
buttonOptions: configurations.buttonOptions,
child: Builder(
builder: (context) {
if (configurations.multiRowsDisplay) {
return Wrap(
direction: configurations.axis,
alignment: configurations.toolbarIconAlignment,
crossAxisAlignment: configurations.toolbarIconCrossAlignment,
runSpacing: 4,
spacing: configurations.toolbarSectionSpacing,
children: childrenBuilder(context),
);
}
return Container(
decoration: configurations.decoration ??
BoxDecoration(
color:
configurations.color ?? Theme.of(context).canvasColor,
),
constraints: BoxConstraints.tightFor(
height: configurations.axis == Axis.horizontal
? configurations.toolbarSize
: null,
width: configurations.axis == Axis.vertical
? configurations.toolbarSize
: null,
),
child: QuillToolbarArrowIndicatedButtonList(
axis: configurations.axis,
buttons: childrenBuilder(context),
),
);
},
),
),
),
);
}
@ -454,3 +471,51 @@ class QuillSimpleToolbar extends StatelessWidget
? const Size.fromHeight(defaultToolbarSize)
: const Size.fromWidth(defaultToolbarSize);
}
/// The divider which is used for separation of buttons in the toolbar.
///
/// It can be used outside of this package, for example when user does not use
/// [QuillToolbar.basic] and compose toolbar's children on its own.
class QuillToolbarDivider extends StatelessWidget {
const QuillToolbarDivider(
this.axis, {
super.key,
this.color,
this.space,
});
/// Provides a horizontal divider for vertical toolbar.
const QuillToolbarDivider.horizontal({Key? key, Color? color, double? space})
: this(Axis.horizontal, color: color, space: space, key: key);
/// Provides a horizontal divider for horizontal toolbar.
const QuillToolbarDivider.vertical({Key? key, Color? color, double? space})
: this(Axis.vertical, color: color, space: space, key: key);
/// The axis along which the toolbar is.
final Axis axis;
/// The color to use when painting this divider's line.
final Color? color;
/// The divider's space (width or height) depending of [axis].
final double? space;
@override
Widget build(BuildContext context) {
// Vertical toolbar requires horizontal divider, and vice versa
return axis == Axis.vertical
? Divider(
height: space,
color: color,
indent: 12,
endIndent: 12,
)
: VerticalDivider(
width: space,
color: color,
indent: 12,
endIndent: 12,
);
}
}

@ -1 +1 @@
const version = '9.0.0-dev-4';
const version = '9.0.0-dev-5';

Loading…
Cancel
Save