Closed ctkqiang closed 4 years ago
bool _topContainerHasFocus = true; ... ... void _switchFocus() { if (_topContainerHasFocus) { _topContainerHeight = _shrunkenHeight; _bottomContainerHeight = _focusedHeight; _topContainerHasFocus = false; } else { _topContainerHeight = _focusedHeight; _bottomContainerHeight = _shrunkenHeight; _topContainerHasFocus = true; } } ... ... AnimatedQRView scannerFunctionality() { return AnimatedQRView( squareBorderColor: Colors.blue, animationDuration: const Duration( milliseconds: 40, ), onScanBeforeAnimation: (String str) { debugPrint(str); }, onScan: (String something) { debugPrint(something); }, controller: controller, ); } AnimatedContainer qrScanner() { return AnimatedContainer( duration: const Duration(milliseconds: 60), curve: Curves.bounceIn, child: GestureDetector( onTap: () { setState(() { _switchFocus(); resumeScanner(); }); }, child: Container( width: _bottomContainerHeight * 0.75, height: _bottomContainerHeight * 0.75, decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(12)), color: Colors.white, ), child: Expanded( flex: 5, child: scannerFunctionality(), ), ), ), ); }
and I got error like
I/Camera (19607): handleMessage: 16 D/BufferQueueProducer(19607): [SurfaceTexture-0-19607-0](this:0x7b0559a800,id:0,api:1,p:577,c:19607) cancelBuffer: slot 0 I/BufferQueueProducer(19607): [SurfaceTexture-0-19607-1](this:0x7af2c36000,id:1,api:4,p:654,c:19607) queueBuffer: slot 2 is dropped,
I solved it with
void reRegisterCamerOverlay() { controller.flipCamera(); controller.flipCamera(); }
which in implement into the setState(); and it worked!
setState();
and I got error like