|
|
|
@ -30,41 +30,41 @@ import 'text_line.dart'; |
|
|
|
|
import 'text_selection.dart'; |
|
|
|
|
|
|
|
|
|
class RawEditor extends StatefulWidget { |
|
|
|
|
const RawEditor({ |
|
|
|
|
required this.controller, |
|
|
|
|
required this.focusNode, |
|
|
|
|
required this.scrollController, |
|
|
|
|
required this.scrollBottomInset, |
|
|
|
|
required this.cursorStyle, |
|
|
|
|
required this.selectionColor, |
|
|
|
|
required this.selectionCtrls, |
|
|
|
|
Key? key, |
|
|
|
|
this.scrollable = true, |
|
|
|
|
this.padding = EdgeInsets.zero, |
|
|
|
|
this.readOnly = false, |
|
|
|
|
this.placeholder, |
|
|
|
|
this.onLaunchUrl, |
|
|
|
|
this.toolbarOptions = const ToolbarOptions( |
|
|
|
|
copy: true, |
|
|
|
|
cut: true, |
|
|
|
|
paste: true, |
|
|
|
|
selectAll: true, |
|
|
|
|
), |
|
|
|
|
this.showSelectionHandles = false, |
|
|
|
|
bool? showCursor, |
|
|
|
|
this.textCapitalization = TextCapitalization.none, |
|
|
|
|
this.maxHeight, |
|
|
|
|
this.minHeight, |
|
|
|
|
this.customStyles, |
|
|
|
|
this.expands = false, |
|
|
|
|
this.autoFocus = false, |
|
|
|
|
this.keyboardAppearance = Brightness.light, |
|
|
|
|
this.enableInteractiveSelection = true, |
|
|
|
|
this.scrollPhysics, |
|
|
|
|
this.embedBuilder = defaultEmbedBuilder, |
|
|
|
|
this.customStyleBuilder, |
|
|
|
|
this.floatingCursorDisabled = false |
|
|
|
|
}) : assert(maxHeight == null || maxHeight > 0, 'maxHeight cannot be null'), |
|
|
|
|
const RawEditor( |
|
|
|
|
{required this.controller, |
|
|
|
|
required this.focusNode, |
|
|
|
|
required this.scrollController, |
|
|
|
|
required this.scrollBottomInset, |
|
|
|
|
required this.cursorStyle, |
|
|
|
|
required this.selectionColor, |
|
|
|
|
required this.selectionCtrls, |
|
|
|
|
Key? key, |
|
|
|
|
this.scrollable = true, |
|
|
|
|
this.padding = EdgeInsets.zero, |
|
|
|
|
this.readOnly = false, |
|
|
|
|
this.placeholder, |
|
|
|
|
this.onLaunchUrl, |
|
|
|
|
this.toolbarOptions = const ToolbarOptions( |
|
|
|
|
copy: true, |
|
|
|
|
cut: true, |
|
|
|
|
paste: true, |
|
|
|
|
selectAll: true, |
|
|
|
|
), |
|
|
|
|
this.showSelectionHandles = false, |
|
|
|
|
bool? showCursor, |
|
|
|
|
this.textCapitalization = TextCapitalization.none, |
|
|
|
|
this.maxHeight, |
|
|
|
|
this.minHeight, |
|
|
|
|
this.customStyles, |
|
|
|
|
this.expands = false, |
|
|
|
|
this.autoFocus = false, |
|
|
|
|
this.keyboardAppearance = Brightness.light, |
|
|
|
|
this.enableInteractiveSelection = true, |
|
|
|
|
this.scrollPhysics, |
|
|
|
|
this.embedBuilder = defaultEmbedBuilder, |
|
|
|
|
this.customStyleBuilder, |
|
|
|
|
this.floatingCursorDisabled = false}) |
|
|
|
|
: assert(maxHeight == null || maxHeight > 0, 'maxHeight cannot be null'), |
|
|
|
|
assert(minHeight == null || minHeight >= 0, 'minHeight cannot be null'), |
|
|
|
|
assert(maxHeight == null || minHeight == null || maxHeight >= minHeight, |
|
|
|
|
'maxHeight cannot be null'), |
|
|
|
|