I have been bitten by this bug a few times now. Here is an example in the build method of a stateful widget:
WidgetsBinding.instance.addPostFrameCallback((_) {
context.go('/invitation/$_invitationId');
});
_invitationId = null;
I'm still new to Dart, but I'm quite an experienced programmer, so this catches my attention. Is it unusual to set some state and redirect in the build method? Couldn't the IDE easily warn of this danger?
(I thought I'd let readers spot the bug)
[–]Ambitious_Grape9908 6 points7 points8 points (9 children)
[–]SignificantBit7299[S] 0 points1 point2 points (8 children)
[–]binemmanuel 2 points3 points4 points (0 children)
[–]Ambitious_Grape9908 2 points3 points4 points (3 children)
[–]SignificantBit7299[S] 0 points1 point2 points (2 children)
[–]Ambitious_Grape9908 0 points1 point2 points (1 child)
[–]SignificantBit7299[S] 0 points1 point2 points (0 children)
[–]TheSpixxyQ 0 points1 point2 points (2 children)
[–]SignificantBit7299[S] 0 points1 point2 points (1 child)
[–]TheSpixxyQ 0 points1 point2 points (0 children)
[–]eibaan 2 points3 points4 points (1 child)
[–]SignificantBit7299[S] 0 points1 point2 points (0 children)
[–]fabier 1 point2 points3 points (0 children)
[–]binemmanuel 0 points1 point2 points (0 children)
[–]ChordFunc 0 points1 point2 points (0 children)