flutter_simple_form_builder 0.0.5 copy "flutter_simple_form_builder: ^0.0.5" to clipboard
flutter_simple_form_builder: ^0.0.5 copied to clipboard

An easy to use form builder

You can create forms very easy in minimum lines of code

Features #

it can create form

Getting started #

just create list of MyFormObj

Usage #

import 'package:flutter/material.dart';

import 'package:flutter_simple_form_builder/flutter_form_builder.dart';
import 'package:flutter_simple_form_builder/form_obj.dart';


Future<void> main() async {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({
    Key? key,
  }) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<TextEditingController> controllers = [];
  List<List<MyFormObj>> fullFormObjList = [
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "firstname",
          title: "firstname",
          type: MyFormType.text),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "lastname",
          title: "lastname",
          type: MyFormType.text),
    ],
    [
      MyFormObj(
        controller: TextEditingController(),
        serverName: "birth_day",
        title: "Birthday",
        type: MyFormType.date,
        readOnly: true,
      ),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "province",
          title: "Province",
          type: MyFormType.singleChoice,
          readOnly: true,
          choiceObjs: [
            ChoiceObj(id: 0, title: "Germany"),
            ChoiceObj(id: 1, title: "France"),
          ]),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "gender",
          title: "Gender",
          type: MyFormType.singleChoice,
          readOnly: true,
          choiceObjs: [
            ChoiceObj(id: 0, title: "Male"),
            ChoiceObj(id: 1, title: "Female"),
          ])
    ],
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          title: Text("Example"),
        ),
        body: SingleChildScrollView(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Text("Complete Form Please",style: TextStyle(fontSize: 18),),
              MyFormBuilder(fullFormObjList: fullFormObjList,onSubmit: (map){
                print(map);
              },),
            ],
          ),
        ),
      ),
    );
  }
}


Additional information #

nothing

0
likes
50
pub points
0%
popularity

Publisher

unverified uploader

An easy to use form builder

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter, intl, numberpicker

More

Packages that depend on flutter_simple_form_builder