super_form 1.0.2 copy "super_form: ^1.0.2" to clipboard
super_form: ^1.0.2 copied to clipboard

Quick, familiar and extensible forms in Flutter. No magical configuration required. Comes with form widgets, error text and many validation rules.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:super_form_example/sign_up/sign_up.dart';
import 'package:super_form_example/survey/survey.dart';

import 'burritox/burritox.dart';

void main() {
  runApp(ExamplesApp());
}

/// Entrypoint for the super SuperForm examples.
///
/// Visit https://superform.dev
class ExamplesApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      restorationScopeId: "example_app",
      title: 'Super Form Demo',
      onGenerateRoute: (routeSettings) {
        switch (routeSettings.name) {
          case "sign_up":
            return MaterialPageRoute(builder: (_) => const SignUpPage());
          case "burritox":
            return MaterialPageRoute(
              builder: (_) => Theme(
                data: ThemeData(primarySwatch: Colors.deepOrange),
                child: const Burritox(),
              ),
            );
          case "survey":
            return MaterialPageRoute(
              builder: (_) => Theme(
                data: ThemeData(primarySwatch: Colors.green),
                child: const SurveyPage(),
              ),
            );
        }
        return null;
      },
      home: Scaffold(
        appBar: AppBar(
          title: const Text(
            "SuperForm examples library 📕",
          ),
        ),
        body: Builder(
          builder: (context) => ListView(
            children: [
              ListTile(
                title: const Text("Sign Up"),
                subtitle:
                    const Text("Classic sign up form with gradual validation"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("sign_up");
                },
              ),
              ListTile(
                title: const Text("Survey"),
                subtitle: const Text(
                    "Survey with sliders, dynamic email field, navigation block and loading state"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("survey");
                },
              ),
              ListTile(
                title: const Text("Burritox"),
                subtitle: const Text(
                    "Takeaway order with checkboxes, dynamic rules and editing"),
                onTap: () {
                  Navigator.of(context).restorablePushNamed("burritox");
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
32
likes
90
points
66
downloads

Publisher

verified publisherpr0gramista.pl

Weekly Downloads

Quick, familiar and extensible forms in Flutter. No magical configuration required. Comes with form widgets, error text and many validation rules.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

equatable, flutter

More

Packages that depend on super_form