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

Failed assertion: line 853 pos 14: 'file != null': is not true. #26

Open
HamadBangash353 opened this issue Apr 29, 2021 · 1 comment
Open

Comments

@HamadBangash353
Copy link

HamadBangash353 commented Apr 29, 2021

======== Exception caught by widgets library =======================================================
The following assertion was thrown building HomePage(dirty, state: _HomePageState#6848e):
'package:flutter/src/painting/image_provider.dart': Failed assertion: line 853 pos 14: 'file != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
HomePage file:///C:/Users/WOL-91%20Hamad/AndroidStudioProjects/ImageEditorPro/example/lib/main.dart:12:12
When the exception was thrown, this was the stack:
#2 new FileImage (package:flutter/src/painting/image_provider.dart:853:14)
#3 new Image.file (package:flutter/src/widgets/image.dart:470:68)
#4 _HomePageState.build (package:image_editor_pro_example/main.dart:49:28)
#5 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)
#6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
...

======== Exception caught by widgets library =======================================================
'package:flutter/src/painting/image_provider.dart': Failed assertion: line 853 pos 14: 'file != null': is not true.
The relevant error-causing widget was:
HomePage file:///C:/Users/WOL-91%20Hamad/AndroidStudioProjects/ImageEditorPro/example/lib/main.dart:12:12

======== Exception caught by widgets library =======================================================
The following assertion was thrown building HomePage(dirty, state: _HomePageState#6848e):
'package:flutter/src/painting/image_provider.dart': Failed assertion: line 853 pos 14: 'file != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
HomePage file:///C:/Users/WOL-91%20Hamad/AndroidStudioProjects/ImageEditorPro/example/lib/main.dart:12:12
When the exception was thrown, this was the stack:
#2 new FileImage (package:flutter/src/painting/image_provider.dart:853:14)
#3 new Image.file (package:flutter/src/widgets/image.dart:470:68)
#4 _HomePageState.build (package:image_editor_pro_example/main.dart:49:28)
#5 StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)
#6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)

RUN YOUR GITHUB CODE AND IT IS GIVING THIS ERROR.

@dernoun
Copy link

dernoun commented Apr 29, 2021

@HamadBangash353
replace this
Image.file(_image).toCenter()
by this
_image == null ? Container() : Image.file(_image).toCenter()

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

2 participants