getValueWidget method

Widget getValueWidget(
  1. MapEntry entry
)

Implementation

Widget getValueWidget(MapEntry entry) {
  if (entry.value == null) {
    return const Expanded(
        child: Text(
      'undefined',
      style: TextStyle(color: Colors.grey, fontSize: fontSize),
    ));
  } else if (entry.value is int) {
    return Expanded(
        child: Text(
      entry.value.toString(),
      style: const TextStyle(color: Colors.teal, fontSize: fontSize),
    ));
  } else if (entry.value is String) {
    return Expanded(
        child: Text(
      '"${entry.value}""',
      style: const TextStyle(color: Colors.redAccent, fontSize: fontSize),
    ));
  } else if (entry.value is bool) {
    return Expanded(
        child: Text(
      entry.value.toString(),
      style: const TextStyle(color: Colors.purple, fontSize: fontSize),
    ));
  } else if (entry.value is double) {
    return Expanded(
        child: Text(
      entry.value.toString(),
      style: const TextStyle(color: Colors.teal, fontSize: fontSize),
    ));
  } else if (entry.value is List) {
    return const Text(
      '[',
      style: TextStyle(color: Colors.grey, fontSize: fontSize),
    );
  }
  return const Text(
    '{',
    style: TextStyle(color: Colors.grey, fontSize: fontSize),
  );
}