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

[bug] size change callback from _MeasureSize not working with AnimatedSize #55

Closed
daadu opened this issue Sep 19, 2020 · 2 comments · Fixed by #57
Closed

[bug] size change callback from _MeasureSize not working with AnimatedSize #55

daadu opened this issue Sep 19, 2020 · 2 comments · Fixed by #57
Assignees
Labels
bug Something isn't working

Comments

@daadu
Copy link
Member

daadu commented Sep 19, 2020

To Reproduce

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  String text = "Back Layer 1";
  double height = 100;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "Backdrop Example",
      theme: ThemeData(
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: BackdropScaffold(
        appBar: BackdropAppBar(
          title: Text("Backdrop Example"),
          actions: <Widget>[
            LayoutBuilder(
              builder: (context, constraints) => IconButton(
                icon: Icon(Icons.terrain),
                onPressed: () {
                  setState(() {
                    height = 200;
                    text = "Back Layer 2";
                  });
                },
              ),
            ),
          ],
        ),
        stickyFrontLayer: true,
        backLayer: AnimatedSize(
          vsync: this,
          duration: Duration(milliseconds: 200),
          child: Container(
            height: height,
            child: Center(child: Text(text)),
          ),
        ),
        frontLayer: Center(
          child: Text("Front Layer"),
        ),
      ),
    );
  }
}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

Additional context
Reported by: @proninyaroslav

@daadu
Copy link
Member Author

daadu commented Sep 19, 2020

@proninyaroslav Test the fix against fix/measure_size branch.

@proninyaroslav
Copy link
Contributor

Works great, thanks.

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

Successfully merging a pull request may close this issue.

2 participants