Skip to content
Merged
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
695 changes: 695 additions & 0 deletions example/lib/cascade_demo.dart

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ library;
import 'package:flutter/material.dart';
import 'package:panes/panes.dart';

import 'cascade_demo.dart';

void main() {
runApp(const MyApp());
}
Expand Down Expand Up @@ -162,9 +164,19 @@ class _IdeExampleState extends State<IdeExample> {
void initState() {
super.initState();
_ideController = IdeController(
leftSize: PaneSize.pixel(250),
leftMinSize: PaneSize.pixel(150),
leftMaxSize: PaneSize.pixel(500),
leftResizeBehavior: ResizeBehavior.eager,
rightSize: PaneSize.pixel(300),
rightMinSize: PaneSize.pixel(150),
rightMaxSize: PaneSize.pixel(500),
bottomMaxSize: PaneSize.pixel(480),
rightResizeBehavior: ResizeBehavior.eager,
bottomSize: PaneSize.fraction(0.5),
bottomMinSize: PaneSize.pixel(50),
bottomAutoHide: true,
bottomAutoHideThreshold: PaneSize.fraction(0.5),
bottomResizeBehavior: ResizeBehavior.eager,
);
// Show panels by default
_ideController.rootController.show(IdePane.right.id);
Expand Down Expand Up @@ -348,6 +360,15 @@ class _IdeExampleState extends State<IdeExample> {
),
),
),
// Cascade demo button
_titleBarAction(
Icons.swap_horiz,
'Cascade Resize Demo',
() => Navigator.of(
context,
).push(MaterialPageRoute(builder: (_) => const CascadeDemo())),
),
const SizedBox(width: 8),
// Toggle buttons for panels (right side)
_titleBarAction(
Icons.terminal,
Expand Down
18 changes: 9 additions & 9 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -111,18 +111,18 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
Expand All @@ -137,7 +137,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0+1"
version: "1.1.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -195,10 +195,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.10"
vector_math:
dependency: transitive
description:
Expand Down
8 changes: 8 additions & 0 deletions lib/src/ide_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:panes/src/pane_controller.dart';
import 'package:panes/src/pane_entry.dart';
import 'package:panes/src/pane_size.dart';

export 'package:panes/src/pane_entry.dart' show ResizeBehavior;

/// Represents the different panes in an [IdeLayout].
enum IdePane {
/// The left sidebar pane.
Expand Down Expand Up @@ -51,6 +53,7 @@ class IdeController {
bool leftAutoHide = true,
PaneSize? leftAutoHideThreshold,
bool leftVisible = true,
ResizeBehavior? leftResizeBehavior,

// Right panel configuration
PaneSize? rightSize,
Expand All @@ -59,6 +62,7 @@ class IdeController {
bool rightAutoHide = true,
PaneSize? rightAutoHideThreshold,
bool rightVisible = false,
ResizeBehavior? rightResizeBehavior,

// Bottom panel configuration
PaneSize? bottomSize,
Expand All @@ -67,6 +71,7 @@ class IdeController {
bool bottomAutoHide = true,
PaneSize? bottomAutoHideThreshold,
bool bottomVisible = false,
ResizeBehavior? bottomResizeBehavior,
}) {
// Horizontal: Left | Center | Right
rootController = PaneController(
Expand All @@ -79,6 +84,7 @@ class IdeController {
autoHide: leftAutoHide,
autoHideThreshold: leftAutoHideThreshold ?? PaneSize.fraction(0.5),
visible: leftVisible,
resizeBehavior: leftResizeBehavior,
),
PaneEntry(
id: IdePane.centerContainer.id,
Expand All @@ -92,6 +98,7 @@ class IdeController {
autoHide: rightAutoHide,
autoHideThreshold: rightAutoHideThreshold ?? PaneSize.fraction(0.5),
visible: rightVisible,
resizeBehavior: rightResizeBehavior,
),
],
);
Expand All @@ -111,6 +118,7 @@ class IdeController {
autoHide: bottomAutoHide,
autoHideThreshold: bottomAutoHideThreshold ?? PaneSize.fraction(0.5),
visible: bottomVisible,
resizeBehavior: bottomResizeBehavior,
),
],
);
Expand Down
Loading