json_builder 0.0.1 copy "json_builder: ^0.0.1" to clipboard
json_builder: ^0.0.1 copied to clipboard

A visual tool to build Json objects

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:json_builder/json_builder.dart';

void main() => runApp(App());

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) => MaterialApp(home: Example());
}

class Example extends StatefulWidget {
  const Example({super.key});

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  Json json = {
    'name': 'John Doe',
    'age': 30,
    'isStudent': false,
    'address': {
      'street': '123 Main St',
      'city': 'Springfield',
      'state': 'IL',
      'zip': '62701',
    },
    'children': [
      {'name': 'Jane Doe', 'age': 10},
      {'name': 'Jimmy Doe', 'age': 5},
    ],
  };

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Example')),
      body: Column(
        children: [
          Expanded(
            child: JsonBuilder(
              initialJson: json,
              onJsonChanged: (json) => setState(() => this.json = json),
            ),
          ),
        ],
      ),
    );
  }
}
0
likes
150
points
19
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A visual tool to build Json objects

License

MIT (license)

Dependencies

flutter

More

Packages that depend on json_builder