FLUTTER ECOSYSTEM

damphat/json5-dart

JSON5 para dart e flutter

Capa do projeto json5-dart
Stars
13
Forks
5
Último push (UTC)
23 de fev. de 2025
Status do projeto
Ativo
Phat GitHub avatar
GITHUB User

Phat ↗

Full-stack developer, open source enthusiast.

HCM City, VietnamSite oficial ↗
LinguagensDart

Tópicos técnicos

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 2 itens
  • lintsDesenvolvimento^3.0.0
  • testDesenvolvimento^1.14.4

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher README

JSON5 for Dart and Flutter

Dart CI

This Dart package is a port of JSON5, originally written in pure JavaScript.

It follows the same algorithms and specifications as the original JSON5, ensuring identical behavior.

However, Dart has different naming conventions—see the example below.

Usage

import 'package:json5/json5.dart';

void main() {
  var obj = JSON5.parse('''
      {  
        /* Comment block */  
        name: { first: "Phat" },  
        lang: ["C++", "Dart", "Kotlin"],  
        nums: [NaN, Infinity, -Infinity]  
      } // End object
  ''');

  var compact = JSON5.stringify(obj);
  print(compact);

  var pretty = JSON5.stringify(obj, space: 2);
  print(pretty);
}

References