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

Orientation change clears canvas on iOS #10

Closed
kmusham opened this issue Jun 24, 2019 · 3 comments
Closed

Orientation change clears canvas on iOS #10

kmusham opened this issue Jun 24, 2019 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed
Milestone

Comments

@kmusham
Copy link

kmusham commented Jun 24, 2019

Hi,
One of our customers reported that changing the device orientations wipes or clears the signature they have added. This issue is happening only on iOS, android works fine.
Do you think it is a bug in the libraries, if so, do you have any recommendations for us until the issue is fixed?
Thanks

@MartinHlavna MartinHlavna added bug Something isn't working help wanted Extra attention is needed labels Aug 5, 2019
@MartinHlavna
Copy link
Member

Hi,
we will look on this. However if it is iOS only problem help would be welcomed.

@ioxua
Copy link

ioxua commented Nov 26, 2019

If you have a StatefulWidget, a possible workaround for this is saving the state yourself.
As a sidenote, I was able to reproduce the error on an Android app, so it is not iOS exclusive

class MyWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  List<Point> _currentPoints;

  @override
  Widget build(BuildContext context) {
    Signature signature = Signature(
      points: _currentPoints ?? [],
      onChanged: (newPoints) {
        setState(() {
          _currentPoints = newPoints;
        });
      },
    );
  }
}

@MartinHlavna
Copy link
Member

This is fixed in 3.0.0 as data are stored in controller not in widget itself

@MartinHlavna MartinHlavna added this to the 3.0.0 milestone Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants