formify 1.0.0 copy "formify: ^1.0.0" to clipboard
formify: ^1.0.0 copied to clipboard

With Formify, you can quickly and easily create forms with customizable widget and strong validation.

example/lib/main.dart

import 'package:example/form_demo.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: 'Formify Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final formDemo = FormDemo();

  @override
  void initState() {
    super.initState();
    formDemo.setInitialValues({
      'username': 'thisismyusername',
      'password': 'password',
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Formify Demo'),
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
        child: Column(
          children: [
            ...formDemo.getWidgets(),
            FilledButton(
              onPressed: () {
                if (formDemo.isFormValid()) {
                  //DO SOMETHING
                }
              },
              child: const Text('Login'),
            ),
          ],
        ),
      ),
    );
  }
}
3
likes
140
pub points
55%
popularity

Publisher

verified publisherteknologicakrainternasional.com

With Formify, you can quickly and easily create forms with customizable widget and strong validation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on formify