Spacing should be required
SalahAdDin opened this issue · 1 comments
SalahAdDin commented
Using this package to build our questionary app we got the next bug:
======== Exception caught by widgets library =======================================================
The following _CastError was thrown building GroupButtonBody(dirty, dependencies: [_InheritedProviderScope<GroupButtonBloc>]):
Null check operator used on a null value
The relevant error-causing widget was:
GroupButton file:///home/luisalaguna/Projects/thesis_cancer/lib/features/survey/presentation/widgets/question_widget.dart:67:24
When the exception was thrown, this was the stack:
#0 GroupButtonBody.build (package:group_button/src/group_button_body.dart:55:23)
#1 StatelessElement.build (package:flutter/src/widgets/framework.dart:4569:28)
#2 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
#3 Element.rebuild (package:flutter/src/widgets/framework.dart:4189:5)
#4 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4474:5)
...
My code is this one:
case QuestionType.BOOL:
answerWidget = GroupButton(
buttons: ['Yanlış', 'Doğru'],
onSelected: (index, isSelected) => print('$index button is selected'),
direction: Axis.vertical,
);
break;
Debugging superficially over this bug we found the next:
It seems in some cases the spacing
parameter is required, but it is that in all, to build the widget correctly; adding it to my code make it works correctly.
Hence, We think this parameter would be required or would have a default value.
Thanks.
Frezyx commented
Hello @SalahAdDin ✋🏻
I solved this problem without applying required
You can check it in new package 2.1.1 release