|
|
|
@ -1,7 +1,8 @@ |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:i18n_extension/i18n_widget.dart'; |
|
|
|
|
|
|
|
|
|
import '../../../flutter_quill.dart' show defaultToolbarSize; |
|
|
|
|
import '../../../flutter_quill.dart' |
|
|
|
|
show QuillBaseToolbarProvider, defaultToolbarSize; |
|
|
|
|
import '../../models/config/toolbar/base_configurations.dart'; |
|
|
|
|
import '../../utils/extensions/build_context.dart'; |
|
|
|
|
import 'buttons/arrow_indicated_list.dart'; |
|
|
|
@ -50,34 +51,39 @@ class QuillBaseToolbar extends StatelessWidget implements PreferredSizeWidget { |
|
|
|
|
final toolbarSize = configurations.toolbarSize; |
|
|
|
|
return I18n( |
|
|
|
|
initialLocale: context.quillSharedConfigurations?.locale, |
|
|
|
|
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(context), |
|
|
|
|
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(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(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(context), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|