cumulations_form_generators 1.0.1 copy "cumulations_form_generators: ^1.0.1" to clipboard
cumulations_form_generators: ^1.0.1 copied to clipboard

This package is used to generate forms for data classes. It uses annotations to generate the form. The package also includes a form generator that generates the form based on the cumulation_form_annotations

example/lib/main.dart

import 'package:example/subscriber/subscriber_form.dart';
import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Form Generator Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

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

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

class _HomePageState extends State<HomePage> {
  Subscriber subscriberForm = Subscriber();

  @override
  void initState() {}

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          centerTitle: true,
          title: const Text(
            'Form Generator Example',
          ),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              subscriberForm.getView(),
              SizedBox(
                height: 20,
              ),
              TextButton(
                child: const Text('Submit'),
                onPressed: () {
                  print(subscriberForm.getFormData());
                  print(subscriberForm
                      .fromMap(subscriberForm.getFormData())
                      .email);
                },
              )
            ],
          ),
        ));
  }
}
6
likes
120
points
44
downloads

Documentation

API reference

Publisher

verified publishercumulations.com

Weekly Downloads

This package is used to generate forms for data classes. It uses annotations to generate the form. The package also includes a form generator that generates the form based on the cumulation_form_annotations

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, build, cumulations_form_annotations, source_gen

More

Packages that depend on cumulations_form_generators