flutter_simple_form_builder 0.0.2 copy "flutter_simple_form_builder: ^0.0.2" to clipboard
flutter_simple_form_builder: ^0.0.2 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 #

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: Texts.firstName.tr,
          flex: flex,
          type: MyFormType.text),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "lastname",
          title: Texts.lastName.tr,
          flex: flex,
          type: MyFormType.text),
    ],
    [
      MyFormObj(
        controller: TextEditingController(),
        serverName: "birth_day",
        title: Texts.birthday.tr,
        type: MyFormType.date,
        readOnly: true,
      ),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "province",
          title: Texts.province.tr,
          type: MyFormType.singleChoice,
          readOnly: true,
          choiceObjs: [
            ChoiceObj(id: 0, title: "Germany"),
            ChoiceObj(id: 1, title: "France"),
          ]),
    ],
    [
      MyFormObj(
          controller: TextEditingController(),
          serverName: "gender",
          title: Texts.gender.tr,
          type: MyFormType.singleChoice,
          readOnly: true,
          flex: flex,
          choiceObjs: [
            ChoiceObj(id: 0, title: Texts.male.tr),
            ChoiceObj(id: 1, title: Texts.female.tr),
          ])
    ],
  ];

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

Additional information #

nothing

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

An easy to use form builder

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, intl, numberpicker

More

Packages that depend on flutter_simple_form_builder