simple_form_builder 0.0.14 copy "simple_form_builder: ^0.0.14" to clipboard
simple_form_builder: ^0.0.14 copied to clipboard

outdated

A simple form builder that lets you create a complete form from a simple JSON data.

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:simple_form_builder/formbuilder.dart';
import 'package:simple_form_builder/global/checklistModel.dart';
import 'package:simple_form_builder/global/constant.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'FormBuilder Example',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              FormBuilder(
                initialData: sampleData,
                index: 0,
                onUpload: fileUpload(),
                submitButtonWidth: 0.5,
                submitButtonDecoration: BoxDecoration(
                  color: Colors.blue,
                  borderRadius: BorderRadius.circular(10),
                ),
                showIcon: false,
                onSubmit: (ChecklistModel val) {
                  if (val == null) {
                    print("no data");
                  } else {
                    var json = jsonEncode(val.toJson());
                    print(json);
                  }
                },
              ),
            ],
          ),
        ),
      ),
    );
  }

  String fileUpload() {
    return "string";
  }
}
27
likes
0
pub points
56%
popularity

Publisher

unverified uploader

A simple form builder that lets you create a complete form from a simple JSON data.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, intl

More

Packages that depend on simple_form_builder