Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Always finish the timeline event logged by Element.inflateWidget #101794

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

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

jason-simmons
Copy link
Member

Fixes #101379

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Apr 12, 2022
@goderbauer
Copy link
Member

Is it possible to add a test for this, maybe to https://github.com/flutter/flutter/blob/master/dev/tracing_tests/test/timeline_test.dart?

@goderbauer
Copy link
Member

goderbauer commented Apr 12, 2022

/cc @chunhtai FYI

@goderbauer
Copy link
Member

Tapping on the green square in the app below exercises the code path that doesn't finish the timeline event and reproduces the problem. The Container widget will have a start event, but no corresponding end event.

@jason-simmons Maybe you can turn this into an integration test similar to how it is done in dev/tracing_tests/test/inflate_widget_tracing_test.dart.

import 'package:flutter/material.dart';

void main() {
  runApp(const MyHomePage());
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final Key globalKey = GlobalKey();
  Key localKey = UniqueKey();

  @override
  Widget build(BuildContext context) {
    return Center(
      key: localKey,
      child: GestureDetector(
        onTap: () {
          setState(() {
            localKey = UniqueKey();
          });
        },
        child: Container(
          color: Colors.green,
          key: globalKey,
          width: 100,
          height: 100,
        ),
      ),
    );
  }
}

@jason-simmons
Copy link
Member Author

Added a test

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot fluttergithubbot merged commit c62d103 into flutter:master Apr 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Apr 13, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Apr 20, 2022
CaseyHillers pushed a commit that referenced this pull request Apr 20, 2022
…102193)

* Ensure that the engine frame callbacks are installed if the first scheduled frame is a forced frame (#101544)

See #98419

* Migrate common buttons to Material 3 (#100794)

* Always finish the timeline event logged by Element.inflateWidget (#101794)

* 'Create candidate branch version flutter-2.13-candidate.0 for beta'

* 'Update Engine revision to 24a02fa5ee681840cdc842c22f4cb4bdd5ec3115 for beta release 2.13.0-0.2.pre'

* Update release-candidate-branch.version

Co-authored-by: Jason Simmons <[email protected]>
Co-authored-by: Darren Austin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track widget builds is broken
3 participants