Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/src/resizable_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ class ResizableWidget extends StatefulWidget {
/// Note that [onResized] is called every frame when resizing [children].
final OnResizedFunc? onResized;

/// Divider widget.
/// This widget is inserted between the children.
/// If you set this value, the length of [children] will be doubled.
/// The [divider] will be inserted between the original [children].
final Widget? divider;

/// Creates [ResizableWidget].
ResizableWidget({
Key? key,
required this.children,
this.divider,
this.percentages,
@Deprecated('Use [isHorizontalSeparator] instead')
this.isColumnChildren = false,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/resizable_widget_args_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ResizableWidgetArgsInfo {
final double separatorSize;
final Color separatorColor;
final OnResizedFunc? onResized;
final Widget? divider;

ResizableWidgetArgsInfo(ResizableWidget widget)
: children = widget.children,
Expand All @@ -20,5 +21,6 @@ class ResizableWidgetArgsInfo {
isDisabledSmartHide = widget.isDisabledSmartHide,
separatorSize = widget.separatorSize,
separatorColor = widget.separatorColor,
onResized = widget.onResized;
onResized = widget.onResized,
divider = widget.divider;
}
1 change: 1 addition & 0 deletions lib/src/resizable_widget_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class ResizableWidgetModel {
_info.isDisabledSmartHide,
_info.separatorSize,
_info.separatorColor,
_info.divider,
)),
null));
}
Expand Down
12 changes: 6 additions & 6 deletions lib/src/separator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ class _SeparatorState extends State<Separator> {
super.initState();

_info = widget.info;
_controller =
SeparatorController(widget.info.index, widget.info.parentController);
_controller = SeparatorController(widget.info.index, widget.info.parentController);
}

@override
Widget build(BuildContext context) => GestureDetector(
child: MouseRegion(
cursor: _info.isHorizontalSeparator
? SystemMouseCursors.resizeRow
: SystemMouseCursors.resizeColumn,
cursor: _info.isHorizontalSeparator ? SystemMouseCursors.resizeRow : SystemMouseCursors.resizeColumn,
child: SizedBox(
child: Container(color: _info.color),
child: Container(
color: _info.color,
child: _info.child,
),
width: _info.isHorizontalSeparator ? double.infinity : _info.size,
height: _info.isHorizontalSeparator ? _info.size : double.infinity,
),
Expand Down
6 changes: 4 additions & 2 deletions lib/src/separator_args_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ class SeparatorArgsBasicInfo {
final bool isDisabledSmartHide;
final double size;
final Color color;
final Widget? child;

const SeparatorArgsBasicInfo(this.index, this.isHorizontalSeparator,
this.isDisabledSmartHide, this.size, this.color);
this.isDisabledSmartHide, this.size, this.color, this.child);

SeparatorArgsBasicInfo.clone(SeparatorArgsBasicInfo info)
: index = info.index,
isHorizontalSeparator = info.isHorizontalSeparator,
isDisabledSmartHide = info.isDisabledSmartHide,
size = info.size,
color = info.color;
color = info.color,
child = info.child;
}