getMemoryInfo method

List<Widget> getMemoryInfo(
  1. Map<IsolateRef, MemoryUsage> map
)

Implementation

List<Widget> getMemoryInfo(Map<IsolateRef, MemoryUsage> map) {
  List<Widget> widgets = <Widget>[];
  map.forEach((key, value) {
    widgets.add(
      RichText(
        text: TextSpan(
          children: [
            TextSpan(
              text: 'IsolateName: ',
              style: TextStyle(
                fontSize: 10,
                color: Color(0xff333333),
                height: 1.5,
              ),
            ),
            TextSpan(
              text: '${key.name}',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff666666),
              ),
            ),
            TextSpan(
              text: '\nHeapUsage: ',
              style: TextStyle(
                height: 1.5,
                fontSize: 10,
                color: Color(0xff333333),
              ),
            ),
            TextSpan(
              text: '${value.heapUsage?.byteFormat()}',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff666666),
              ),
            ),
            TextSpan(
              text: '\nHeapCapacity: ',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff333333),
              ),
            ),
            TextSpan(
              text: '${value.heapCapacity?.byteFormat()}',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff666666),
              ),
            ),
            TextSpan(
              text: '\nExternalUsage: ',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff333333),
              ),
            ),
            TextSpan(
              text: '${value.externalUsage?.byteFormat()}',
              style: TextStyle(
                fontSize: 10,
                height: 1.5,
                color: Color(0xff666666),
              ),
            ),
          ],
        ),
      ),
    );
  });
  return widgets;
}