Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

example crashes #3

Closed
sgehrman opened this issue Jan 25, 2020 · 3 comments
Closed

example crashes #3

sgehrman opened this issue Jan 25, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sgehrman
Copy link

sgehrman commented Jan 25, 2020

I took a photo, and then got an exception.

The getter 'value' was called on null.
Receiver: null
Tried calling: value

The relevant error-causing widget was
    MaterialApp 
lib/main.dart:20
When the exception was thrown, this was the stack
#0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
#1      CircleButton.build 
package:magiceye/…/extra/circle_button.dart:29
#2      StatelessElement.build 
package:flutter/…/widgets/framework.dart:4291
#3      ComponentElement.performRebuild 
package:flutter/…/widgets/framework.dart:4223
#4      Element.rebuild 
package:flutter/…/widgets/framework.dart:3947
...
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═══════════════════════════════════
The getter 'value' was called on null.
Receiver: null
Tried calling: value
The relevant error-causing widget was
    MaterialApp 

calling value on null.

class CircleButton extends StatelessWidget {
final IconData icon;
final void Function() onPressed;
final BehaviorSubject orientationStream;

const CircleButton({
Key key,
@required this.icon,
this.onPressed,
this.orientationStream,
}) : assert(icon != null),
super(key: key);

Widget build(BuildContext context) {
Tuple2<int, int> orientations = Tuple2(0, 0);

return Circle(
  radius: 25,
  child: StreamBuilder<DeviceDirection>(
    initialData: orientationStream.value,    <-- orientationStream is null
@mateusfccp
Copy link
Owner

mateusfccp commented Jan 25, 2020

Hi, @sgehrman. Thanks for opening this issue.

Could you please send more info about your system, dart and flutter versions? If possible, paste here the results of flutter doctor -v.

I'm going to give it a look by tomorrow.

Thanks, in advance.

@mateusfccp mateusfccp self-assigned this Jan 25, 2020
@mateusfccp mateusfccp added the bug Something isn't working label Jan 25, 2020
Repository owner deleted a comment from sgehrman Jan 26, 2020
@mateusfccp
Copy link
Owner

@sgehrman I got to reproduce the issue easily.

It was a regression introduced in the last commit (18dee72).

@mateusfccp
Copy link
Owner

Issue fixed on v0.1.3+1 (87ac5ce).

This regression could be easily be detected if there was flutter component tests, so I'm going to implement it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants