Add CpuProfileDataJson extension type for handling this data (#6980) An alternative to some of the code in https://github.com/flutter/devtools/pull/6948 Work towards https://github.com/flutter/devtools/issues/6929 This one is again fairly simple. `CpuProfileData.parse` used to handle all of the parsing as statements, and relies on a fair amount of dynamic calling. When we extract the field calls into extension type getters, the casting etc is isolated to that section of the code. The statements in `CpuProfileData.parse` get simpler. This could probably be improved more; I think `CpuProfileMetaData()` should just accept a `_CpuProfileDataJson` and get the data it needs. But that can be for later. Or now. Also all of the null-aware code could also be moved into the extension type. Depending on the business logic. Is it ever important to know if `sampleCount` is `null`? Or can we default it to `0` at the root? Etc.
Dart & Flutter DevTools is a suite of performance tools for Dart and Flutter.
For documentation on installing and trying out DevTools, please see our docs.
Contributions welcome! See our contributing page for an overview of how to build and contribute to the project.
By using Dart DevTools, you agree to the Google Terms of Service. To understand how we use data collected from this service, see the Google Privacy Policy.