easy_auto_form 0.0.2+4 copy "easy_auto_form: ^0.0.2+4" to clipboard
easy_auto_form: ^0.0.2+4 copied to clipboard

discontinued

Auto generate Form from json object

example/example.dart

import 'package:easy_auto_form/easy_auto_form.dart';

import 'package:flutter/material.dart';

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

  @override
  State<TestPage> createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> {
  final formKey = GlobalKey<FormState>();
  @override
  Widget build(BuildContext context) {
    var entity = <String, dynamic>{
      "name": "test",
      "age": 30,
      "height": 1.8,
      "isMarried": true,
    };
    return Scaffold(
      appBar: AppBar(
        title: const Text('TestPage'),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: EasyAutoForm(
            formKey: formKey,
            entity: entity,
            runDirection: RunDirection.vertical,
            expanded: true,
            onSave: (entity) {
              print(entity);
            },
            onCancel: () {},
            fieldsSettings: FieldsSettings(
              settings: [
                FieldSetting(
                    fieldKey: "name",
                    inputType: FieldInputType.autocomplete,
                    autocompleteSource: AutocompleteSource(
                      source: (pattern) async => [
                        "test",
                        "test2",
                        "test3",
                        "test4"
                      ].where((element) => element.contains(pattern)).toList(),
                    ))
              ],
            ),
          ),
        ),
      ),
    );
  }
}
2
likes
0
pub points
34%
popularity

Publisher

unverified uploader

Auto generate Form from json object

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on easy_auto_form