flat 0.5.0 copy "flat: ^0.5.0" to clipboard
flat: ^0.5.0 copied to clipboard

0 dependency package to convert a nested Map and flatten it into a single depth Map, and recover it later. Based on Node.js `flat` package.

example/main.dart

import 'package:flat/flat.dart';

// ignore_for_file: avoid_print

void main() {
  final flat = flatten(
    {
      "a": 1,
      "list1": ["item1", "item2"],
      "f": {
        "list2": ["item3", "item4", "item5"],
        "list3": [
          {"item3": "item47"},
          {"item4": "item48"},
          {"item5": "item49"},
        ],
        "g": 2,
        "h": true,
        "j": "text",
      },
    },
  );
  print(flat);

  print(unflatten(flat));
}
12
likes
140
pub points
85%
popularity

Publisher

unverified uploader

0 dependency package to convert a nested Map and flatten it into a single depth Map, and recover it later. Based on Node.js `flat` package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on flat