Skip to content

Commit 99db4fa

Browse files
committed
chore: adding the scrollToZoom option to test inside the themes example
1 parent 9c2ea14 commit 99db4fa

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/demo/lib/examples/advanced/theming.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class _ThemingExampleState extends State<ThemingExample> {
1616
late final NodeFlowController<Map<String, dynamic>> _controller;
1717
late NodeFlowTheme _theme;
1818
PortShape _selectedPortShape = PortShapes.capsuleHalf;
19+
bool _scrollToZoom = true;
1920

2021
@override
2122
void initState() {
@@ -242,6 +243,7 @@ class _ThemingExampleState extends State<ThemingExample> {
242243
controller: _controller,
243244
nodeBuilder: _buildNode,
244245
theme: _theme,
246+
scrollToZoom: _scrollToZoom,
245247
),
246248
children: [
247249
_buildThemePresets(),
@@ -258,6 +260,8 @@ class _ThemingExampleState extends State<ThemingExample> {
258260
const SizedBox(height: 24),
259261
_buildGridSection(),
260262
const SizedBox(height: 24),
263+
_buildViewportSection(),
264+
const SizedBox(height: 24),
261265
_buildNodeBorderSection(),
262266
],
263267
);
@@ -756,6 +760,30 @@ class _ThemingExampleState extends State<ThemingExample> {
756760
);
757761
}
758762

763+
Widget _buildViewportSection() {
764+
return Column(
765+
crossAxisAlignment: CrossAxisAlignment.stretch,
766+
children: [
767+
const SectionTitle('Viewport'),
768+
const SizedBox(height: 12),
769+
Row(
770+
children: [
771+
const Text('Scroll to Zoom', style: TextStyle(fontSize: 12)),
772+
const Spacer(),
773+
Switch(
774+
value: _scrollToZoom,
775+
onChanged: (value) {
776+
setState(() {
777+
_scrollToZoom = value;
778+
});
779+
},
780+
),
781+
],
782+
),
783+
],
784+
);
785+
}
786+
759787
Widget _buildNodeBorderSection() {
760788
return Column(
761789
crossAxisAlignment: CrossAxisAlignment.stretch,

0 commit comments

Comments
 (0)