Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree is not getting align at top centre and have extra space between top and top node. #134

Open
sumiran1601-cp opened this issue Jan 30, 2025 · 0 comments

Comments

@sumiran1601-cp
Copy link

@OverRide
Widget build(BuildContext context) {
return Consumer(
builder: (context, provider, child) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
IconButton(
onPressed: () async {
if (provider.workFlowPageLoader != true) {
context.go(RouteNames.workflow.path);
await SharedPreferenceUtil()
.remove(SharedPreferenceHelper.selectedWorkflowId);
}
},
icon: const Icon(
Icons.arrow_back,
),
color: Colors.black87,
iconSize: 36,
),
const SubHeadingText(subHeadingText: 'Workflow steps'),
],
),
Divider(
thickness: 1,
color: greyTextColor,
),
const SizedBox(height: 8),
provider.workFlowPageLoader
? const Expanded(
child: Center(
child: CircularProgressIndicator(),
),
)
: provider.stepList.isEmpty
? _initialContainer(provider)
: Expanded(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: InteractiveViewer(
constrained: false,
boundaryMargin:
const EdgeInsets.only(top: 48, bottom: 48),
minScale: 0.01,
maxScale: 5.6,
child: GraphView(
key: provider.graphKey,
graph: provider.graph,
algorithm: BuchheimWalkerAlgorithm(
builder, TreeEdgeRenderer(builder)),
paint: Paint()
..color = Colors.green
..strokeWidth = 1
..style = PaintingStyle.stroke,
builder: (Node node) {
var nodeData =
node.key?.value as Map<String, dynamic>;
if (nodeData['id'] == -1) {
return _initialContainer(provider);
} else {
return _buildStepContainer(
nodeData['value'], provider);
}
},
),
),
),
),
],
);
},
);
} This is my build method. when this tree become linear means one child for each node then at that case it is aligning in the top left of the parent container. I tried by centre widget alignment widget but nothing works. Also there are extra space beween top node and its parent and while scrolling that's space gets disappear. Please fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant