-
Notifications
You must be signed in to change notification settings - Fork 73
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
works in debug but throws Unhandled in release build #16
Comments
(The following has failed to resolve)
|
After a while of edit and test, I have found a quick fix about this problem, you could change the function _captureImage to like this and it will work on release build, (You 'll need to copy this library to your own directory to edit PageTurnWidget file) void _captureImage(Duration timeStamp) async { |
Thanks mate - it works. I was hoping for better performance once I could get it to work in release mode but unfortunately its still unusably slow . I might look into how to make the performance better. If you find anything please make sure you post it. |
Hi there! I'm writing 1 year later, but who knows, this can be interesting to someone: the original code snippet was probably this Gist. And it's very, very smooth. |
Nice work - much appreciated however..
Compiling in release mode throws this:
Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
it seems to be related to the following line in builders/widget.dart
WidgetsBinding.instance!.addPostFrameCallback(_captureImage);
Symptom: perfect in debug, blank screen in release
Fixing it is beyond my skill as I'm just learning.
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
E/flutter (18180):
E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208)
E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112)
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
E/flutter (18180):
E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208)
E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112)
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
E/flutter (18180):
E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208)
E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112)
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
E/flutter (18180):
E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208)
E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112)
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
E/flutter (18180):
E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.
E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208)
E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112)
E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40)
E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144)
E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090)
E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998)
E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354)
E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258)
E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162)
E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167)
E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259)
E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)
The text was updated successfully, but these errors were encountered: