Skip to content

FlatButton has no debugFillProperties #11808

Closed

Description

@lishuhao
Widget widget = new FlatButton(
          onPressed: (){}, 
          child: new Text('你好')
);
print(widget);

In console only print FlatButton,i want detailed widget information ,like this FlatButton( onPressed: (){}, child: new Text('你好') )

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 29, 2017
  2. Hixie commented on Aug 29, 2017

    @Hixie
    Contributor

    This just needs a debugFillProperties method to be implemented on FlatButton.

  3. added this to the milestone on Aug 29, 2017
  4. changed the title [-]Ask: How to print the structure of the widget information[/-] [+]FlatButton has no debugFillProperties[/+] on Aug 29, 2017
  5. Hixie commented on Aug 29, 2017

    @Hixie
    Contributor

    @lishuhao To answer your question, for most objects in our framrwork just printing the object (e.g. a widget or BuildContext) should do what you want. You can often also do print('${object.toStringDeep()}'); to get the whole subtree. For FlatButton we happen to have forgotten to implement the code that gives you specific details.

  6. lishuhao commented on Aug 30, 2017

    @lishuhao
    Author

    @Hixie That solved my problem. Thank you very much!!

  7. jonahwilliams commented on Mar 5, 2018

    @jonahwilliams
    Contributor

    This looks to be fixed, can this issue be closed?

  8. Hixie commented on Mar 6, 2018

    @Hixie
    Contributor

    Yup!

  9. added a commit that references this issue on Sep 11, 2019
  10. added a commit that references this issue on Sep 12, 2019
  11. added a commit that references this issue on Sep 12, 2019
  12. added a commit that references this issue on Sep 13, 2019
  13. added a commit that references this issue on Sep 13, 2019
  14. github-actions commented on Aug 16, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions