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

Handle deeply nested objects #1679

Open
rrousselGit opened this issue Feb 27, 2020 · 4 comments
Open

Handle deeply nested objects #1679

rrousselGit opened this issue Feb 27, 2020 · 4 comments
Assignees
Milestone

Comments

@rrousselGit
Copy link
Contributor

The devtool seems to not support "expanding" deeply nested objects

Diagnosticable objects with diagnosticable members, or lists of diagnosticable objects may print in not show the full information.

To be more specific, it seems like the devtool only a fixed depth and then fallback to showing toString instead of having the "expandable" feature.

Would it be possible to remove this toString fallback and support deeply nested objects?

@jacob314
Copy link
Contributor

Can you provide a repro? There is not a fallback to toString but it sounds like something is going wrong with how some objects are deserialized.

@rrousselGit
Copy link
Contributor Author

rrousselGit commented Feb 28, 2020

Sure:

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class A with DiagnosticableTreeMixin {
  A(this.a, this.b);
  final String a;
  final B b;

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(StringProperty('a', a));
    properties.add(DiagnosticsProperty<B>('b', b));
  }
}

class B with DiagnosticableTreeMixin {
  B(this.b);

  final String b;
  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(StringProperty('b', b));
  }
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox.expand();
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);

    properties.add(DiagnosticsProperty('a', A('a', B('b'))));
    properties.add(DiagnosticsProperty('b', B('b')));
  }
}

Screenshot 2020-02-28 at 18 03 14

In this screenshot, we can see that B cannot be expanded if it is a descendant of A.
But if we use it independently from A, then B can correctly be expanded.

@rrousselGit
Copy link
Contributor Author

Anything I can do to help this progress?

@kenzieschmoll
Copy link
Member

@jacob314 any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants