easy_form_builder 1.0.3 copy "easy_form_builder: ^1.0.3" to clipboard
easy_form_builder: ^1.0.3 copied to clipboard

Flutter easy form builder allow user to create form easily. Follow example to understand features

example/lib/main.dart

import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:easy_form_builder/easy_form_builder.dart';
import 'package:easy_form_builder_example/ws_form.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  Map<String, dynamic> values = {};
  var formKey = GlobalKey<FormState>();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Dynamic Form Plugin example app'),
        ),
        body: Center(
          child: SingleChildScrollView(
            child: Column(
              children: [
                Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: EasyFormBuilder(
                    formKey: formKey,
                    params: WsFormTypes.simpleContact.wsParams,
                    paramValues: values,
                    icon: true,
                    forcedColumnNumber: 2,
                  ),
                ),
                SizedBox(
                  height: 20,
                ),
                ElevatedButton(
                  onPressed: () {
                    if (formKey.currentState!.validate()) {
                      formKey.currentState!.save();
                      debugPrint(json.encode(values));
                    }
                  },
                  child: const Text("Submit"),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
92
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter easy form builder allow user to create form easily. Follow example to understand features

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dynamic_fonts, flutter, flutter_gradient_selector, flutter_staggered_grid_view, intl

More

Packages that depend on easy_form_builder